summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/wx
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-30 15:42:16 +0100
committerSteve Block <steveblock@google.com>2010-10-07 10:59:29 +0100
commitbec39347bb3bb5bf1187ccaf471d26247f28b585 (patch)
tree56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/platform/wx
parent90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff)
downloadexternal_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/platform/wx')
-rw-r--r--WebCore/platform/wx/ClipboardWx.cpp4
-rw-r--r--WebCore/platform/wx/ClipboardWx.h6
-rw-r--r--WebCore/platform/wx/LocalizedStringsWx.cpp50
-rw-r--r--WebCore/platform/wx/PopupMenuWx.cpp38
-rw-r--r--WebCore/platform/wx/PopupMenuWx.h4
5 files changed, 83 insertions, 19 deletions
diff --git a/WebCore/platform/wx/ClipboardWx.cpp b/WebCore/platform/wx/ClipboardWx.cpp
index 2ef943f..32216a6 100644
--- a/WebCore/platform/wx/ClipboardWx.cpp
+++ b/WebCore/platform/wx/ClipboardWx.cpp
@@ -42,8 +42,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*
return 0;
}
-ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, bool forDragging)
- : Clipboard(policy, forDragging)
+ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
{
}
diff --git a/WebCore/platform/wx/ClipboardWx.h b/WebCore/platform/wx/ClipboardWx.h
index 45d1cf3..138635a 100644
--- a/WebCore/platform/wx/ClipboardWx.h
+++ b/WebCore/platform/wx/ClipboardWx.h
@@ -35,9 +35,9 @@ namespace WebCore {
// State available during IE's events for drag and drop and copy/paste
class ClipboardWx : public Clipboard {
public:
- static PassRefPtr<ClipboardWx> create(ClipboardAccessPolicy policy, bool forDragging)
+ static PassRefPtr<ClipboardWx> create(ClipboardAccessPolicy policy, ClipboardType clipboardType)
{
- return adoptRef(new ClipboardWx(policy, forDragging));
+ return adoptRef(new ClipboardWx(policy, clipboardType));
}
void clearData(const String& type);
@@ -65,7 +65,7 @@ namespace WebCore {
virtual bool hasData();
private:
- ClipboardWx(ClipboardAccessPolicy, bool forDragging);
+ ClipboardWx(ClipboardAccessPolicy, ClipboardType);
};
}
diff --git a/WebCore/platform/wx/LocalizedStringsWx.cpp b/WebCore/platform/wx/LocalizedStringsWx.cpp
index 4112f64..10ea435 100644
--- a/WebCore/platform/wx/LocalizedStringsWx.cpp
+++ b/WebCore/platform/wx/LocalizedStringsWx.cpp
@@ -97,6 +97,56 @@ String contextMenuItemTagCopyImageToClipboard()
return String("Copy Image to Clipboard");
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return String("Open Video in New Window");
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return String("Open Audio in New Window");
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return String("Copy Video Link Location");
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return String("Copy Audio Link Location");
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return String("Toggle Media Controls");
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return String("Toggle Media Loop Playback");
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return String("Switch Video to Fullscreen");
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return String("Play");
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return String("Pause");
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return String("Mute");
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return String("Open Frame in New Window");
diff --git a/WebCore/platform/wx/PopupMenuWx.cpp b/WebCore/platform/wx/PopupMenuWx.cpp
index e88d1e5..b850ef5 100644
--- a/WebCore/platform/wx/PopupMenuWx.cpp
+++ b/WebCore/platform/wx/PopupMenuWx.cpp
@@ -38,14 +38,34 @@
static int s_menuStartId = wxNewId();
+namespace WebCore {
+
+class PopupMenuEventHandler : public wxEvtHandler
+{
+public:
+ PopupMenuEventHandler(PopupMenuClient* client) :
+ m_client(client)
+ {}
+
+ void OnMenuItemSelected(wxCommandEvent& event)
+ {
+ if (m_client) {
+ m_client->valueChanged(event.GetId() - s_menuStartId);
+ m_client->popupDidHide();
+ }
+ // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
+ }
+private:
+ PopupMenuClient* m_client;
-namespace WebCore {
+};
PopupMenuWx::PopupMenuWx(PopupMenuClient* client)
: m_popupClient(client)
- , m_menu(NULL)
+ , m_menu(0)
{
+ PopupMenuEventHandler m_popupHandler(client);
}
PopupMenuWx::~PopupMenuWx()
@@ -69,6 +89,7 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
if (nativeWin) {
// construct the menu
m_menu = new wxMenu();
+
int size = client()->listSize();
for (int i = 0; i < size; i++) {
int id = s_menuStartId + i;
@@ -84,19 +105,10 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
m_menu->Append(s_menuStartId + i, client()->itemText(i));
}
}
- nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
+ nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
nativeWin->PopupMenu(m_menu, r.x() - v->scrollX(), r.y() - v->scrollY());
- nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
- }
-}
-
-void PopupMenuWx::OnMenuItemSelected(wxCommandEvent& event)
-{
- if (client()) {
- client()->valueChanged(event.GetId() - s_menuStartId);
- client()->popupDidHide();
+ nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
}
- // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
}
void PopupMenuWx::hide()
diff --git a/WebCore/platform/wx/PopupMenuWx.h b/WebCore/platform/wx/PopupMenuWx.h
index c2573fc..ad947a7 100644
--- a/WebCore/platform/wx/PopupMenuWx.h
+++ b/WebCore/platform/wx/PopupMenuWx.h
@@ -37,9 +37,10 @@ class wxMenu;
namespace WebCore {
class FrameView;
+class PopupMenuEventHandler;
class Scrollbar;
-class PopupMenuWx : public PopupMenu, public wxEvtHandler {
+class PopupMenuWx : public PopupMenu {
public:
PopupMenuWx(PopupMenuClient*);
~PopupMenuWx();
@@ -55,6 +56,7 @@ private:
PopupMenuClient* m_popupClient;
wxMenu* m_menu;
+ PopupMenuEventHandler* m_popupHandler;
};
}