summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/webwidget_host_win.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_win.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_win.cc')
-rw-r--r--webkit/tools/test_shell/webwidget_host_win.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc
index 164a051..66b283e 100644
--- a/webkit/tools/test_shell/webwidget_host_win.cc
+++ b/webkit/tools/test_shell/webwidget_host_win.cc
@@ -9,11 +9,11 @@
#include "base/win_util.h"
#include "skia/ext/platform_canvas.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/api/public/win/WebInputEventFactory.h"
#include "webkit/api/public/win/WebScreenInfoFactory.h"
-#include "webkit/glue/webwidget.h"
#include "webkit/tools/test_shell/test_shell.h"
using WebKit::WebInputEvent;
@@ -21,15 +21,18 @@ 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::WebWidget;
+using WebKit::WebWidgetClient;
static const wchar_t kWindowClassName[] = L"WebWidgetHost";
/*static*/
WebWidgetHost* WebWidgetHost::Create(HWND parent_view,
- WebWidgetDelegate* delegate) {
+ WebWidgetClient* client) {
WebWidgetHost* host = new WebWidgetHost();
static bool registered_class = false;
@@ -51,7 +54,7 @@ WebWidgetHost* WebWidgetHost::Create(HWND parent_view,
parent_view, NULL, GetModuleHandle(NULL), NULL);
win_util::SetWindowUserData(host->view_, host);
- host->webwidget_ = WebWidget::Create(delegate);
+ host->webwidget_ = WebPopupMenu::create(client);
return host;
}
@@ -198,7 +201,7 @@ WebWidgetHost::~WebWidgetHost() {
TrackMouseLeave(false);
- webwidget_->Close();
+ webwidget_->close();
}
bool WebWidgetHost::WndProc(UINT message, WPARAM wparam, LPARAM lparam) {
@@ -232,7 +235,7 @@ void WebWidgetHost::Paint() {
}
// This may result in more invalidation
- webwidget_->Layout();
+ webwidget_->layout();
// Scroll the canvas if necessary
scroll_rect_ = client_rect.Intersect(scroll_rect_);
@@ -282,7 +285,7 @@ void WebWidgetHost::Resize(LPARAM lparam) {
// Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer.
DiscardBackingStore();
- webwidget_->Resize(WebSize(LOWORD(lparam), HIWORD(lparam)));
+ webwidget_->resize(WebSize(LOWORD(lparam), HIWORD(lparam)));
}
void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
@@ -308,30 +311,30 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
ReleaseCapture();
break;
}
- webwidget_->HandleInputEvent(&event);
+ webwidget_->handleInputEvent(event);
}
void WebWidgetHost::WheelEvent(WPARAM wparam, LPARAM lparam) {
const WebMouseWheelEvent& event = WebInputEventFactory::mouseWheelEvent(
view_, WM_MOUSEWHEEL, wparam, lparam);
- webwidget_->HandleInputEvent(&event);
+ webwidget_->handleInputEvent(event);
}
void WebWidgetHost::KeyEvent(UINT message, WPARAM wparam, LPARAM lparam) {
const WebKeyboardEvent& event = WebInputEventFactory::keyboardEvent(
view_, message, wparam, lparam);
- webwidget_->HandleInputEvent(&event);
+ webwidget_->handleInputEvent(event);
}
void WebWidgetHost::CaptureLostEvent() {
- webwidget_->MouseCaptureLost();
+ webwidget_->mouseCaptureLost();
}
void WebWidgetHost::SetFocus(bool enable) {
// 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())
- webwidget_->SetFocus(enable);
+ webwidget_->setFocus(enable);
}
void WebWidgetHost::TrackMouseLeave(bool track) {
@@ -364,6 +367,6 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
DCHECK(canvas_.get());
set_painting(true);
- webwidget_->Paint(canvas_.get(), rect);
+ webwidget_->paint(canvas_.get(), rect);
set_painting(false);
}