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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #include "webkit/forms/form_field.h" | 149 #include "webkit/forms/form_field.h" |
150 #include "webkit/forms/password_form_dom_manager.h" | 150 #include "webkit/forms/password_form_dom_manager.h" |
151 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 151 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
152 #include "webkit/glue/context_menu.h" | 152 #include "webkit/glue/context_menu.h" |
153 #include "webkit/glue/dom_operations.h" | 153 #include "webkit/glue/dom_operations.h" |
154 #include "webkit/glue/glue_serialize.h" | 154 #include "webkit/glue/glue_serialize.h" |
155 #include "webkit/glue/webdropdata.h" | 155 #include "webkit/glue/webdropdata.h" |
156 #include "webkit/glue/webkit_constants.h" | 156 #include "webkit/glue/webkit_constants.h" |
157 #include "webkit/glue/webkit_glue.h" | 157 #include "webkit/glue/webkit_glue.h" |
158 #include "webkit/glue/weburlloader_impl.h" | 158 #include "webkit/glue/weburlloader_impl.h" |
| 159 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
159 #include "webkit/media/webmediaplayer_impl.h" | 160 #include "webkit/media/webmediaplayer_impl.h" |
160 #include "webkit/plugins/npapi/plugin_list.h" | 161 #include "webkit/plugins/npapi/plugin_list.h" |
161 #include "webkit/plugins/npapi/webplugin_delegate.h" | 162 #include "webkit/plugins/npapi/webplugin_delegate.h" |
162 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 163 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
163 #include "webkit/plugins/npapi/webplugin_impl.h" | 164 #include "webkit/plugins/npapi/webplugin_impl.h" |
164 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 165 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
165 | 166 |
166 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
167 // TODO(port): these files are currently Windows only because they concern: | 168 // TODO(port): these files are currently Windows only because they concern: |
168 // * theming | 169 // * theming |
(...skipping 25 matching lines...) Expand all Loading... |
194 using WebKit::WebElement; | 195 using WebKit::WebElement; |
195 using WebKit::WebExternalPopupMenu; | 196 using WebKit::WebExternalPopupMenu; |
196 using WebKit::WebExternalPopupMenuClient; | 197 using WebKit::WebExternalPopupMenuClient; |
197 using WebKit::WebFileChooserCompletion; | 198 using WebKit::WebFileChooserCompletion; |
198 using WebKit::WebFileSystem; | 199 using WebKit::WebFileSystem; |
199 using WebKit::WebFileSystemCallbacks; | 200 using WebKit::WebFileSystemCallbacks; |
200 using WebKit::WebFindOptions; | 201 using WebKit::WebFindOptions; |
201 using WebKit::WebFormControlElement; | 202 using WebKit::WebFormControlElement; |
202 using WebKit::WebFormElement; | 203 using WebKit::WebFormElement; |
203 using WebKit::WebFrame; | 204 using WebKit::WebFrame; |
| 205 using WebKit::WebGraphicsContext3D; |
204 using WebKit::WebHistoryItem; | 206 using WebKit::WebHistoryItem; |
205 using WebKit::WebIconURL; | 207 using WebKit::WebIconURL; |
206 using WebKit::WebImage; | 208 using WebKit::WebImage; |
207 using WebKit::WebInputElement; | 209 using WebKit::WebInputElement; |
208 using WebKit::WebMediaPlayer; | 210 using WebKit::WebMediaPlayer; |
209 using WebKit::WebMediaPlayerAction; | 211 using WebKit::WebMediaPlayerAction; |
210 using WebKit::WebMediaPlayerClient; | 212 using WebKit::WebMediaPlayerClient; |
211 using WebKit::WebNavigationPolicy; | 213 using WebKit::WebNavigationPolicy; |
212 using WebKit::WebNavigationType; | 214 using WebKit::WebNavigationType; |
213 using WebKit::WebNode; | 215 using WebKit::WebNode; |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 | 1426 |
1425 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( | 1427 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( |
1426 unsigned quota) { | 1428 unsigned quota) { |
1427 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 1429 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
1428 return WebStorageNamespace::createSessionStorageNamespace(quota); | 1430 return WebStorageNamespace::createSessionStorageNamespace(quota); |
1429 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); | 1431 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); |
1430 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, | 1432 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, |
1431 session_storage_namespace_id_); | 1433 session_storage_namespace_id_); |
1432 } | 1434 } |
1433 | 1435 |
| 1436 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( |
| 1437 WebGraphicsContext3D::Attributes attributes, |
| 1438 bool direct) { |
| 1439 if (!webview()) |
| 1440 return NULL; |
| 1441 // The WebGraphicsContext3DInProcessImpl code path is used for |
| 1442 // layout tests (though not through this code) as well as for |
| 1443 // debugging and bringing up new ports. |
| 1444 scoped_ptr<WebGraphicsContext3D> context; |
| 1445 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
| 1446 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 1447 gfx::kNullPluginWindow, NULL)); |
| 1448 } else { |
| 1449 #if defined(ENABLE_GPU) |
| 1450 context.reset(new WebGraphicsContext3DCommandBufferImpl()); |
| 1451 #else |
| 1452 return NULL; |
| 1453 #endif |
| 1454 } |
| 1455 if (!context->initialize(attributes, webview(), direct)) |
| 1456 return NULL; |
| 1457 return context.release(); |
| 1458 } |
| 1459 |
1434 void RenderViewImpl::didAddMessageToConsole( | 1460 void RenderViewImpl::didAddMessageToConsole( |
1435 const WebConsoleMessage& message, const WebString& source_name, | 1461 const WebConsoleMessage& message, const WebString& source_name, |
1436 unsigned source_line) { | 1462 unsigned source_line) { |
1437 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 1463 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
1438 switch (message.level) { | 1464 switch (message.level) { |
1439 case WebConsoleMessage::LevelTip: | 1465 case WebConsoleMessage::LevelTip: |
1440 log_severity = logging::LOG_VERBOSE; | 1466 log_severity = logging::LOG_VERBOSE; |
1441 break; | 1467 break; |
1442 case WebConsoleMessage::LevelLog: | 1468 case WebConsoleMessage::LevelLog: |
1443 log_severity = logging::LOG_INFO; | 1469 log_severity = logging::LOG_INFO; |
(...skipping 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4878 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4904 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4879 return !!RenderThreadImpl::current()->compositor_thread(); | 4905 return !!RenderThreadImpl::current()->compositor_thread(); |
4880 } | 4906 } |
4881 | 4907 |
4882 void RenderViewImpl::OnJavaBridgeInit() { | 4908 void RenderViewImpl::OnJavaBridgeInit() { |
4883 DCHECK(!java_bridge_dispatcher_.get()); | 4909 DCHECK(!java_bridge_dispatcher_.get()); |
4884 #if defined(ENABLE_JAVA_BRIDGE) | 4910 #if defined(ENABLE_JAVA_BRIDGE) |
4885 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4911 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4886 #endif | 4912 #endif |
4887 } | 4913 } |
OLD | NEW |