From 1dc73f568f2914b38016d396eb387b9db5f0d360 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Tue, 11 Nov 2008 21:55:21 +0000 Subject: Move test_webview_delegate_gtk.cc next to test_webview_delegate_win.cc. Review URL: http://codereview.chromium.org/10406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5208 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/tools/test_shell/SConscript | 2 +- .../tools/test_shell/gtk/test_webview_delegate.cc | 111 --------------------- .../tools/test_shell/test_webview_delegate_gtk.cc | 111 +++++++++++++++++++++ 3 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 webkit/tools/test_shell/gtk/test_webview_delegate.cc create mode 100644 webkit/tools/test_shell/test_webview_delegate_gtk.cc diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript index 8032119..4aab0d0 100644 --- a/webkit/tools/test_shell/SConscript +++ b/webkit/tools/test_shell/SConscript @@ -118,8 +118,8 @@ elif env['PLATFORM'] == 'posix': input_files.extend([ 'gtk/webwidget_host.cc', 'gtk/webview_host.cc', - 'gtk/test_webview_delegate.cc', 'test_shell_gtk.cc', + 'test_webview_delegate_gtk.cc', ]) lib = env.ChromeStaticLibrary('test_shell', input_files) diff --git a/webkit/tools/test_shell/gtk/test_webview_delegate.cc b/webkit/tools/test_shell/gtk/test_webview_delegate.cc deleted file mode 100644 index e934fd2c..0000000 --- a/webkit/tools/test_shell/gtk/test_webview_delegate.cc +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file was forked off the Mac port. - -#include "webkit/tools/test_shell/test_webview_delegate.h" - -#include - -#include "base/gfx/point.h" -#include "base/string_util.h" -#include "net/base/net_errors.h" -#include "chrome/common/page_transition_types.h" -#include "webkit/glue/webcursor.h" -#include "webkit/glue/webdatasource.h" -#include "webkit/glue/webdropdata.h" -#include "webkit/glue/weberror.h" -#include "webkit/glue/webframe.h" -#include "webkit/glue/webpreferences.h" -#include "webkit/glue/weburlrequest.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" -#include "webkit/glue/window_open_disposition.h" -#include "webkit/tools/test_shell/test_navigation_controller.h" -#include "webkit/tools/test_shell/test_shell.h" - -// WebViewDelegate ----------------------------------------------------------- - -TestWebViewDelegate::~TestWebViewDelegate() { -} - -WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( - WebView* webview, - const GURL& url, - const std::string& mime_type, - const std::string& clsid, - std::string* actual_mime_type) { - NOTIMPLEMENTED(); - return NULL; -} - -void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { - NOTIMPLEMENTED(); -} - -void TestWebViewDelegate::Show(WebWidget* webview, - WindowOpenDisposition disposition) { - NOTIMPLEMENTED(); -} - -void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { - NOTIMPLEMENTED(); -} - -void TestWebViewDelegate::SetCursor(WebWidget* webwidget, - const WebCursor& cursor) { - GdkCursorType cursor_type = cursor.GetCursorType(); - if (cursor_type_ == cursor_type) - return; - - cursor_type_ = cursor_type; - if (cursor_type_ == GDK_CURSOR_IS_PIXMAP) { - NOTIMPLEMENTED(); - cursor_type = GDK_ARROW; // Just a hack for now. - } - GdkCursor* gdk_cursor = gdk_cursor_new(cursor_type); - gdk_window_set_cursor(shell_->webViewWnd()->window, gdk_cursor); - // The window now owns the cursor. - gdk_cursor_unref(gdk_cursor); -} - -void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, - gfx::Rect* out_rect) { - DCHECK(out_rect); - //if (WebWidgetHost* host = GetHostForWidget(webwidget)) { - NOTIMPLEMENTED(); - //} -} - -void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, - const gfx::Rect& rect) { - // TODO(port): window movement - if (webwidget == shell_->webView()) { - // ignored - } else if (webwidget == shell_->popup()) { - NOTIMPLEMENTED(); - } -} - -void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, - gfx::Rect* out_rect) { - //if (WebWidgetHost* host = GetHostForWidget(webwidget)) { - NOTIMPLEMENTED(); - //} -} - -void TestWebViewDelegate::RunModal(WebWidget* webwidget) { - NOTIMPLEMENTED(); -} - -// Private methods ----------------------------------------------------------- - -void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { - gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), - ("Test Shell - " + WideToUTF8(title)).c_str()); -} - -void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { - gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); -} diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc new file mode 100644 index 0000000..e934fd2c --- /dev/null +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -0,0 +1,111 @@ +// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file was forked off the Mac port. + +#include "webkit/tools/test_shell/test_webview_delegate.h" + +#include + +#include "base/gfx/point.h" +#include "base/string_util.h" +#include "net/base/net_errors.h" +#include "chrome/common/page_transition_types.h" +#include "webkit/glue/webcursor.h" +#include "webkit/glue/webdatasource.h" +#include "webkit/glue/webdropdata.h" +#include "webkit/glue/weberror.h" +#include "webkit/glue/webframe.h" +#include "webkit/glue/webpreferences.h" +#include "webkit/glue/weburlrequest.h" +#include "webkit/glue/webkit_glue.h" +#include "webkit/glue/webview.h" +#include "webkit/glue/window_open_disposition.h" +#include "webkit/tools/test_shell/test_navigation_controller.h" +#include "webkit/tools/test_shell/test_shell.h" + +// WebViewDelegate ----------------------------------------------------------- + +TestWebViewDelegate::~TestWebViewDelegate() { +} + +WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( + WebView* webview, + const GURL& url, + const std::string& mime_type, + const std::string& clsid, + std::string* actual_mime_type) { + NOTIMPLEMENTED(); + return NULL; +} + +void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { + NOTIMPLEMENTED(); +} + +void TestWebViewDelegate::Show(WebWidget* webview, + WindowOpenDisposition disposition) { + NOTIMPLEMENTED(); +} + +void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { + NOTIMPLEMENTED(); +} + +void TestWebViewDelegate::SetCursor(WebWidget* webwidget, + const WebCursor& cursor) { + GdkCursorType cursor_type = cursor.GetCursorType(); + if (cursor_type_ == cursor_type) + return; + + cursor_type_ = cursor_type; + if (cursor_type_ == GDK_CURSOR_IS_PIXMAP) { + NOTIMPLEMENTED(); + cursor_type = GDK_ARROW; // Just a hack for now. + } + GdkCursor* gdk_cursor = gdk_cursor_new(cursor_type); + gdk_window_set_cursor(shell_->webViewWnd()->window, gdk_cursor); + // The window now owns the cursor. + gdk_cursor_unref(gdk_cursor); +} + +void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget, + gfx::Rect* out_rect) { + DCHECK(out_rect); + //if (WebWidgetHost* host = GetHostForWidget(webwidget)) { + NOTIMPLEMENTED(); + //} +} + +void TestWebViewDelegate::SetWindowRect(WebWidget* webwidget, + const gfx::Rect& rect) { + // TODO(port): window movement + if (webwidget == shell_->webView()) { + // ignored + } else if (webwidget == shell_->popup()) { + NOTIMPLEMENTED(); + } +} + +void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget, + gfx::Rect* out_rect) { + //if (WebWidgetHost* host = GetHostForWidget(webwidget)) { + NOTIMPLEMENTED(); + //} +} + +void TestWebViewDelegate::RunModal(WebWidget* webwidget) { + NOTIMPLEMENTED(); +} + +// Private methods ----------------------------------------------------------- + +void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { + gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), + ("Test Shell - " + WideToUTF8(title)).c_str()); +} + +void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { + gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); +} -- cgit v1.1