summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/haiku
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-04 11:41:34 +0100
committerSteve Block <steveblock@google.com>2010-08-09 12:04:44 +0100
commitdb14019a23d96bc8a444b6576a5da8bd1cfbc8b0 (patch)
tree9f793c5b0f5e1f2aca8247158920e2c4bf962bbf /WebCore/platform/haiku
parentbf916837aa84f1e4b00e6ed6268516c2acd27545 (diff)
downloadexternal_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.zip
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.gz
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.bz2
Merge WebKit at r64523 : Initial merge by git.
Change-Id: Ibb796c6802e757b1d9b40f58205cfbe4da95fcd4
Diffstat (limited to 'WebCore/platform/haiku')
-rw-r--r--WebCore/platform/haiku/PopupMenuHaiku.cpp31
-rw-r--r--WebCore/platform/haiku/PopupMenuHaiku.h55
-rw-r--r--WebCore/platform/haiku/SearchPopupMenuHaiku.cpp18
-rw-r--r--WebCore/platform/haiku/SearchPopupMenuHaiku.h44
4 files changed, 127 insertions, 21 deletions
diff --git a/WebCore/platform/haiku/PopupMenuHaiku.cpp b/WebCore/platform/haiku/PopupMenuHaiku.cpp
index 5adbc66..e3edb83 100644
--- a/WebCore/platform/haiku/PopupMenuHaiku.cpp
+++ b/WebCore/platform/haiku/PopupMenuHaiku.cpp
@@ -2,6 +2,7 @@
* This file is part of the popup menu implementation for <select> elements in WebCore.
*
* Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,7 +22,7 @@
*/
#include "config.h"
-#include "PopupMenu.h"
+#include "PopupMenuHaiku.h"
#include "FrameView.h"
@@ -72,9 +73,9 @@ private:
PopupMenuClient* m_popupClient;
};
-class PopupMenuHaiku : public BPopUpMenu {
+class HaikuPopup : public BPopUpMenu {
public:
- PopupMenuHaiku(PopupMenuClient* popupClient)
+ HaikuPopup(PopupMenuClient* popupClient)
: BPopUpMenu("WebCore Popup", true, false)
, m_popupClient(popupClient)
, m_Handler(popupClient)
@@ -86,7 +87,7 @@ public:
SetAsyncAutoDestruct(false);
}
- virtual ~PopupMenuHaiku()
+ virtual ~HaikuPopup()
{
if (be_app->Lock()) {
be_app->RemoveHandler(&m_Handler);
@@ -153,39 +154,39 @@ private:
PopupMenuHandler m_Handler;
};
-PopupMenu::PopupMenu(PopupMenuClient* client)
+PopupMenuHaiku::PopupMenuHaiku(PopupMenuClient* client)
: m_popupClient(client)
- , m_menu(new PopupMenuHaiku(client))
+ , m_menu(new HaikuPopup(client))
{
// We don't need additional references to the client, since we completely
// control any sub-objects we create that need it as well.
}
-PopupMenu::~PopupMenu()
+PopupMenuHaiku::~PopupMenuHaiku()
{
delete m_menu;
}
-void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
+void PopupMenuHaiku::disconnectClient()
+{
+ m_popupClient = 0;
+}
+
+void PopupMenuHaiku::show(const IntRect& rect, FrameView* view, int index)
{
// The menu will update itself from the PopupMenuClient before showing.
m_menu->show(rect, view, index);
}
-void PopupMenu::hide()
+void PopupMenuHaiku::hide()
{
m_menu->hide();
}
-void PopupMenu::updateFromElement()
+void PopupMenuHaiku::updateFromElement()
{
client()->setTextFromItem(m_popupClient->selectedIndex());
}
-bool PopupMenu::itemWritingDirectionIsNatural()
-{
- return false;
-}
-
} // namespace WebCore
diff --git a/WebCore/platform/haiku/PopupMenuHaiku.h b/WebCore/platform/haiku/PopupMenuHaiku.h
new file mode 100644
index 0000000..9207923
--- /dev/null
+++ b/WebCore/platform/haiku/PopupMenuHaiku.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PopupMenuHaiku_h
+#define PopupMenuHaiku_h
+
+#include "IntRect.h"
+#include "PopupMenu.h"
+#include "PopupMenuClient.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class FrameView;
+class HaikuPopup;
+class Scrollbar;
+
+class PopupMenuHaiku : public PopupMenu {
+public:
+ PopupMenuHaiku(PopupMenuClient*);
+ ~PopupMenuHaiku();
+
+ virtual void show(const IntRect&, FrameView*, int index);
+ virtual void hide();
+ virtual void updateFromElement();
+ virtual void disconnectClient();
+
+private:
+ PopupMenuClient* client() const { return m_popupClient; }
+
+ PopupMenuClient* m_popupClient;
+ HaikuPopup* m_menu;
+};
+
+}
+
+#endif // PopupMenuHaiku_h
diff --git a/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
index fd5d96c..109409a 100644
--- a/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
+++ b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -18,7 +19,7 @@
*/
#include "config.h"
-#include "SearchPopupMenu.h"
+#include "SearchPopupMenuHaiku.h"
#include "AtomicString.h"
#include "NotImplemented.h"
@@ -26,26 +27,31 @@
namespace WebCore {
-SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
- : PopupMenu(client)
+SearchPopupMenuHaiku::SearchPopupMenuHaiku(PopupMenuClient* client)
+ : m_popup(adoptRef(new PopupMenuHaiku(client)))
{
}
-void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+void SearchPopupMenuHaiku::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
{
notImplemented();
}
-void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+void SearchPopupMenuHaiku::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
{
notImplemented();
}
-bool SearchPopupMenu::enabled()
+bool SearchPopupMenuHaiku::enabled()
{
notImplemented();
return false;
}
+PopupMenu* SearchPopupMenuHaiku::popupMenu()
+{
+ return m_popup.get();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/haiku/SearchPopupMenuHaiku.h b/WebCore/platform/haiku/SearchPopupMenuHaiku.h
new file mode 100644
index 0000000..a9e8e8d
--- /dev/null
+++ b/WebCore/platform/haiku/SearchPopupMenuHaiku.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SearchPopupMenuHaiku_h
+#define SearchPopupMenuHaiku_h
+
+#include "PopupMenuHaiku.h"
+#include "SearchPopupMenu.h"
+
+namespace WebCore {
+
+class SearchPopupMenuHaiku : public SearchPopupMenu {
+public:
+ SearchPopupMenuHaiku(PopupMenuClient*);
+
+ virtual PopupMenu* popupMenu();
+ virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems);
+ virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems);
+ virtual bool enabled();
+
+private:
+ RefPtr<PopupMenuHaiku> m_popup;
+};
+
+}
+
+#endif // SearchPopupMenuHaiku_h