Title: [116186] trunk/Source
Revision
116186
Author
[email protected]
Date
2012-05-04 15:59:34 -0700 (Fri, 04 May 2012)

Log Message

[chromium] Add plumbing for file display names for drag and drop
https://bugs.webkit.org/show_bug.cgi?id=85673

Patch by Satoru Takabayashi <[email protected]> on 2012-05-04
Reviewed by Darin Fisher.

Source/WebCore:

No new tests: this change itself shouldn't change existing behavior.

* platform/chromium/ChromiumDataObject.cpp:
(WebCore::ChromiumDataObject::addFilename):
* platform/chromium/ChromiumDataObject.h:
(ChromiumDataObject):

Source/WebKit/chromium:

* public/platform/WebDragData.h:
* src/WebDragData.cpp:
(WebKit::WebDragData::items):
(WebKit::WebDragData::addItem):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116185 => 116186)


--- trunk/Source/WebCore/ChangeLog	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebCore/ChangeLog	2012-05-04 22:59:34 UTC (rev 116186)
@@ -1,3 +1,17 @@
+2012-05-04  Satoru Takabayashi  <[email protected]>
+
+        [chromium] Add plumbing for file display names for drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=85673
+
+        Reviewed by Darin Fisher.
+
+        No new tests: this change itself shouldn't change existing behavior.
+
+        * platform/chromium/ChromiumDataObject.cpp:
+        (WebCore::ChromiumDataObject::addFilename):
+        * platform/chromium/ChromiumDataObject.h:
+        (ChromiumDataObject):
+
 2012-05-04  Levi Weintraub  <[email protected]>
 
         Correct pixel snapping in RenderSVGRoot::paintReplaced

Modified: trunk/Source/WebCore/platform/chromium/ChromiumDataObject.cpp (116185 => 116186)


--- trunk/Source/WebCore/platform/chromium/ChromiumDataObject.cpp	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebCore/platform/chromium/ChromiumDataObject.cpp	2012-05-04 22:59:34 UTC (rev 116186)
@@ -202,9 +202,9 @@
     return results;
 }
 
-void ChromiumDataObject::addFilename(const String& filename)
+void ChromiumDataObject::addFilename(const String& filename, const String& displayName)
 {
-    internalAddFileItem(ChromiumDataObjectItem::createFromFile(File::create(filename)));
+    internalAddFileItem(ChromiumDataObjectItem::createFromFile(File::createWithName(filename, displayName)));
 }
 
 void ChromiumDataObject::addSharedBuffer(const String& name, PassRefPtr<SharedBuffer> buffer)

Modified: trunk/Source/WebCore/platform/chromium/ChromiumDataObject.h (116185 => 116186)


--- trunk/Source/WebCore/platform/chromium/ChromiumDataObject.h	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebCore/platform/chromium/ChromiumDataObject.h	2012-05-04 22:59:34 UTC (rev 116186)
@@ -81,7 +81,7 @@
     // Used for dragging in files from the desktop.
     bool containsFilenames() const;
     Vector<String> filenames() const;
-    void addFilename(const String&);
+    void addFilename(const String& filename, const String& displayName);
 
     // Used to handle files (images) being dragged out.
     void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>);

Modified: trunk/Source/WebKit/chromium/ChangeLog (116185 => 116186)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-04 22:59:34 UTC (rev 116186)
@@ -1,3 +1,15 @@
+2012-05-04  Satoru Takabayashi  <[email protected]>
+
+        [chromium] Add plumbing for file display names for drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=85673
+
+        Reviewed by Darin Fisher.
+
+        * public/platform/WebDragData.h:
+        * src/WebDragData.cpp:
+        (WebKit::WebDragData::items):
+        (WebKit::WebDragData::addItem):
+
 2012-05-04  Adam Barth  <[email protected]>
 
         Refactor CSP state to prepare for having both a ReportOnly and an Enforced policy

Modified: trunk/Source/WebKit/chromium/public/platform/WebDragData.h (116185 => 116186)


--- trunk/Source/WebKit/chromium/public/platform/WebDragData.h	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebKit/chromium/public/platform/WebDragData.h	2012-05-04 22:59:34 UTC (rev 116186)
@@ -70,6 +70,7 @@
 
         // Only valid when storageType == StorageTypeFilename.
         WebString filenameData;
+        WebString displayNameData;
 
         // Only valid when storageType == StorageTypeBinaryData.
         WebData binaryData;

Modified: trunk/Source/WebKit/chromium/src/WebDragData.cpp (116185 => 116186)


--- trunk/Source/WebKit/chromium/src/WebDragData.cpp	2012-05-04 22:55:01 UTC (rev 116185)
+++ trunk/Source/WebKit/chromium/src/WebDragData.cpp	2012-05-04 22:59:34 UTC (rev 116186)
@@ -88,6 +88,7 @@
                 if (blob->isFile()) {
                     File* file = static_cast<File*>(blob.get());
                     item.filenameData = file->path();
+                    item.displayNameData = file->name();
                 } else
                     ASSERT_NOT_REACHED();
             } else
@@ -121,7 +122,7 @@
             m_private->setData(item.stringType, item.stringData);
         return;
     case Item::StorageTypeFilename:
-        m_private->addFilename(item.filenameData);
+        m_private->addFilename(item.filenameData, item.displayNameData);
         return;
     case Item::StorageTypeBinaryData:
         // This should never happen when dragging in.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to