summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/webwidget_host_gtk.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 05:11:05 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 05:11:05 +0000
commit05158051ea881677c03a22ddf38a3e6779cebb9e (patch)
tree95c6756227e0bbea55da3c4b19abdf99d7eb3ebe /webkit/tools/test_shell/webwidget_host_gtk.cc
parent6c14b76fede6abc592d9d65965fbdf4626e83efe (diff)
downloadchromium_src-05158051ea881677c03a22ddf38a3e6779cebb9e.zip
chromium_src-05158051ea881677c03a22ddf38a3e6779cebb9e.tar.gz
chromium_src-05158051ea881677c03a22ddf38a3e6779cebb9e.tar.bz2
Use WebWidget from the WebKit API. This change also makes
use of WebKitClient (replacing WebWidgetDelegate from glue). The ripple effects of this change are rather large, but most of the impact is mechanical. The more interesting changes include: 1- Removing the WebWidget parameter from WebWidgetClient methods. This didn't matter at all to RenderWidget or RenderView, but it did cause some changes to be made to TestWebViewDelegate. Now, it is not possible to share a delegate implementation for both the WebView and a popup menu, so I have a second instance of the delegate owned by TestShell for use with popup menus. 2- Plumbing WebNavigationPolicy in place of WindowOpenDisposition was getting to be a pretty large change, so I stopped short of deleting WindowOpenDisposition. That way the Chrome side can remain mostly unmodified. I then added a mapping function to convert from WebNavigationPolicy to WindowOpenDisposition. 3- The IME methods on WebWidget were renamed (reviewed separately by hbono), and there is now an enum to specify the composition command (WebCompositionCommand). 4- I added IPC serialization for WebCompositionCommand and WebTextDirection, which cleaned up some code that was just using ints in IPC messages. R=jam BUG=16234 TEST=none Review URL: http://codereview.chromium.org/149620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/webwidget_host_gtk.cc')
-rw-r--r--webkit/tools/test_shell/webwidget_host_gtk.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc
index dd5b311..432f661 100644
--- a/webkit/tools/test_shell/webwidget_host_gtk.cc
+++ b/webkit/tools/test_shell/webwidget_host_gtk.cc
@@ -15,9 +15,9 @@
#include "webkit/api/public/gtk/WebInputEventFactory.h"
#include "webkit/api/public/x11/WebScreenInfoFactory.h"
#include "webkit/api/public/WebInputEvent.h"
+#include "webkit/api/public/WebPopupMenu.h"
#include "webkit/api/public/WebScreenInfo.h"
#include "webkit/api/public/WebSize.h"
-#include "webkit/glue/webwidget.h"
#include "webkit/tools/test_shell/test_shell.h"
#include "webkit/tools/test_shell/test_shell_x11.h"
@@ -25,9 +25,11 @@ using WebKit::WebInputEventFactory;
using WebKit::WebKeyboardEvent;
using WebKit::WebMouseEvent;
using WebKit::WebMouseWheelEvent;
+using WebKit::WebPopupMenu;
using WebKit::WebScreenInfo;
using WebKit::WebScreenInfoFactory;
using WebKit::WebSize;
+using WebKit::WebWidgetClient;
namespace {
@@ -159,9 +161,8 @@ class WebWidgetHostGtkWidget {
static gboolean HandleKeyPress(GtkWidget* widget,
GdkEventKey* event,
WebWidgetHost* host) {
- const WebKeyboardEvent& wke = WebInputEventFactory::keyboardEvent(event);
- host->webwidget()->HandleInputEvent(&wke);
-
+ host->webwidget()->handleInputEvent(
+ WebInputEventFactory::keyboardEvent(event));
return FALSE;
}
@@ -189,7 +190,7 @@ class WebWidgetHostGtkWidget {
// Ignore focus calls in layout test mode so that tests don't mess with each
// other's focus when running in parallel.
if (!TestShell::layout_test_mode())
- host->webwidget()->SetFocus(true);
+ host->webwidget()->setFocus(true);
return FALSE;
}
@@ -200,7 +201,7 @@ class WebWidgetHostGtkWidget {
// Ignore focus calls in layout test mode so that tests don't mess with each
// other's focus when running in parallel.
if (!TestShell::layout_test_mode())
- host->webwidget()->SetFocus(false);
+ host->webwidget()->setFocus(false);
return FALSE;
}
@@ -208,8 +209,8 @@ class WebWidgetHostGtkWidget {
static gboolean HandleButtonPress(GtkWidget* widget,
GdkEventButton* event,
WebWidgetHost* host) {
- const WebMouseEvent& wme = WebInputEventFactory::mouseEvent(event);
- host->webwidget()->HandleInputEvent(&wme);
+ host->webwidget()->handleInputEvent(
+ WebInputEventFactory::mouseEvent(event));
return FALSE;
}
@@ -224,8 +225,8 @@ class WebWidgetHostGtkWidget {
static gboolean HandleMotionNotify(GtkWidget* widget,
GdkEventMotion* event,
WebWidgetHost* host) {
- const WebMouseEvent& wme = WebInputEventFactory::mouseEvent(event);
- host->webwidget()->HandleInputEvent(&wme);
+ host->webwidget()->handleInputEvent(
+ WebInputEventFactory::mouseEvent(event));
return FALSE;
}
@@ -233,9 +234,8 @@ class WebWidgetHostGtkWidget {
static gboolean HandleScroll(GtkWidget* widget,
GdkEventScroll* event,
WebWidgetHost* host) {
- const WebMouseWheelEvent& wmwe =
- WebInputEventFactory::mouseWheelEvent(event);
- host->webwidget()->HandleInputEvent(&wmwe);
+ host->webwidget()->handleInputEvent(
+ WebInputEventFactory::mouseWheelEvent(event));
return FALSE;
}
@@ -253,10 +253,10 @@ gfx::NativeView WebWidgetHost::CreateWidget(
// static
WebWidgetHost* WebWidgetHost::Create(GtkWidget* parent_view,
- WebWidgetDelegate* delegate) {
+ WebWidgetClient* client) {
WebWidgetHost* host = new WebWidgetHost();
host->view_ = CreateWidget(parent_view, host);
- host->webwidget_ = WebWidget::Create(delegate);
+ host->webwidget_ = WebPopupMenu::create(client);
// We manage our own double buffering because we need to be able to update
// the expose area in an ExposeEvent within the lifetime of the event handler.
gtk_widget_set_double_buffered(GTK_WIDGET(host->view_), false);
@@ -295,14 +295,14 @@ WebWidgetHost::WebWidgetHost()
}
WebWidgetHost::~WebWidgetHost() {
- webwidget_->Close();
+ webwidget_->close();
}
void WebWidgetHost::Resize(const gfx::Size &newsize) {
// The pixel buffer backing us is now the wrong size
canvas_.reset();
- webwidget_->Resize(gfx::Size(newsize.width(), newsize.height()));
+ webwidget_->resize(newsize);
}
void WebWidgetHost::Paint() {
@@ -323,7 +323,7 @@ void WebWidgetHost::Paint() {
}
// This may result in more invalidation
- webwidget_->Layout();
+ webwidget_->layout();
// Paint the canvas if necessary. Allow painting to generate extra rects the
// first time we call it. This is necessary because some WebCore rendering
@@ -381,7 +381,7 @@ void WebWidgetHost::ResetScrollRect() {
void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
set_painting(true);
- webwidget_->Paint(canvas_.get(), rect);
+ webwidget_->paint(canvas_.get(), rect);
set_painting(false);
}