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

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

Issue 477263003: pdf: Create a separate component for using the pdf pepper plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 3 months 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/renderer/external_extension.h" 44 #include "chrome/renderer/external_extension.h"
45 #include "chrome/renderer/loadtimes_extension_bindings.h" 45 #include "chrome/renderer/loadtimes_extension_bindings.h"
46 #include "chrome/renderer/media/cast_ipc_dispatcher.h" 46 #include "chrome/renderer/media/cast_ipc_dispatcher.h"
47 #include "chrome/renderer/media/chrome_key_systems.h" 47 #include "chrome/renderer/media/chrome_key_systems.h"
48 #include "chrome/renderer/net/net_error_helper.h" 48 #include "chrome/renderer/net/net_error_helper.h"
49 #include "chrome/renderer/net/prescient_networking_dispatcher.h" 49 #include "chrome/renderer/net/prescient_networking_dispatcher.h"
50 #include "chrome/renderer/net/renderer_net_predictor.h" 50 #include "chrome/renderer/net/renderer_net_predictor.h"
51 #include "chrome/renderer/net_benchmarking_extension.h" 51 #include "chrome/renderer/net_benchmarking_extension.h"
52 #include "chrome/renderer/page_load_histograms.h" 52 #include "chrome/renderer/page_load_histograms.h"
53 #include "chrome/renderer/pepper/pepper_helper.h" 53 #include "chrome/renderer/pepper/pepper_helper.h"
54 #include "chrome/renderer/pepper/ppb_pdf_impl.h"
55 #include "chrome/renderer/playback_extension.h" 54 #include "chrome/renderer/playback_extension.h"
56 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" 55 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
57 #include "chrome/renderer/plugins/plugin_uma.h" 56 #include "chrome/renderer/plugins/plugin_uma.h"
58 #include "chrome/renderer/prefetch_helper.h" 57 #include "chrome/renderer/prefetch_helper.h"
59 #include "chrome/renderer/prerender/prerender_dispatcher.h" 58 #include "chrome/renderer/prerender/prerender_dispatcher.h"
60 #include "chrome/renderer/prerender/prerender_helper.h" 59 #include "chrome/renderer/prerender/prerender_helper.h"
61 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h" 60 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h"
62 #include "chrome/renderer/prerender/prerenderer_client.h" 61 #include "chrome/renderer/prerender/prerenderer_client.h"
63 #include "chrome/renderer/principals_extension_bindings.h" 62 #include "chrome/renderer/principals_extension_bindings.h"
64 #include "chrome/renderer/printing/print_web_view_helper.h" 63 #include "chrome/renderer/printing/print_web_view_helper.h"
65 #include "chrome/renderer/safe_browsing/malware_dom_details.h" 64 #include "chrome/renderer/safe_browsing/malware_dom_details.h"
66 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" 65 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
67 #include "chrome/renderer/searchbox/search_bouncer.h" 66 #include "chrome/renderer/searchbox/search_bouncer.h"
68 #include "chrome/renderer/searchbox/searchbox.h" 67 #include "chrome/renderer/searchbox/searchbox.h"
69 #include "chrome/renderer/searchbox/searchbox_extension.h" 68 #include "chrome/renderer/searchbox/searchbox_extension.h"
70 #include "chrome/renderer/tts_dispatcher.h" 69 #include "chrome/renderer/tts_dispatcher.h"
71 #include "chrome/renderer/worker_permission_client_proxy.h" 70 #include "chrome/renderer/worker_permission_client_proxy.h"
72 #include "components/autofill/content/renderer/autofill_agent.h" 71 #include "components/autofill/content/renderer/autofill_agent.h"
73 #include "components/autofill/content/renderer/password_autofill_agent.h" 72 #include "components/autofill/content/renderer/password_autofill_agent.h"
74 #include "components/autofill/content/renderer/password_generation_agent.h" 73 #include "components/autofill/content/renderer/password_generation_agent.h"
75 #include "components/dom_distiller/core/url_constants.h" 74 #include "components/dom_distiller/core/url_constants.h"
76 #include "components/nacl/renderer/ppb_nacl_private_impl.h" 75 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
77 #include "components/password_manager/content/renderer/credential_manager_client .h" 76 #include "components/password_manager/content/renderer/credential_manager_client .h"
77 #include "components/pdf/renderer/ppb_pdf_impl.h"
78 #include "components/plugins/renderer/mobile_youtube_plugin.h" 78 #include "components/plugins/renderer/mobile_youtube_plugin.h"
79 #include "components/signin/core/common/profile_management_switches.h" 79 #include "components/signin/core/common/profile_management_switches.h"
80 #include "components/visitedlink/renderer/visitedlink_slave.h" 80 #include "components/visitedlink/renderer/visitedlink_slave.h"
81 #include "content/public/common/content_constants.h" 81 #include "content/public/common/content_constants.h"
82 #include "content/public/renderer/render_frame.h" 82 #include "content/public/renderer/render_frame.h"
83 #include "content/public/renderer/render_thread.h" 83 #include "content/public/renderer/render_thread.h"
84 #include "content/public/renderer/render_view.h" 84 #include "content/public/renderer/render_view.h"
85 #include "content/public/renderer/render_view_visitor.h" 85 #include "content/public/renderer/render_view_visitor.h"
86 #include "extensions/common/constants.h" 86 #include "extensions/common/constants.h"
87 #include "extensions/common/extension.h" 87 #include "extensions/common/extension.h"
(...skipping 28 matching lines...) Expand all
116 116
117 #if !defined(DISABLE_NACL) 117 #if !defined(DISABLE_NACL)
118 #include "components/nacl/common/nacl_constants.h" 118 #include "components/nacl/common/nacl_constants.h"
119 #include "components/nacl/renderer/nacl_helper.h" 119 #include "components/nacl/renderer/nacl_helper.h"
120 #endif 120 #endif
121 121
122 #if defined(ENABLE_EXTENSIONS) 122 #if defined(ENABLE_EXTENSIONS)
123 #include "extensions/renderer/extensions_render_frame_observer.h" 123 #include "extensions/renderer/extensions_render_frame_observer.h"
124 #endif 124 #endif
125 125
126 #if defined(ENABLE_FULL_PRINTING)
127 #include "chrome/renderer/pepper/chrome_pdf_print_client.h"
128 #endif
129
126 #if defined(ENABLE_SPELLCHECK) 130 #if defined(ENABLE_SPELLCHECK)
127 #include "chrome/renderer/spellchecker/spellcheck.h" 131 #include "chrome/renderer/spellchecker/spellcheck.h"
128 #include "chrome/renderer/spellchecker/spellcheck_provider.h" 132 #include "chrome/renderer/spellchecker/spellcheck_provider.h"
129 #endif 133 #endif
130 134
131 #if defined(ENABLE_WEBRTC) 135 #if defined(ENABLE_WEBRTC)
132 #include "chrome/renderer/media/webrtc_logging_message_filter.h" 136 #include "chrome/renderer/media/webrtc_logging_message_filter.h"
133 #endif 137 #endif
134 138
135 #if defined(OS_WIN) 139 #if defined(OS_WIN)
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 418 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
415 extension_resource_scheme); 419 extension_resource_scheme);
416 420
417 #if defined(OS_WIN) 421 #if defined(OS_WIN)
418 // Report if the renderer process has been patched by chrome_elf. 422 // Report if the renderer process has been patched by chrome_elf.
419 // TODO(csharp): Remove once the renderer is no longer getting 423 // TODO(csharp): Remove once the renderer is no longer getting
420 // patched this way. 424 // patched this way.
421 if (blacklist::IsBlacklistInitialized()) 425 if (blacklist::IsBlacklistInitialized())
422 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); 426 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true);
423 #endif 427 #endif
428 #if defined(ENABLE_FULL_PRINTING)
429 pdf_print_client_.reset(new ChromePDFPrintClient());
430 pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get());
431 #endif
424 } 432 }
425 433
426 void ChromeContentRendererClient::RenderFrameCreated( 434 void ChromeContentRendererClient::RenderFrameCreated(
427 content::RenderFrame* render_frame) { 435 content::RenderFrame* render_frame) {
428 new ChromeRenderFrameObserver(render_frame); 436 new ChromeRenderFrameObserver(render_frame);
429 437
430 ContentSettingsObserver* content_settings = 438 ContentSettingsObserver* content_settings =
431 new ContentSettingsObserver(render_frame, extension_dispatcher_.get()); 439 new ContentSettingsObserver(render_frame, extension_dispatcher_.get());
432 if (chrome_observer_.get()) { 440 if (chrome_observer_.get()) {
433 content_settings->SetContentSettingRules( 441 content_settings->SetContentSettingRules(
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 } 1395 }
1388 1396
1389 const void* ChromeContentRendererClient::CreatePPAPIInterface( 1397 const void* ChromeContentRendererClient::CreatePPAPIInterface(
1390 const std::string& interface_name) { 1398 const std::string& interface_name) {
1391 #if defined(ENABLE_PLUGINS) 1399 #if defined(ENABLE_PLUGINS)
1392 #if !defined(DISABLE_NACL) 1400 #if !defined(DISABLE_NACL)
1393 if (interface_name == PPB_NACL_PRIVATE_INTERFACE) 1401 if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
1394 return nacl::GetNaClPrivateInterface(); 1402 return nacl::GetNaClPrivateInterface();
1395 #endif // DISABLE_NACL 1403 #endif // DISABLE_NACL
1396 if (interface_name == PPB_PDF_INTERFACE) 1404 if (interface_name == PPB_PDF_INTERFACE)
1397 return PPB_PDF_Impl::GetInterface(); 1405 return pdf::PPB_PDF_Impl::GetInterface();
1398 #endif 1406 #endif
1399 return NULL; 1407 return NULL;
1400 } 1408 }
1401 1409
1402 bool ChromeContentRendererClient::IsExternalPepperPlugin( 1410 bool ChromeContentRendererClient::IsExternalPepperPlugin(
1403 const std::string& module_name) { 1411 const std::string& module_name) {
1404 // TODO(bbudge) remove this when the trusted NaCl plugin has been removed. 1412 // TODO(bbudge) remove this when the trusted NaCl plugin has been removed.
1405 // We must defer certain plugin events for NaCl instances since we switch 1413 // We must defer certain plugin events for NaCl instances since we switch
1406 // from the in-process to the out-of-process proxy after instantiating them. 1414 // from the in-process to the out-of-process proxy after instantiating them.
1407 return module_name == "Native Client"; 1415 return module_name == "Native Client";
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 1522
1515 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) 1523 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_))
1516 return true; 1524 return true;
1517 1525
1518 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 1526 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
1519 return channel <= chrome::VersionInfo::CHANNEL_DEV; 1527 return channel <= chrome::VersionInfo::CHANNEL_DEV;
1520 #else 1528 #else
1521 return false; 1529 return false;
1522 #endif 1530 #endif
1523 } 1531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698