| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file was forked off the Mac port. | 5 // This file was forked off the Mac port. |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/test_webview_delegate.h" | 7 #include "webkit/tools/test_shell/test_webview_delegate.h" |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 #include <gdk/gdkx.h> | 10 #include <gdk/gdkx.h> |
| 11 | 11 |
| 12 #include "app/gfx/gtk_util.h" | 12 #include "app/gfx/gtk_util.h" |
| 13 #include "base/gfx/point.h" | 13 #include "base/gfx/point.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "chrome/common/page_transition_types.h" | 17 #include "chrome/common/page_transition_types.h" |
| 18 #include "webkit/api/public/WebCString.h" | 18 #include "webkit/api/public/WebCString.h" |
| 19 #include "webkit/api/public/WebCursorInfo.h" | 19 #include "webkit/api/public/WebCursorInfo.h" |
| 20 #include "webkit/api/public/WebFrame.h" | 20 #include "webkit/api/public/WebFrame.h" |
| 21 #include "webkit/api/public/WebRect.h" | 21 #include "webkit/api/public/WebRect.h" |
| 22 #include "webkit/api/public/WebString.h" | 22 #include "webkit/api/public/WebString.h" |
| 23 #include "webkit/api/public/WebView.h" |
| 23 #include "webkit/glue/webcursor.h" | 24 #include "webkit/glue/webcursor.h" |
| 24 #include "webkit/glue/webdropdata.h" | 25 #include "webkit/glue/webdropdata.h" |
| 25 #include "webkit/glue/webpreferences.h" | 26 #include "webkit/glue/webpreferences.h" |
| 26 #include "webkit/glue/webplugin.h" | 27 #include "webkit/glue/webplugin.h" |
| 27 #include "webkit/glue/webkit_glue.h" | 28 #include "webkit/glue/webkit_glue.h" |
| 28 #include "webkit/glue/webview.h" | |
| 29 #include "webkit/glue/plugins/gtk_plugin_container_manager.h" | 29 #include "webkit/glue/plugins/gtk_plugin_container_manager.h" |
| 30 #include "webkit/glue/plugins/plugin_list.h" | 30 #include "webkit/glue/plugins/plugin_list.h" |
| 31 #include "webkit/glue/window_open_disposition.h" | 31 #include "webkit/glue/window_open_disposition.h" |
| 32 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 32 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 33 #include "webkit/tools/test_shell/test_navigation_controller.h" | 33 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 34 #include "webkit/tools/test_shell/test_shell.h" | 34 #include "webkit/tools/test_shell/test_shell.h" |
| 35 | 35 |
| 36 using WebKit::WebCursorInfo; | 36 using WebKit::WebCursorInfo; |
| 37 using WebKit::WebFrame; | 37 using WebKit::WebFrame; |
| 38 using WebKit::WebNavigationPolicy; | 38 using WebKit::WebNavigationPolicy; |
| 39 using WebKit::WebPopupMenuInfo; | 39 using WebKit::WebPopupMenuInfo; |
| 40 using WebKit::WebRect; | 40 using WebKit::WebRect; |
| 41 using WebKit::WebWidget; | 41 using WebKit::WebWidget; |
| 42 using WebKit::WebView; |
| 42 | 43 |
| 43 namespace { | 44 namespace { |
| 44 | 45 |
| 45 enum SelectionClipboardType { | 46 enum SelectionClipboardType { |
| 46 TEXT_HTML, | 47 TEXT_HTML, |
| 47 PLAIN_TEXT, | 48 PLAIN_TEXT, |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 GdkAtom GetTextHtmlAtom() { | 51 GdkAtom GetTextHtmlAtom() { |
| 51 GdkAtom kTextHtmlGdkAtom = gdk_atom_intern_static_string("text/html"); | 52 GdkAtom kTextHtmlGdkAtom = gdk_atom_intern_static_string("text/html"); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 274 } |
| 274 | 275 |
| 275 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { | 276 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { |
| 276 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), | 277 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), |
| 277 ("Test Shell - " + WideToUTF8(title)).c_str()); | 278 ("Test Shell - " + WideToUTF8(title)).c_str()); |
| 278 } | 279 } |
| 279 | 280 |
| 280 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 281 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
| 281 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); | 282 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); |
| 282 } | 283 } |
| OLD | NEW |