Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11615002: Exclude PluginService for builds with enable_plugins==0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/common/content_client.cc ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 // will have to close the first one before another one can be shown. 1861 // will have to close the first one before another one can be shown.
1862 if (external_popup_menu_.get()) 1862 if (external_popup_menu_.get())
1863 return NULL; 1863 return NULL;
1864 external_popup_menu_.reset( 1864 external_popup_menu_.reset(
1865 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); 1865 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client));
1866 return external_popup_menu_.get(); 1866 return external_popup_menu_.get();
1867 } 1867 }
1868 1868
1869 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( 1869 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer(
1870 webkit::ppapi::PluginInstance* plugin) { 1870 webkit::ppapi::PluginInstance* plugin) {
1871 #if defined(ENABLE_PLUGINS)
1871 GURL active_url; 1872 GURL active_url;
1872 if (webview() && webview()->mainFrame()) 1873 if (webview() && webview()->mainFrame())
1873 active_url = GURL(webview()->mainFrame()->document().url()); 1874 active_url = GURL(webview()->mainFrame()->document().url());
1874 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( 1875 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create(
1875 routing_id_, plugin, active_url, screen_info_); 1876 routing_id_, plugin, active_url, screen_info_);
1876 widget->show(WebKit::WebNavigationPolicyIgnore); 1877 widget->show(WebKit::WebNavigationPolicyIgnore);
1877 return widget; 1878 return widget;
1879 #else // defined(ENABLE_PLUGINS)
1880 NOTREACHED() << "CreatePepperFullscreenContainer: plugins disabled";
1881 return NULL;
1882 #endif
1878 } 1883 }
1879 1884
1880 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( 1885 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace(
1881 unsigned quota) { 1886 unsigned quota) {
1882 CHECK(session_storage_namespace_id_ != 1887 CHECK(session_storage_namespace_id_ !=
1883 dom_storage::kInvalidSessionStorageNamespaceId); 1888 dom_storage::kInvalidSessionStorageNamespaceId);
1884 return new WebStorageNamespaceImpl(session_storage_namespace_id_); 1889 return new WebStorageNamespaceImpl(session_storage_namespace_id_);
1885 } 1890 }
1886 1891
1887 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { 1892 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() {
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 2498
2494 RenderWidget::didActivateCompositor(input_handler_identifier); 2499 RenderWidget::didActivateCompositor(input_handler_identifier);
2495 2500
2496 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); 2501 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess());
2497 } 2502 }
2498 2503
2499 // WebKit::WebFrameClient ----------------------------------------------------- 2504 // WebKit::WebFrameClient -----------------------------------------------------
2500 2505
2501 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, 2506 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame,
2502 const WebPluginParams& params) { 2507 const WebPluginParams& params) {
2508 #if defined(ENABLE_PLUGINS)
2503 WebPlugin* plugin = NULL; 2509 WebPlugin* plugin = NULL;
2504 if (GetContentClient()->renderer()->OverrideCreatePlugin( 2510 if (GetContentClient()->renderer()->OverrideCreatePlugin(
2505 this, frame, params, &plugin)) { 2511 this, frame, params, &plugin)) {
2506 return plugin; 2512 return plugin;
2507 } 2513 }
2508 2514
2509 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { 2515 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) {
2510 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params); 2516 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params);
2511 } 2517 }
2512 2518
2513 webkit::WebPluginInfo info; 2519 webkit::WebPluginInfo info;
2514 std::string mime_type; 2520 std::string mime_type;
2515 bool found = GetPluginInfo(params.url, frame->top()->document().url(), 2521 bool found = GetPluginInfo(params.url, frame->top()->document().url(),
2516 params.mimeType.utf8(), &info, &mime_type); 2522 params.mimeType.utf8(), &info, &mime_type);
2517 if (!found) 2523 if (!found)
2518 return NULL; 2524 return NULL;
2519 2525
2520 WebPluginParams params_to_use = params; 2526 WebPluginParams params_to_use = params;
2521 params_to_use.mimeType = WebString::fromUTF8(mime_type); 2527 params_to_use.mimeType = WebString::fromUTF8(mime_type);
2522 return CreatePlugin(frame, info, params_to_use); 2528 return CreatePlugin(frame, info, params_to_use);
2529 #else
2530 return NULL;
2531 #endif // defined(ENABLE_PLUGINS)
2523 } 2532 }
2524 2533
2525 WebSharedWorker* RenderViewImpl::createSharedWorker( 2534 WebSharedWorker* RenderViewImpl::createSharedWorker(
2526 WebFrame* frame, const WebURL& url, const WebString& name, 2535 WebFrame* frame, const WebURL& url, const WebString& name,
2527 unsigned long long document_id) { 2536 unsigned long long document_id) {
2528 2537
2529 int route_id = MSG_ROUTING_NONE; 2538 int route_id = MSG_ROUTING_NONE;
2530 bool exists = false; 2539 bool exists = false;
2531 bool url_mismatch = false; 2540 bool url_mismatch = false;
2532 ViewHostMsg_CreateWorker_Params params; 2541 ViewHostMsg_CreateWorker_Params params;
(...skipping 3971 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « content/public/common/content_client.cc ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698