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 "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 Loading... | |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 #endif | 129 #endif |
130 | 130 |
131 #if defined(ENABLE_WEBRTC) | 131 #if defined(ENABLE_WEBRTC) |
132 #include "chrome/renderer/media/webrtc_logging_message_filter.h" | 132 #include "chrome/renderer/media/webrtc_logging_message_filter.h" |
133 #endif | 133 #endif |
134 | 134 |
135 #if defined(OS_WIN) | 135 #if defined(OS_WIN) |
136 #include "chrome_elf/blacklist/blacklist.h" | 136 #include "chrome_elf/blacklist/blacklist.h" |
137 #endif | 137 #endif |
138 | 138 |
139 #if defined(ENABLE_FULL_PRINTING) | |
Lei Zhang
2014/08/26 22:41:30
nit: can you move this up to be with the other ENA
sadrul
2014/08/27 00:09:52
Done.
| |
140 #include "chrome/renderer/pepper/chrome_pdf_print_delegate.h" | |
141 #endif | |
142 | |
139 using autofill::AutofillAgent; | 143 using autofill::AutofillAgent; |
140 using autofill::PasswordAutofillAgent; | 144 using autofill::PasswordAutofillAgent; |
141 using autofill::PasswordGenerationAgent; | 145 using autofill::PasswordGenerationAgent; |
142 using base::ASCIIToUTF16; | 146 using base::ASCIIToUTF16; |
143 using base::UserMetricsAction; | 147 using base::UserMetricsAction; |
144 using content::RenderThread; | 148 using content::RenderThread; |
145 using content::WebPluginInfo; | 149 using content::WebPluginInfo; |
146 using extensions::Extension; | 150 using extensions::Extension; |
147 using blink::WebCache; | 151 using blink::WebCache; |
148 using blink::WebConsoleMessage; | 152 using blink::WebConsoleMessage; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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_delegate_.reset(new ChromePDFPrintDelegate()); | |
430 pdf::PPB_PDF_Impl::SetPrintDelegate(pdf_print_delegate_.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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |