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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 // will have to close the first one before another one can be shown. | 1860 // will have to close the first one before another one can be shown. |
1861 if (external_popup_menu_.get()) | 1861 if (external_popup_menu_.get()) |
1862 return NULL; | 1862 return NULL; |
1863 external_popup_menu_.reset( | 1863 external_popup_menu_.reset( |
1864 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); | 1864 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); |
1865 return external_popup_menu_.get(); | 1865 return external_popup_menu_.get(); |
1866 } | 1866 } |
1867 | 1867 |
1868 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( | 1868 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( |
1869 webkit::ppapi::PluginInstance* plugin) { | 1869 webkit::ppapi::PluginInstance* plugin) { |
| 1870 #if defined(ENABLE_PLUGINS) |
1870 GURL active_url; | 1871 GURL active_url; |
1871 if (webview() && webview()->mainFrame()) | 1872 if (webview() && webview()->mainFrame()) |
1872 active_url = GURL(webview()->mainFrame()->document().url()); | 1873 active_url = GURL(webview()->mainFrame()->document().url()); |
1873 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( | 1874 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( |
1874 routing_id_, plugin, active_url, screen_info_); | 1875 routing_id_, plugin, active_url, screen_info_); |
1875 widget->show(WebKit::WebNavigationPolicyIgnore); | 1876 widget->show(WebKit::WebNavigationPolicyIgnore); |
1876 return widget; | 1877 return widget; |
| 1878 #else // defined(ENABLE_PLUGINS) |
| 1879 NOTREACHED() << "CreatePepperFullscreenContainer: plugins disabled"; |
| 1880 return NULL; |
| 1881 #endif |
1877 } | 1882 } |
1878 | 1883 |
1879 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( | 1884 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( |
1880 unsigned quota) { | 1885 unsigned quota) { |
1881 CHECK(session_storage_namespace_id_ != | 1886 CHECK(session_storage_namespace_id_ != |
1882 dom_storage::kInvalidSessionStorageNamespaceId); | 1887 dom_storage::kInvalidSessionStorageNamespaceId); |
1883 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1888 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
1884 } | 1889 } |
1885 | 1890 |
1886 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { | 1891 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2492 | 2497 |
2493 RenderWidget::didActivateCompositor(input_handler_identifier); | 2498 RenderWidget::didActivateCompositor(input_handler_identifier); |
2494 | 2499 |
2495 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); | 2500 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); |
2496 } | 2501 } |
2497 | 2502 |
2498 // WebKit::WebFrameClient ----------------------------------------------------- | 2503 // WebKit::WebFrameClient ----------------------------------------------------- |
2499 | 2504 |
2500 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, | 2505 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, |
2501 const WebPluginParams& params) { | 2506 const WebPluginParams& params) { |
| 2507 #if defined(ENABLE_PLUGINS) |
2502 WebPlugin* plugin = NULL; | 2508 WebPlugin* plugin = NULL; |
2503 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 2509 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
2504 this, frame, params, &plugin)) { | 2510 this, frame, params, &plugin)) { |
2505 return plugin; | 2511 return plugin; |
2506 } | 2512 } |
2507 | 2513 |
2508 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { | 2514 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { |
2509 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params); | 2515 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params); |
2510 } | 2516 } |
2511 | 2517 |
2512 webkit::WebPluginInfo info; | 2518 webkit::WebPluginInfo info; |
2513 std::string mime_type; | 2519 std::string mime_type; |
2514 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2520 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
2515 params.mimeType.utf8(), &info, &mime_type); | 2521 params.mimeType.utf8(), &info, &mime_type); |
2516 if (!found) | 2522 if (!found) |
2517 return NULL; | 2523 return NULL; |
2518 | 2524 |
2519 WebPluginParams params_to_use = params; | 2525 WebPluginParams params_to_use = params; |
2520 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2526 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
2521 return CreatePlugin(frame, info, params_to_use); | 2527 return CreatePlugin(frame, info, params_to_use); |
| 2528 #else |
| 2529 return NULL; |
| 2530 #endif // defined(ENABLE_PLUGINS) |
2522 } | 2531 } |
2523 | 2532 |
2524 WebSharedWorker* RenderViewImpl::createSharedWorker( | 2533 WebSharedWorker* RenderViewImpl::createSharedWorker( |
2525 WebFrame* frame, const WebURL& url, const WebString& name, | 2534 WebFrame* frame, const WebURL& url, const WebString& name, |
2526 unsigned long long document_id) { | 2535 unsigned long long document_id) { |
2527 | 2536 |
2528 int route_id = MSG_ROUTING_NONE; | 2537 int route_id = MSG_ROUTING_NONE; |
2529 bool exists = false; | 2538 bool exists = false; |
2530 bool url_mismatch = false; | 2539 bool url_mismatch = false; |
2531 ViewHostMsg_CreateWorker_Params params; | 2540 ViewHostMsg_CreateWorker_Params params; |
(...skipping 3972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6504 } | 6513 } |
6505 #endif | 6514 #endif |
6506 | 6515 |
6507 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6516 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6508 TransportDIB::Handle dib_handle) { | 6517 TransportDIB::Handle dib_handle) { |
6509 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6518 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6510 RenderProcess::current()->ReleaseTransportDIB(dib); | 6519 RenderProcess::current()->ReleaseTransportDIB(dib); |
6511 } | 6520 } |
6512 | 6521 |
6513 } // namespace content | 6522 } // namespace content |
OLD | NEW |