Title: [94507] trunk/Source/WebKit/chromium
Revision
94507
Author
[email protected]
Date
2011-09-04 14:24:22 -0700 (Sun, 04 Sep 2011)

Log Message

[Chromium] Add mutliple to WebPopupMenuInfo for Android
https://bugs.webkit.org/show_bug.cgi?id=67576

Reviewed by Darin Fisher.

This flag requests that the embedder allow multiple selection for the
popup menu.  (See also https://bugs.webkit.org/show_bug.cgi?id=67574.)

* public/WebPopupMenuInfo.h:
* src/ExternalPopupMenu.cpp:
(WebKit::ExternalPopupMenu::getPopupMenuInfo):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (94506 => 94507)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-09-04 21:19:40 UTC (rev 94506)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-09-04 21:24:22 UTC (rev 94507)
@@ -1,5 +1,19 @@
 2011-09-04  Adam Barth  <[email protected]>
 
+        [Chromium] Add mutliple to WebPopupMenuInfo for Android
+        https://bugs.webkit.org/show_bug.cgi?id=67576
+
+        Reviewed by Darin Fisher.
+
+        This flag requests that the embedder allow multiple selection for the
+        popup menu.  (See also https://bugs.webkit.org/show_bug.cgi?id=67574.)
+
+        * public/WebPopupMenuInfo.h:
+        * src/ExternalPopupMenu.cpp:
+        (WebKit::ExternalPopupMenu::getPopupMenuInfo):
+
+2011-09-04  Adam Barth  <[email protected]>
+
         [Chromium] Add memory threshold values to WebKitPlatformSupport.h
         https://bugs.webkit.org/show_bug.cgi?id=67575
 

Modified: trunk/Source/WebKit/chromium/public/WebPopupMenuInfo.h (94506 => 94507)


--- trunk/Source/WebKit/chromium/public/WebPopupMenuInfo.h	2011-09-04 21:19:40 UTC (rev 94506)
+++ trunk/Source/WebKit/chromium/public/WebPopupMenuInfo.h	2011-09-04 21:24:22 UTC (rev 94507)
@@ -43,8 +43,9 @@
     int selectedIndex;
     WebVector<WebMenuItemInfo> items;
     bool rightAligned;
+    bool allowMultipleSelection;
 };
 
-} // namespace WebKit
+}
 
 #endif

Modified: trunk/Source/WebKit/chromium/src/ExternalPopupMenu.cpp (94506 => 94507)


--- trunk/Source/WebKit/chromium/src/ExternalPopupMenu.cpp	2011-09-04 21:19:40 UTC (rev 94506)
+++ trunk/Source/WebKit/chromium/src/ExternalPopupMenu.cpp	2011-09-04 21:24:22 UTC (rev 94507)
@@ -128,8 +128,7 @@
 void ExternalPopupMenu::getPopupMenuInfo(WebPopupMenuInfo* info)
 {
     int itemCount = m_popupMenuClient->listSize();
-    WebVector<WebMenuItemInfo> items(
-        static_cast<size_t>(itemCount));
+    WebVector<WebMenuItemInfo> items(static_cast<size_t>(itemCount));
     for (int i = 0; i < itemCount; ++i) {
         WebMenuItemInfo& popupItem = items[i];
         popupItem.label = m_popupMenuClient->itemText(i);
@@ -150,12 +149,15 @@
     }
 
     info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().height();
-    info->itemFontSize =
-        static_cast<int>(m_popupMenuClient->menuStyle().font().size());
+    info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font().size());
     info->selectedIndex = m_popupMenuClient->selectedIndex();
-    info->rightAligned =
-        m_popupMenuClient->menuStyle().textDirection() == WebCore::RTL;
+    info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == WebCore::RTL;
+#if ENABLE(NO_LISTBOX_RENDERING)
+    // FIXME: Why is this cast safe?
+    ListPopupMenuClient* client = static_cast<ListPopupMenuClient*>(m_popupMenuClient);
+    info->allowMultipleSelection = client->multiple();
+#endif
     info->items.swap(items);
 }
 
-} // namespace WebKit
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to