[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

jianli at chromium.org jianli at chromium.org
Thu Oct 29 20:35:07 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 08568b5a1224b4f988b1ada593f1198409df0ece
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 28 18:13:00 2009 +0000

    [chromium] DragData::asURL should return file URL.
    https://bugs.webkit.org/show_bug.cgi?id=29109
    
    Reviewed by David Levin.
    
    Tested by LayoutTests/fast/events/drag-to-navigate.html.
    
    * platform/FileSystem.h:
    * platform/chromium/ChromiumBridge.h:
    * platform/chromium/DragDataChromium.cpp:
    (WebCore::DragData::asURL):
    * platform/chromium/FileSystemChromium.cpp:
    (WebCore::getAbsolutePath):
    (WebCore::isDirectory):
    (WebCore::filePathToURL):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 90771bc..7b8cda3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2009-09-28  Jian Li  <jianli at chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] DragData::asURL should return file URL.
+        https://bugs.webkit.org/show_bug.cgi?id=29109
+
+        Tested by LayoutTests/fast/events/drag-to-navigate.html.
+
+        * platform/FileSystem.h:
+        * platform/chromium/ChromiumBridge.h:
+        * platform/chromium/DragDataChromium.cpp:
+        (WebCore::DragData::asURL):
+        * platform/chromium/FileSystemChromium.cpp:
+        (WebCore::getAbsolutePath):
+        (WebCore::isDirectory):
+        (WebCore::filePathToURL):
+
 2009-09-28  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h
index 958eb73..110204b 100644
--- a/WebCore/platform/FileSystem.h
+++ b/WebCore/platform/FileSystem.h
@@ -49,6 +49,7 @@
 #include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
+#include "KURL.h"
 #include "PlatformString.h"
 
 typedef const struct __CFData* CFDataRef;
@@ -172,6 +173,9 @@ String filenameForDisplay(const String&);
 
 #if PLATFORM(CHROMIUM)
 String pathGetDisplayFileName(const String&);
+String getAbsolutePath(const String&);
+bool isDirectory(const String&);
+KURL filePathToURL(const String&);
 #endif
 
 } // namespace WebCore
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index 0505d07..1afcc23 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -96,6 +96,9 @@ namespace WebCore {
         static String directoryName(const String& path);
         static String pathByAppendingComponent(const String& path, const String& component);
         static bool makeAllDirectories(const String& path);
+        static String getAbsolutePath(const String&);
+        static bool isDirectory(const String&);
+        static KURL filePathToURL(const String&);
 
         // Font ---------------------------------------------------------------
 #if PLATFORM(WIN_OS)
diff --git a/WebCore/platform/chromium/DragDataChromium.cpp b/WebCore/platform/chromium/DragDataChromium.cpp
index 7ca05e8..4083b80 100644
--- a/WebCore/platform/chromium/DragDataChromium.cpp
+++ b/WebCore/platform/chromium/DragDataChromium.cpp
@@ -67,9 +67,9 @@ String DragData::asURL(String* title) const
         url = m_platformDragData->url.string();
     else if (m_platformDragData->filenames.size() == 1) {
         String fileName = m_platformDragData->filenames[0];
-        // FIXME: Add isDirectory to FileSystem so that we can check if it is not a directory.
-        if (fileExists(fileName))
-            url = fileName;
+        fileName = getAbsolutePath(fileName);
+        if (fileExists(fileName) && !isDirectory(fileName))
+            url = filePathToURL(fileName).string();
     }
  
     // |title| can be NULL
diff --git a/WebCore/platform/chromium/FileSystemChromium.cpp b/WebCore/platform/chromium/FileSystemChromium.cpp
index 30674d9..9e7424d 100644
--- a/WebCore/platform/chromium/FileSystemChromium.cpp
+++ b/WebCore/platform/chromium/FileSystemChromium.cpp
@@ -77,4 +77,19 @@ bool fileExists(const String& path)
     return ChromiumBridge::fileExists(path);
 }
 
+String getAbsolutePath(const String& path)
+{
+    return ChromiumBridge::getAbsolutePath(path);
+}
+
+bool isDirectory(const String& path)
+{
+    return ChromiumBridge::isDirectory(path);
+}
+
+KURL filePathToURL(const String& path)
+{
+    return ChromiumBridge::filePathToURL(path);
+}
+
 } // namespace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list