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