diff options
Diffstat (limited to 'webkit/tools/test_shell/mac/webwidget_host.mm')
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index eb23bc1..acb98b6 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -13,9 +13,9 @@ #include "webkit/api/public/mac/WebInputEventFactory.h" #include "webkit/api/public/mac/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" using WebKit::WebInputEvent; @@ -23,13 +23,15 @@ 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; /*static*/ WebWidgetHost* WebWidgetHost::Create(NSView* parent_view, - WebWidgetDelegate* delegate) { + WebWidgetClient* client) { WebWidgetHost* host = new WebWidgetHost(); NSRect content_rect = [parent_view frame]; @@ -40,8 +42,8 @@ WebWidgetHost* WebWidgetHost::Create(NSView* parent_view, // win_util::SetWindowUserData(host->hwnd_, host); - host->webwidget_ = WebWidget::Create(delegate); - host->webwidget_->Resize(WebSize(content_rect.size.width, + host->webwidget_ = WebPopupMenu::create(client); + host->webwidget_->resize(WebSize(content_rect.size.width, content_rect.size.height)); return host; } @@ -149,7 +151,7 @@ WebWidgetHost::~WebWidgetHost() { TrackMouseLeave(false); - webwidget_->Close(); + webwidget_->close(); } void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { @@ -178,7 +180,7 @@ void WebWidgetHost::Paint() { flipped:NO]]; // This may result in more invalidation - webwidget_->Layout(); + webwidget_->layout(); // Scroll the canvas if necessary scroll_rect_ = client_rect.Intersect(scroll_rect_); @@ -227,7 +229,7 @@ WebScreenInfo WebWidgetHost::GetScreenInfo() { void WebWidgetHost::Resize(const gfx::Rect& rect) { // Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer. DiscardBackingStore(); - webwidget_->Resize(WebSize(rect.width(), rect.height())); + webwidget_->resize(WebSize(rect.width(), rect.height())); } void WebWidgetHost::MouseEvent(NSEvent *event) { @@ -243,26 +245,23 @@ void WebWidgetHost::MouseEvent(NSEvent *event) { default: break; } - webwidget_->HandleInputEvent(&web_event); + webwidget_->handleInputEvent(web_event); } void WebWidgetHost::WheelEvent(NSEvent *event) { - const WebMouseWheelEvent& web_event = WebInputEventFactory::mouseWheelEvent( - event, view_); - webwidget_->HandleInputEvent(&web_event); + webwidget_->handleInputEvent( + WebInputEventFactory::mouseWheelEvent(event, view_)); } void WebWidgetHost::KeyEvent(NSEvent *event) { - const WebKeyboardEvent& web_event = WebInputEventFactory::keyboardEvent( - event); - webwidget_->HandleInputEvent(&web_event); + webwidget_->handleInputEvent(WebInputEventFactory::keyboardEvent(event)); } 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) { @@ -281,6 +280,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); } |