diff options
Diffstat (limited to 'webkit/tools')
-rwxr-xr-x | webkit/tools/test_shell/mac/test_webview_delegate.mm | 19 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/webview_host.mm | 9 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 8 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate.cc | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 17 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 27 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate_win.cc | 15 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 4 |
9 files changed, 44 insertions, 67 deletions
diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm index 9ae7a80..039e34f3 100755 --- a/webkit/tools/test_shell/mac/test_webview_delegate.mm +++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm @@ -7,15 +7,12 @@ #import <Cocoa/Cocoa.h> #include "base/sys_string_conversions.h" #include "base/string_util.h" -#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/tools/test_shell/test_shell.h" -using WebKit::WebRect; - // MenuDelegate ---------------------------------------------------------------- // A class for determining whether an item was selected from an HTML select // control, or if the menu was dismissed without making a selection. If a menu @@ -124,7 +121,7 @@ void TestWebViewDelegate::Show(WebWidget* webview, // Display a HTML select menu. void TestWebViewDelegate::ShowWithItems( WebWidget* webview, - const WebRect& bounds, + const gfx::Rect& bounds, int item_height, int selected_index, const std::vector<MenuItem>& items) { @@ -144,9 +141,9 @@ void TestWebViewDelegate::ShowWithItems( [button selectItemAtIndex:selected_index]; NSView* web_view = shell_->webViewWnd(); NSRect view_rect = [web_view bounds]; - int y_offset = bounds.y + bounds.height; - NSRect position = NSMakeRect(bounds.x, view_rect.size.height - y_offset, - bounds.width, bounds.height); + int y_offset = bounds.y() + bounds.height(); + NSRect position = NSMakeRect(bounds.x(), view_rect.size.height - y_offset, + bounds.width(), bounds.height()); // Display the menu, and set a flag to determine if something was chosen. If // nothing was chosen (i.e., the user dismissed the popup by the "ESC" key or @@ -229,7 +226,7 @@ void TestWebViewDelegate::SetCursor(WebWidget* webwidget, } void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { DCHECK(out_rect); if (WebWidgetHost* host = GetHostForWidget(webwidget)) { NSView *view = host->view_handle(); @@ -239,7 +236,7 @@ void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, } void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, - const WebRect& rect) { + const gfx::Rect& rect) { // TODO: Mac window movement if (webwidget == shell_->webView()) { // ignored @@ -250,7 +247,7 @@ void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, } void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) { NSView *view = host->view_handle(); NSRect rect = [[[view window] contentView] frame]; @@ -263,7 +260,7 @@ void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, @end void TestWebViewDelegate::GetRootWindowResizerRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { NSRect resize_rect = NSMakeRect(0, 0, 0, 0); WebWidgetHost* host = GetHostForWidget(webwidget); // To match the WebKit screen shots, we need the resize area to overlap diff --git a/webkit/tools/test_shell/mac/webview_host.mm b/webkit/tools/test_shell/mac/webview_host.mm index 13f8332..7c6c949 100644 --- a/webkit/tools/test_shell/mac/webview_host.mm +++ b/webkit/tools/test_shell/mac/webview_host.mm @@ -10,12 +10,9 @@ #include "base/gfx/platform_canvas.h" #include "base/gfx/rect.h" #include "base/gfx/size.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #include "webkit/glue/webview.h" -using WebKit::WebSize; - -// static +/*static*/ WebViewHost* WebViewHost::Create(NSView* parent_view, WebViewDelegate* delegate, const WebPreferences& prefs) { @@ -34,8 +31,8 @@ WebViewHost* WebViewHost::Create(NSView* parent_view, [host->view_ release]; host->webwidget_ = WebView::Create(delegate, prefs); - host->webwidget_->Resize(WebSize(content_rect.size.width, - content_rect.size.height)); + host->webwidget_->Resize(gfx::Size(content_rect.size.width, + content_rect.size.height)); return host; } diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index a24928a..bccb584 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -14,7 +14,6 @@ #include "third_party/WebKit/WebKit/chromium/public/mac/WebScreenInfoFactory.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #include "webkit/glue/webwidget.h" #include "webkit/tools/test_shell/test_shell.h" @@ -25,7 +24,6 @@ using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; using WebKit::WebScreenInfo; using WebKit::WebScreenInfoFactory; -using WebKit::WebSize; /*static*/ WebWidgetHost* WebWidgetHost::Create(NSView* parent_view, @@ -41,8 +39,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, - content_rect.size.height)); + host->webwidget_->Resize(gfx::Size(content_rect.size.width, + content_rect.size.height)); return host; } @@ -227,7 +225,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(gfx::Size(rect.width(), rect.height())); } void WebWidgetHost::MouseEvent(NSEvent *event) { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 9ba64e0..af7a662 100755 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -43,9 +43,7 @@ #endif using WebKit::WebDragData; -using WebKit::WebRect; using WebKit::WebScreenInfo; -using WebKit::WebSize; using WebKit::WebString; namespace { @@ -717,13 +715,13 @@ gfx::NativeViewId TestWebViewDelegate::GetContainingView(WebWidget* webwidget) { } void TestWebViewDelegate::DidInvalidateRect(WebWidget* webwidget, - const WebRect& rect) { + const gfx::Rect& rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) host->DidInvalidateRect(rect); } void TestWebViewDelegate::DidScrollRect(WebWidget* webwidget, int dx, int dy, - const WebRect& clip_rect) { + const gfx::Rect& clip_rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) host->DidScrollRect(dx, dy, clip_rect); } diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index e1692fe..94e1f83 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -212,13 +212,12 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, // WebWidgetDelegate virtual gfx::NativeViewId GetContainingView(WebWidget* webwidget); - virtual void DidInvalidateRect(WebWidget* webwidget, - const WebKit::WebRect& rect); + virtual void DidInvalidateRect(WebWidget* webwidget, const gfx::Rect& rect); virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy, - const WebKit::WebRect& clip_rect); + const gfx::Rect& clip_rect); virtual void Show(WebWidget* webview, WindowOpenDisposition disposition); virtual void ShowWithItems(WebWidget* webwidget, - const WebKit::WebRect& bounds, + const gfx::Rect& bounds, int item_height, int selected_index, const std::vector<MenuItem>& items); @@ -227,12 +226,10 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, virtual void Blur(WebWidget* webwidget); virtual void SetCursor(WebWidget* webwidget, const WebCursor& cursor); - virtual void GetWindowRect(WebWidget* webwidget, WebKit::WebRect* rect); - virtual void SetWindowRect(WebWidget* webwidget, - const WebKit::WebRect& rect); - virtual void GetRootWindowRect(WebWidget *, WebKit::WebRect *); - virtual void GetRootWindowResizerRect(WebWidget* webwidget, - WebKit::WebRect* rect); + virtual void GetWindowRect(WebWidget* webwidget, gfx::Rect* rect); + virtual void SetWindowRect(WebWidget* webwidget, const gfx::Rect& rect); + virtual void GetRootWindowRect(WebWidget *, gfx::Rect *); + virtual void GetRootWindowResizerRect(WebWidget* webwidget, gfx::Rect* rect); virtual void DidMove(WebWidget* webwidget, const WebPluginGeometry& move); virtual void RunModal(WebWidget* webwidget); virtual bool IsHidden(WebWidget* webwidget); diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index ef92a3b..bce7619 100755 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -14,7 +14,6 @@ #include "base/string_util.h" #include "net/base/net_errors.h" #include "chrome/common/page_transition_types.h" -#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webdatasource.h" #include "webkit/glue/webdropdata.h" @@ -30,10 +29,9 @@ #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_shell.h" -using WebKit::WebRect; - namespace { + enum SelectionClipboardType { TEXT_HTML, PLAIN_TEXT, @@ -116,7 +114,7 @@ void TestWebViewDelegate::Show(WebWidget* webwidget, } void TestWebViewDelegate::ShowWithItems(WebWidget* webwidget, - const WebRect& bounds, + const gfx::Rect& bounds, int item_height, int selected_index, const std::vector<MenuItem>& items) { @@ -161,7 +159,7 @@ void TestWebViewDelegate::SetCursor(WebWidget* webwidget, } void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { DCHECK(out_rect); WebWidgetHost* host = GetHostForWidget(webwidget); GtkWidget* drawing_area = host->view_handle(); @@ -173,13 +171,12 @@ void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, x += vbox->allocation.x + drawing_area->allocation.x; y += vbox->allocation.y + drawing_area->allocation.y; - *out_rect = WebRect(x, y, - drawing_area->allocation.width, - drawing_area->allocation.height); + out_rect->SetRect(x, y, drawing_area->allocation.width, + drawing_area->allocation.height); } void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, - const WebRect& rect) { + const gfx::Rect& rect) { if (webwidget == shell_->webView()) { // ignored } else if (webwidget == shell_->popup()) { @@ -187,13 +184,13 @@ void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, GtkWidget* drawing_area = host->view_handle(); GtkWidget* window = gtk_widget_get_parent(gtk_widget_get_parent(drawing_area)); - gtk_window_resize(GTK_WINDOW(window), rect.width, rect.height); - gtk_window_move(GTK_WINDOW(window), rect.x, rect.y); + gtk_window_resize(GTK_WINDOW(window), rect.width(), rect.height()); + gtk_window_move(GTK_WINDOW(window), rect.x(), rect.y()); } } void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) { // We are being asked for the x/y and width/height of the entire browser // window. This means the x/y is the distance from the corner of the @@ -205,14 +202,14 @@ void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, gint x, y, width, height; gtk_window_get_position(GTK_WINDOW(window), &x, &y); gtk_window_get_size(GTK_WINDOW(window), &width, &height); - *out_rect = WebRect(x, y, width, height); + out_rect->SetRect(x, y, width, height); } } void TestWebViewDelegate::GetRootWindowResizerRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { // Not necessary on Linux. - *out_rect = WebRect(); + *out_rect = gfx::Rect(); } void TestWebViewDelegate::DidMove(WebWidget* webwidget, diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc index 125c1b2..28c5034 100755 --- a/webkit/tools/test_shell/test_webview_delegate_win.cc +++ b/webkit/tools/test_shell/test_webview_delegate_win.cc @@ -19,7 +19,6 @@ #include "base/string_util.h" #include "base/trace_event.h" #include "net/base/net_errors.h" -#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "webkit/glue/webdatasource.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/weberror.h" @@ -36,8 +35,6 @@ #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_shell.h" -using WebKit::WebRect; - // WebViewDelegate ----------------------------------------------------------- TestWebViewDelegate::~TestWebViewDelegate() { @@ -82,7 +79,7 @@ void TestWebViewDelegate::Show(WebWidget* webwidget, WindowOpenDisposition) { } void TestWebViewDelegate::ShowWithItems(WebWidget* webwidget, - const WebRect& bounds, + const gfx::Rect& bounds, int item_height, int selected_index, const std::vector<MenuItem>& items) { @@ -107,7 +104,7 @@ void TestWebViewDelegate::SetCursor(WebWidget* webwidget, } void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) { RECT rect; ::GetWindowRect(host->view_handle(), &rect); @@ -116,17 +113,17 @@ void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, } void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, - const WebRect& rect) { + const gfx::Rect& rect) { if (webwidget == shell_->webView()) { // ignored } else if (webwidget == shell_->popup()) { MoveWindow(shell_->popupWnd(), - rect.x, rect.y, rect.width, rect.height, FALSE); + rect.x(), rect.y(), rect.width(), rect.height(), FALSE); } } void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) { RECT rect; HWND root_window = ::GetAncestor(host->view_handle(), GA_ROOT); @@ -136,7 +133,7 @@ void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, } void TestWebViewDelegate::GetRootWindowResizerRect(WebWidget* webwidget, - WebRect* out_rect) { + gfx::Rect* out_rect) { // Not necessary on Windows. *out_rect = gfx::Rect(); } diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 5645da7..08dd9bc 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -16,7 +16,6 @@ #include "third_party/WebKit/WebKit/chromium/public/gtk/WebScreenInfoFactory.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #include "webkit/glue/webwidget.h" #include "webkit/tools/test_shell/test_shell.h" @@ -26,7 +25,6 @@ using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; using WebKit::WebScreenInfo; using WebKit::WebScreenInfoFactory; -using WebKit::WebSize; namespace { @@ -124,14 +122,14 @@ class WebWidgetHostGtkWidget { static void HandleSizeAllocate(GtkWidget* widget, GtkAllocation* allocation, WebWidgetHost* host) { - host->Resize(WebSize(allocation->width, allocation->height)); + host->Resize(gfx::Size(allocation->width, allocation->height)); } // Size, position, or stacking of the GdkWindow changed. static gboolean HandleConfigure(GtkWidget* widget, GdkEventConfigure* config, WebWidgetHost* host) { - host->Resize(WebSize(config->width, config->height)); + host->Resize(gfx::Size(config->width, config->height)); return FALSE; } diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index c5464ef..9db06c0 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -11,7 +11,6 @@ #include "skia/ext/platform_canvas_win.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #include "third_party/WebKit/WebKit/chromium/public/win/WebInputEventFactory.h" #include "third_party/WebKit/WebKit/chromium/public/win/WebScreenInfoFactory.h" #include "webkit/glue/webwidget.h" @@ -24,7 +23,6 @@ using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; using WebKit::WebScreenInfo; using WebKit::WebScreenInfoFactory; -using WebKit::WebSize; static const wchar_t kWindowClassName[] = L"WebWidgetHost"; @@ -287,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(gfx::Size(LOWORD(lparam), HIWORD(lparam))); } void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { |