Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: Source/WebCore/platform/chromium/ContextMenuChromium.cpp

Issue 14185003: Use ContextMenu code path that was guarded by CROSS_PLATFORM_CONTEXT_MENU (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ContextMenu code path that was guarded by CROSS_PLATFORM_CONTEXT_MENU Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/chromium/ContextMenuChromium.cpp
diff --git a/Source/WebCore/platform/chromium/ContextMenuChromium.cpp b/Source/WebCore/platform/chromium/ContextMenuChromium.cpp
index a928cad4551b0560d00684218e4c17fa73b1dc2b..a2af551424e2c009151998e82a252b1fe670109f 100644
--- a/Source/WebCore/platform/chromium/ContextMenuChromium.cpp
+++ b/Source/WebCore/platform/chromium/ContextMenuChromium.cpp
@@ -31,77 +31,29 @@
#include "config.h"
#include "ContextMenu.h"
-namespace WebCore {
-
-// This is a stub implementation of WebKit's ContextMenu class that does
-// nothing.
+#include "NotImplemented.h"
-ContextMenu::ContextMenu()
-{
-}
-
-ContextMenu::ContextMenu(const PlatformMenuDescription menu)
-{
-}
-
-ContextMenu::~ContextMenu()
-{
-}
-
-unsigned ContextMenu::itemCount() const
-{
- return m_items.size();
-}
+namespace WebCore {
-void ContextMenu::insertItem(unsigned position, ContextMenuItem& item)
+ContextMenu::ContextMenu(PlatformContextMenu menu)
{
- m_items.insert(position, item);
+ getContextMenuItems(menu, m_items);
}
-void ContextMenu::appendItem(ContextMenuItem& item)
+void ContextMenu::getContextMenuItems(PlatformContextMenu, Vector<ContextMenuItem>&)
{
- m_items.append(item);
+ notImplemented();
}
-ContextMenuItem* ContextMenu::itemWithAction(unsigned action)
+PlatformContextMenu ContextMenu::createPlatformContextMenuFromItems(const Vector<ContextMenuItem>&)
{
- Vector<Vector<ContextMenuItem>*> menuItemStack;
- menuItemStack.append(&m_items);
- while (!menuItemStack.isEmpty()) {
- Vector<ContextMenuItem>& items = *(menuItemStack.last());
- menuItemStack.removeLast();
- for (size_t i = 0; i < items.size(); ++i) {
- if (items[i].action() == static_cast<ContextMenuAction>(action))
- return &items[i];
- if (items[i].type() == SubmenuType)
- menuItemStack.append(const_cast<Vector<ContextMenuItem>*>(items[i].platformSubMenu()));
- }
- }
+ notImplemented();
return 0;
}
-ContextMenuItem* ContextMenu::itemAtIndex(unsigned index, const PlatformMenuDescription platformDescription)
+PlatformContextMenu ContextMenu::platformContextMenu() const
{
- return &m_items[index];
+ return createPlatformContextMenuFromItems(m_items);
}
-void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
-{
}
-
-PlatformMenuDescription ContextMenu::platformDescription() const
-{
- return &m_items;
-}
-
-PlatformMenuDescription ContextMenu::releasePlatformDescription()
-{
- return 0;
-}
-
-Vector<ContextMenuItem> contextMenuItemVector(const PlatformMenuDescription menuDescription)
-{
- return *menuDescription;
-}
-
-} // namespace WebCore
« no previous file with comments | « Source/WebCore/platform/PlatformMenuDescription.h ('k') | Source/WebCore/platform/chromium/ContextMenuItemChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698