OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
8 | 8 |
9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
59 #include "ui/gfx/native_widget_types.h" | 59 #include "ui/gfx/native_widget_types.h" |
60 #include "ui/gfx/point.h" | 60 #include "ui/gfx/point.h" |
61 #include "webkit/appcache/web_application_cache_host_impl.h" | 61 #include "webkit/appcache/web_application_cache_host_impl.h" |
62 #include "webkit/glue/glue_serialize.h" | 62 #include "webkit/glue/glue_serialize.h" |
63 #include "webkit/glue/webdropdata.h" | 63 #include "webkit/glue/webdropdata.h" |
64 #include "webkit/glue/webkit_glue.h" | 64 #include "webkit/glue/webkit_glue.h" |
65 #include "webkit/glue/webpreferences.h" | 65 #include "webkit/glue/webpreferences.h" |
66 #include "webkit/glue/weburlrequest_extradata_impl.h" | 66 #include "webkit/glue/weburlrequest_extradata_impl.h" |
67 #include "webkit/glue/window_open_disposition.h" | 67 #include "webkit/glue/window_open_disposition.h" |
| 68 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
68 #include "webkit/media/webmediaplayer_impl.h" | 69 #include "webkit/media/webmediaplayer_impl.h" |
69 #include "webkit/plugins/npapi/webplugin_impl.h" | 70 #include "webkit/plugins/npapi/webplugin_impl.h" |
70 #include "webkit/plugins/npapi/plugin_list.h" | 71 #include "webkit/plugins/npapi/plugin_list.h" |
71 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 72 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
72 #include "webkit/tools/test_shell/mock_spellcheck.h" | 73 #include "webkit/tools/test_shell/mock_spellcheck.h" |
73 #include "webkit/tools/test_shell/notification_presenter.h" | 74 #include "webkit/tools/test_shell/notification_presenter.h" |
74 #include "webkit/tools/test_shell/simple_appcache_system.h" | 75 #include "webkit/tools/test_shell/simple_appcache_system.h" |
75 #include "webkit/tools/test_shell/simple_file_system.h" | 76 #include "webkit/tools/test_shell/simple_file_system.h" |
76 #include "webkit/tools/test_shell/test_navigation_controller.h" | 77 #include "webkit/tools/test_shell/test_navigation_controller.h" |
77 #include "webkit/tools/test_shell/test_shell.h" | 78 #include "webkit/tools/test_shell/test_shell.h" |
(...skipping 12 matching lines...) Expand all Loading... |
90 using WebKit::WebCookieJar; | 91 using WebKit::WebCookieJar; |
91 using WebKit::WebData; | 92 using WebKit::WebData; |
92 using WebKit::WebDataSource; | 93 using WebKit::WebDataSource; |
93 using WebKit::WebDragData; | 94 using WebKit::WebDragData; |
94 using WebKit::WebDragOperationsMask; | 95 using WebKit::WebDragOperationsMask; |
95 using WebKit::WebEditingAction; | 96 using WebKit::WebEditingAction; |
96 using WebKit::WebFileSystem; | 97 using WebKit::WebFileSystem; |
97 using WebKit::WebFileSystemCallbacks; | 98 using WebKit::WebFileSystemCallbacks; |
98 using WebKit::WebFormElement; | 99 using WebKit::WebFormElement; |
99 using WebKit::WebFrame; | 100 using WebKit::WebFrame; |
| 101 using WebKit::WebGraphicsContext3D; |
100 using WebKit::WebHistoryItem; | 102 using WebKit::WebHistoryItem; |
101 using WebKit::WebImage; | 103 using WebKit::WebImage; |
102 using WebKit::WebMediaPlayer; | 104 using WebKit::WebMediaPlayer; |
103 using WebKit::WebMediaPlayerClient; | 105 using WebKit::WebMediaPlayerClient; |
104 using WebKit::WebNavigationType; | 106 using WebKit::WebNavigationType; |
105 using WebKit::WebNavigationPolicy; | 107 using WebKit::WebNavigationPolicy; |
106 using WebKit::WebNode; | 108 using WebKit::WebNode; |
107 using WebKit::WebNotificationPresenter; | 109 using WebKit::WebNotificationPresenter; |
108 using WebKit::WebPlugin; | 110 using WebKit::WebPlugin; |
109 using WebKit::WebPluginParams; | 111 using WebKit::WebPluginParams; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 return shell_->CreatePopupWidget(); | 331 return shell_->CreatePopupWidget(); |
330 } | 332 } |
331 | 333 |
332 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( | 334 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( |
333 unsigned quota) { | 335 unsigned quota) { |
334 // Enforce quota, ignoring the parameter from WebCore as in Chrome. | 336 // Enforce quota, ignoring the parameter from WebCore as in Chrome. |
335 return WebKit::WebStorageNamespace::createSessionStorageNamespace( | 337 return WebKit::WebStorageNamespace::createSessionStorageNamespace( |
336 WebStorageNamespace::m_sessionStorageQuota); | 338 WebStorageNamespace::m_sessionStorageQuota); |
337 } | 339 } |
338 | 340 |
| 341 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( |
| 342 WebGraphicsContext3D::Attributes attributes, |
| 343 bool direct) { |
| 344 if (!shell_->webView()) |
| 345 return NULL; |
| 346 scoped_ptr<WebGraphicsContext3D> context( |
| 347 new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 348 gfx::kNullPluginWindow, NULL)); |
| 349 if (!context->initialize(attributes, shell_->webView(), direct)) |
| 350 return NULL; |
| 351 return context.release(); |
| 352 } |
| 353 |
339 void TestWebViewDelegate::didAddMessageToConsole( | 354 void TestWebViewDelegate::didAddMessageToConsole( |
340 const WebConsoleMessage& message, const WebString& source_name, | 355 const WebConsoleMessage& message, const WebString& source_name, |
341 unsigned source_line) { | 356 unsigned source_line) { |
342 logging::LogMessage("CONSOLE", 0).stream() << "\"" | 357 logging::LogMessage("CONSOLE", 0).stream() << "\"" |
343 << message.text.utf8().data() | 358 << message.text.utf8().data() |
344 << ",\" source: " | 359 << ",\" source: " |
345 << source_name.utf8().data() | 360 << source_name.utf8().data() |
346 << "(" | 361 << "(" |
347 << source_line | 362 << source_line |
348 << ")"; | 363 << ")"; |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 } | 1166 } |
1152 | 1167 |
1153 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1168 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1154 fake_rect_ = rect; | 1169 fake_rect_ = rect; |
1155 using_fake_rect_ = true; | 1170 using_fake_rect_ = true; |
1156 } | 1171 } |
1157 | 1172 |
1158 WebRect TestWebViewDelegate::fake_window_rect() { | 1173 WebRect TestWebViewDelegate::fake_window_rect() { |
1159 return fake_rect_; | 1174 return fake_rect_; |
1160 } | 1175 } |
OLD | NEW |