diff options
Diffstat (limited to 'WebCore/platform/haiku/ContextMenuHaiku.cpp')
-rw-r--r-- | WebCore/platform/haiku/ContextMenuHaiku.cpp | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/WebCore/platform/haiku/ContextMenuHaiku.cpp b/WebCore/platform/haiku/ContextMenuHaiku.cpp index 03b8978..b978433 100644 --- a/WebCore/platform/haiku/ContextMenuHaiku.cpp +++ b/WebCore/platform/haiku/ContextMenuHaiku.cpp @@ -27,30 +27,27 @@ #include "config.h" #include "ContextMenu.h" -#include "ContextMenuItem.h" #include "ContextMenuController.h" +#include "ContextMenuItem.h" +#include "Document.h" #include "Frame.h" #include "FrameView.h" -#include "Document.h" - -#include <wtf/Assertions.h> - #include <Looper.h> #include <Menu.h> #include <Message.h> +#include <wtf/Assertions.h> namespace WebCore { // FIXME: This class isn't used yet -class ContextMenuReceiver : public BLooper -{ +class ContextMenuReceiver : public BLooper { public: ContextMenuReceiver(ContextMenu* menu) : BLooper("context_menu_receiver") , m_menu(menu) + , m_result(-1) { - m_result = -1; } void HandleMessage(BMessage* msg) @@ -80,21 +77,8 @@ private: ContextMenu::ContextMenu(const HitTestResult& result) : m_hitTestResult(result) - , m_platformDescription(NULL) + , m_platformDescription(new BMenu("context_menu")) { - /* Get position */ - if (result.innerNode() && result.innerNode()->document()) { - BView* view = result.innerNode()->document()->frame()->view()->platformWidget(); - int child = 0; - while (view->ChildAt(child)) { - if (view->ChildAt(child)->Name() == "scroll_view_canvas") { - m_point = view->ChildAt(child)->ConvertToScreen(BPoint(result.point().x(), result.point().y())); - break; - } - child++; - } - } - m_platformDescription = new BMenu("context_menu"); } ContextMenu::~ContextMenu() @@ -106,9 +90,9 @@ void ContextMenu::appendItem(ContextMenuItem& item) { checkOrEnableIfNeeded(item); - BMenuItem* bItem = item.releasePlatformDescription(); - if (bItem) - m_platformDescription->AddItem(bItem); + BMenuItem* menuItem = item.releasePlatformDescription(); + if (menuItem) + m_platformDescription->AddItem(menuItem); } unsigned ContextMenu::itemCount() const @@ -120,9 +104,9 @@ void ContextMenu::insertItem(unsigned position, ContextMenuItem& item) { checkOrEnableIfNeeded(item); - BMenuItem* bItem = item.releasePlatformDescription(); - if (bItem) - m_platformDescription->AddItem(bItem, position); + BMenuItem* menuItem = item.releasePlatformDescription(); + if (menuItem) + m_platformDescription->AddItem(menuItem, position); } PlatformMenuDescription ContextMenu::platformDescription() const |