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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 649873006: Enable shadow DOM-based "missing plugin" placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments (thestig, sievers) Created 6 years, 1 month 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
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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 27 matching lines...) Expand all
38 #include "chrome/renderer/media/chrome_key_systems.h" 38 #include "chrome/renderer/media/chrome_key_systems.h"
39 #include "chrome/renderer/net/net_error_helper.h" 39 #include "chrome/renderer/net/net_error_helper.h"
40 #include "chrome/renderer/net/prescient_networking_dispatcher.h" 40 #include "chrome/renderer/net/prescient_networking_dispatcher.h"
41 #include "chrome/renderer/net/renderer_net_predictor.h" 41 #include "chrome/renderer/net/renderer_net_predictor.h"
42 #include "chrome/renderer/net_benchmarking_extension.h" 42 #include "chrome/renderer/net_benchmarking_extension.h"
43 #include "chrome/renderer/page_load_histograms.h" 43 #include "chrome/renderer/page_load_histograms.h"
44 #include "chrome/renderer/pepper/pepper_helper.h" 44 #include "chrome/renderer/pepper/pepper_helper.h"
45 #include "chrome/renderer/playback_extension.h" 45 #include "chrome/renderer/playback_extension.h"
46 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" 46 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
47 #include "chrome/renderer/plugins/plugin_uma.h" 47 #include "chrome/renderer/plugins/plugin_uma.h"
48 #include "chrome/renderer/plugins/shadow_dom_plugin_placeholder.h"
48 #include "chrome/renderer/prefetch_helper.h" 49 #include "chrome/renderer/prefetch_helper.h"
49 #include "chrome/renderer/prerender/prerender_dispatcher.h" 50 #include "chrome/renderer/prerender/prerender_dispatcher.h"
50 #include "chrome/renderer/prerender/prerender_helper.h" 51 #include "chrome/renderer/prerender/prerender_helper.h"
51 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h" 52 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h"
52 #include "chrome/renderer/prerender/prerenderer_client.h" 53 #include "chrome/renderer/prerender/prerenderer_client.h"
53 #include "chrome/renderer/principals_extension_bindings.h" 54 #include "chrome/renderer/principals_extension_bindings.h"
54 #include "chrome/renderer/printing/print_web_view_helper.h" 55 #include "chrome/renderer/printing/print_web_view_helper.h"
55 #include "chrome/renderer/safe_browsing/malware_dom_details.h" 56 #include "chrome/renderer/safe_browsing/malware_dom_details.h"
56 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" 57 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
57 #include "chrome/renderer/searchbox/search_bouncer.h" 58 #include "chrome/renderer/searchbox/search_bouncer.h"
(...skipping 27 matching lines...) Expand all
85 #include "third_party/WebKit/public/platform/WebURL.h" 86 #include "third_party/WebKit/public/platform/WebURL.h"
86 #include "third_party/WebKit/public/platform/WebURLError.h" 87 #include "third_party/WebKit/public/platform/WebURLError.h"
87 #include "third_party/WebKit/public/platform/WebURLRequest.h" 88 #include "third_party/WebKit/public/platform/WebURLRequest.h"
88 #include "third_party/WebKit/public/web/WebCache.h" 89 #include "third_party/WebKit/public/web/WebCache.h"
89 #include "third_party/WebKit/public/web/WebDataSource.h" 90 #include "third_party/WebKit/public/web/WebDataSource.h"
90 #include "third_party/WebKit/public/web/WebDocument.h" 91 #include "third_party/WebKit/public/web/WebDocument.h"
91 #include "third_party/WebKit/public/web/WebElement.h" 92 #include "third_party/WebKit/public/web/WebElement.h"
92 #include "third_party/WebKit/public/web/WebLocalFrame.h" 93 #include "third_party/WebKit/public/web/WebLocalFrame.h"
93 #include "third_party/WebKit/public/web/WebPluginContainer.h" 94 #include "third_party/WebKit/public/web/WebPluginContainer.h"
94 #include "third_party/WebKit/public/web/WebPluginParams.h" 95 #include "third_party/WebKit/public/web/WebPluginParams.h"
96 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h"
95 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 97 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
96 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 98 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
97 #include "ui/base/l10n/l10n_util.h" 99 #include "ui/base/l10n/l10n_util.h"
98 #include "ui/base/layout.h" 100 #include "ui/base/layout.h"
99 #include "ui/base/resource/resource_bundle.h" 101 #include "ui/base/resource/resource_bundle.h"
100 #include "ui/base/webui/jstemplate_builder.h" 102 #include "ui/base/webui/jstemplate_builder.h"
101 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 103 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
102 104
103 #if !defined(DISABLE_NACL) 105 #if !defined(DISABLE_NACL)
104 #include "components/nacl/common/nacl_constants.h" 106 #include "components/nacl/common/nacl_constants.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 const Extension* ChromeContentRendererClient::GetExtensionByOrigin( 542 const Extension* ChromeContentRendererClient::GetExtensionByOrigin(
541 const WebSecurityOrigin& origin) const { 543 const WebSecurityOrigin& origin) const {
542 if (!EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) 544 if (!EqualsASCII(origin.protocol(), extensions::kExtensionScheme))
543 return NULL; 545 return NULL;
544 546
545 const std::string extension_id = origin.host().utf8().data(); 547 const std::string extension_id = origin.host().utf8().data();
546 return extension_dispatcher_->extensions()->GetByID(extension_id); 548 return extension_dispatcher_->extensions()->GetByID(extension_id);
547 } 549 }
548 #endif 550 #endif
549 551
552 scoped_ptr<blink::WebPluginPlaceholder>
553 ChromeContentRendererClient::CreatePluginPlaceholder(
554 content::RenderFrame* render_frame,
555 blink::WebLocalFrame* frame,
556 const blink::WebPluginParams& orig_params) {
557 return CreateShadowDOMPlaceholderForPluginInfo(
558 render_frame, frame, orig_params);
559 }
560
550 bool ChromeContentRendererClient::OverrideCreatePlugin( 561 bool ChromeContentRendererClient::OverrideCreatePlugin(
551 content::RenderFrame* render_frame, 562 content::RenderFrame* render_frame,
552 WebLocalFrame* frame, 563 WebLocalFrame* frame,
553 const WebPluginParams& params, 564 const WebPluginParams& params,
554 WebPlugin** plugin) { 565 WebPlugin** plugin) {
555 std::string orig_mime_type = params.mimeType.utf8(); 566 std::string orig_mime_type = params.mimeType.utf8();
556 #if defined(ENABLE_EXTENSIONS) 567 #if defined(ENABLE_EXTENSIONS)
557 if (orig_mime_type == content::kBrowserPluginMimeType) { 568 if (orig_mime_type == content::kBrowserPluginMimeType) {
558 bool guest_view_api_available = false; 569 bool guest_view_api_available = false;
559 extension_dispatcher_->script_context_set().ForEach( 570 extension_dispatcher_->script_context_set().ForEach(
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 content::BrowserPluginDelegate* 1596 content::BrowserPluginDelegate*
1586 ChromeContentRendererClient::CreateBrowserPluginDelegate( 1597 ChromeContentRendererClient::CreateBrowserPluginDelegate(
1587 content::RenderFrame* render_frame, 1598 content::RenderFrame* render_frame,
1588 const std::string& mime_type) { 1599 const std::string& mime_type) {
1589 #if defined(ENABLE_EXTENSIONS) 1600 #if defined(ENABLE_EXTENSIONS)
1590 return new extensions::GuestViewContainer(render_frame, mime_type); 1601 return new extensions::GuestViewContainer(render_frame, mime_type);
1591 #else 1602 #else
1592 return NULL; 1603 return NULL;
1593 #endif 1604 #endif
1594 } 1605 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | chrome/renderer/chrome_content_renderer_client_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698