| 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
|
|
|