| 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/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/renderer/chrome_render_view_observer.h" | 34 #include "chrome/renderer/chrome_render_view_observer.h" |
| 35 #include "chrome/renderer/content_settings_observer.h" | 35 #include "chrome/renderer/content_settings_observer.h" |
| 36 #include "chrome/renderer/extensions/chrome_v8_context.h" | 36 #include "chrome/renderer/extensions/chrome_v8_context.h" |
| 37 #include "chrome/renderer/extensions/chrome_v8_extension.h" | 37 #include "chrome/renderer/extensions/chrome_v8_extension.h" |
| 38 #include "chrome/renderer/extensions/dispatcher.h" | 38 #include "chrome/renderer/extensions/dispatcher.h" |
| 39 #include "chrome/renderer/extensions/extension_helper.h" | 39 #include "chrome/renderer/extensions/extension_helper.h" |
| 40 #include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h" | 40 #include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h" |
| 41 #include "chrome/renderer/extensions/resource_request_policy.h" | 41 #include "chrome/renderer/extensions/resource_request_policy.h" |
| 42 #include "chrome/renderer/external_extension.h" | 42 #include "chrome/renderer/external_extension.h" |
| 43 #include "chrome/renderer/loadtimes_extension_bindings.h" | 43 #include "chrome/renderer/loadtimes_extension_bindings.h" |
| 44 #include "chrome/renderer/media/chrome_key_systems.h" |
| 44 #include "chrome/renderer/net/net_error_helper.h" | 45 #include "chrome/renderer/net/net_error_helper.h" |
| 45 #include "chrome/renderer/net/prescient_networking_dispatcher.h" | 46 #include "chrome/renderer/net/prescient_networking_dispatcher.h" |
| 46 #include "chrome/renderer/net/renderer_net_predictor.h" | 47 #include "chrome/renderer/net/renderer_net_predictor.h" |
| 47 #include "chrome/renderer/net_benchmarking_extension.h" | 48 #include "chrome/renderer/net_benchmarking_extension.h" |
| 48 #include "chrome/renderer/page_load_histograms.h" | 49 #include "chrome/renderer/page_load_histograms.h" |
| 49 #include "chrome/renderer/pepper/pepper_helper.h" | 50 #include "chrome/renderer/pepper/pepper_helper.h" |
| 50 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" | 51 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" |
| 51 #include "chrome/renderer/pepper/ppb_pdf_impl.h" | 52 #include "chrome/renderer/pepper/ppb_pdf_impl.h" |
| 52 #include "chrome/renderer/playback_extension.h" | 53 #include "chrome/renderer/playback_extension.h" |
| 53 #include "chrome/renderer/plugins/plugin_placeholder.h" | 54 #include "chrome/renderer/plugins/plugin_placeholder.h" |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1298 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 1298 switches::kEnablePepperTesting)) { | 1299 switches::kEnablePepperTesting)) { |
| 1299 return true; | 1300 return true; |
| 1300 } | 1301 } |
| 1301 #endif // !defined(OS_ANDROID) | 1302 #endif // !defined(OS_ANDROID) |
| 1302 return false; | 1303 return false; |
| 1303 } | 1304 } |
| 1304 | 1305 |
| 1305 void ChromeContentRendererClient::AddKeySystems( | 1306 void ChromeContentRendererClient::AddKeySystems( |
| 1306 std::vector<content::KeySystemInfo>* key_systems) { | 1307 std::vector<content::KeySystemInfo>* key_systems) { |
| 1307 // TODO(ddorwin): In the next CL, move code from | 1308 AddChromeKeySystems(key_systems); |
| 1308 // content/renderer/media/crypto/key_systems_info.cc to chrome_key_systems.cc | |
| 1309 // and call AddKeySystems. | |
| 1310 } | 1309 } |
| 1311 | 1310 |
| 1312 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( | 1311 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( |
| 1313 const base::string16& source) const { | 1312 const base::string16& source) const { |
| 1314 return extensions::IsSourceFromAnExtension(source); | 1313 return extensions::IsSourceFromAnExtension(source); |
| 1315 } | 1314 } |
| 1316 | 1315 |
| 1317 bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const { | 1316 bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const { |
| 1318 // SiteIsolationPolicy is off by default. We would like to activate cross-site | 1317 // SiteIsolationPolicy is off by default. We would like to activate cross-site |
| 1319 // document blocking (for UMA data collection) for normal renderer processes | 1318 // document blocking (for UMA data collection) for normal renderer processes |
| 1320 // running a normal web page from the Internet. We only turn on | 1319 // running a normal web page from the Internet. We only turn on |
| 1321 // SiteIsolationPolicy for a renderer process that does not have the extension | 1320 // SiteIsolationPolicy for a renderer process that does not have the extension |
| 1322 // flag on. | 1321 // flag on. |
| 1323 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1322 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1324 return !command_line->HasSwitch(switches::kExtensionProcess); | 1323 return !command_line->HasSwitch(switches::kExtensionProcess); |
| 1325 } | 1324 } |
| 1326 | 1325 |
| 1327 } // namespace chrome | 1326 } // namespace chrome |
| OLD | NEW |