Remove more dead code
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2015 01:47:04 +0000 (01:47 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2015 01:47:04 +0000 (01:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151170

Reviewed by Beth Dakin.

* platform/ContextMenu.cpp:
(WebCore::findItemWithAction): Deleted.
(WebCore::ContextMenu::itemWithAction): Deleted.
* platform/ContextMenu.h:
(WebCore::ContextMenu::itemAtIndex): Deleted.
* platform/ContextMenuItem.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ContextMenu.cpp
Source/WebCore/platform/ContextMenu.h
Source/WebCore/platform/ContextMenuItem.h

index 03def5f..4ed2175 100644 (file)
@@ -1,5 +1,19 @@
 2015-11-11  Anders Carlsson  <andersca@apple.com>
 
+        Remove more dead code
+        https://bugs.webkit.org/show_bug.cgi?id=151170
+
+        Reviewed by Beth Dakin.
+
+        * platform/ContextMenu.cpp:
+        (WebCore::findItemWithAction): Deleted.
+        (WebCore::ContextMenu::itemWithAction): Deleted.
+        * platform/ContextMenu.h:
+        (WebCore::ContextMenu::itemAtIndex): Deleted.
+        * platform/ContextMenuItem.h:
+
+2015-11-11  Anders Carlsson  <andersca@apple.com>
+
         De-indent ContextMenu.h and ContextMenuItem.h.
 
         Rubber-stamped by Andreas Kling.
index 0bd1bf2..f316da3 100644 (file)
@@ -34,28 +34,6 @@ ContextMenu::ContextMenu()
 {
 }
 
-static const ContextMenuItem* findItemWithAction(unsigned action, const Vector<ContextMenuItem>& items)
-{
-    for (size_t i = 0; i < items.size(); ++i) {
-        const ContextMenuItem& item = items[i];
-        if (item.action() == static_cast<ContextMenuAction>(action))
-            return &item;
-        if (item.type() != SubmenuType)
-            continue;
-        if (const ContextMenuItem* subMenuItem = findItemWithAction(action, item.subMenuItems()))
-            return subMenuItem;
-    }
-
-    return 0;
-}
-
-ContextMenuItem* ContextMenu::itemWithAction(unsigned action)
-{
-    // FIXME: When more platforms switch over, this fucntion should return a const ContextMenuItem*'s, and the const_cast
-    // won't be needed anymore.
-    return const_cast<ContextMenuItem*>(findItemWithAction(action, m_items));
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(CONTEXT_MENUS) && USE(CROSS_PLATFORM_CONTEXT_MENUS)
index 8bf38e7..bc41a0a 100644 (file)
@@ -49,19 +49,7 @@ class ContextMenu {
 public:
     ContextMenu();
 
-    ContextMenuItem* itemWithAction(unsigned);
-
 #if USE(CROSS_PLATFORM_CONTEXT_MENUS)
-    explicit ContextMenu(PlatformContextMenu);
-
-    PlatformContextMenu platformContextMenu() const;
-
-    static PlatformContextMenu createPlatformContextMenuFromItems(const Vector<ContextMenuItem>&);
-    static void getContextMenuItems(PlatformContextMenu, Vector<ContextMenuItem>&);
-
-    // FIXME: When more platforms switch over, this should return const ContextMenuItem*'s.
-    ContextMenuItem* itemAtIndex(unsigned index) { return &m_items[index]; }
-
     void setItems(const Vector<ContextMenuItem>& items) { m_items = items; }
     const Vector<ContextMenuItem>& items() const { return m_items; }
 
@@ -73,8 +61,6 @@ public:
     void insertItem(unsigned position, ContextMenuItem&);
     void appendItem(ContextMenuItem&);
 
-    ContextMenuItem* itemAtIndex(unsigned, const PlatformMenuDescription);
-
     unsigned itemCount() const;
 
     WEBCORE_EXPORT PlatformMenuDescription platformDescription() const;
index 9ac7c5b..eeef510 100644 (file)
@@ -205,15 +205,10 @@ public:
 
 #if USE(CROSS_PLATFORM_CONTEXT_MENUS)
     ContextMenuItem(ContextMenuAction, const String&, bool enabled, bool checked, const Vector<ContextMenuItem>& subMenuItems);
-    explicit ContextMenuItem(const PlatformContextMenuItem&);
     ContextMenuItem();
 
     bool isNull() const;
 
-    // On Windows, the title (dwTypeData of the MENUITEMINFO) is not set in this function. Callers can set the title themselves,
-    // and handle the lifetime of the title, if they need it.
-    PlatformContextMenuItem platformContextMenuItem() const;
-
     void setTitle(const String& title) { m_title = title; }
     const String& title() const { return m_title; }