Chromium Code Reviews| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/common/channel_info.h" | 17 #include "chrome/common/channel_info.h" |
| 18 #include "chrome/common/chrome_content_client.h" | |
|
Lei Zhang
2015/11/05 21:37:23
You can move both new #includes into the ENABLE_PR
hal.canary
2015/11/05 22:16:48
done
| |
| 18 #include "chrome/common/chrome_isolated_world_ids.h" | 19 #include "chrome/common/chrome_isolated_world_ids.h" |
| 19 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/crash_keys.h" | 22 #include "chrome/common/crash_keys.h" |
| 22 #include "chrome/common/localized_error.h" | 23 #include "chrome/common/localized_error.h" |
| 23 #include "chrome/common/pepper_permission_util.h" | 24 #include "chrome/common/pepper_permission_util.h" |
| 24 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
| 25 #include "chrome/common/secure_origin_whitelist.h" | 26 #include "chrome/common/secure_origin_whitelist.h" |
| 26 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 27 #include "chrome/grit/generated_resources.h" | 28 #include "chrome/grit/generated_resources.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 #include "content/public/renderer/plugin_instance_throttler.h" | 77 #include "content/public/renderer/plugin_instance_throttler.h" |
| 77 #include "content/public/renderer/render_frame.h" | 78 #include "content/public/renderer/render_frame.h" |
| 78 #include "content/public/renderer/render_thread.h" | 79 #include "content/public/renderer/render_thread.h" |
| 79 #include "content/public/renderer/render_view.h" | 80 #include "content/public/renderer/render_view.h" |
| 80 #include "content/public/renderer/render_view_visitor.h" | 81 #include "content/public/renderer/render_view_visitor.h" |
| 81 #include "extensions/common/constants.h" | 82 #include "extensions/common/constants.h" |
| 82 #include "ipc/ipc_sync_channel.h" | 83 #include "ipc/ipc_sync_channel.h" |
| 83 #include "net/base/net_errors.h" | 84 #include "net/base/net_errors.h" |
| 84 #include "ppapi/c/private/ppb_pdf.h" | 85 #include "ppapi/c/private/ppb_pdf.h" |
| 85 #include "ppapi/shared_impl/ppapi_switches.h" | 86 #include "ppapi/shared_impl/ppapi_switches.h" |
| 87 #include "printing/print_settings.h" | |
| 86 #include "third_party/WebKit/public/platform/WebURL.h" | 88 #include "third_party/WebKit/public/platform/WebURL.h" |
| 87 #include "third_party/WebKit/public/platform/WebURLError.h" | 89 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 88 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 90 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 89 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 91 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 90 #include "third_party/WebKit/public/web/WebCache.h" | 92 #include "third_party/WebKit/public/web/WebCache.h" |
| 91 #include "third_party/WebKit/public/web/WebDataSource.h" | 93 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 92 #include "third_party/WebKit/public/web/WebDocument.h" | 94 #include "third_party/WebKit/public/web/WebDocument.h" |
| 93 #include "third_party/WebKit/public/web/WebElement.h" | 95 #include "third_party/WebKit/public/web/WebElement.h" |
| 94 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 96 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 95 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 97 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 extensions::ExtensionsRendererClient::Set( | 350 extensions::ExtensionsRendererClient::Set( |
| 349 ChromeExtensionsRendererClient::GetInstance()); | 351 ChromeExtensionsRendererClient::GetInstance()); |
| 350 #endif | 352 #endif |
| 351 #if defined(ENABLE_PLUGINS) | 353 #if defined(ENABLE_PLUGINS) |
| 352 for (size_t i = 0; i < arraysize(kPredefinedAllowedCameraDeviceOrigins); ++i) | 354 for (size_t i = 0; i < arraysize(kPredefinedAllowedCameraDeviceOrigins); ++i) |
| 353 allowed_camera_device_origins_.insert( | 355 allowed_camera_device_origins_.insert( |
| 354 kPredefinedAllowedCameraDeviceOrigins[i]); | 356 kPredefinedAllowedCameraDeviceOrigins[i]); |
| 355 for (size_t i = 0; i < arraysize(kPredefinedAllowedCompositorOrigins); ++i) | 357 for (size_t i = 0; i < arraysize(kPredefinedAllowedCompositorOrigins); ++i) |
| 356 allowed_compositor_origins_.insert(kPredefinedAllowedCompositorOrigins[i]); | 358 allowed_compositor_origins_.insert(kPredefinedAllowedCompositorOrigins[i]); |
| 357 #endif | 359 #endif |
| 360 #if defined(ENABLE_PRINTING) | |
| 361 printing::SetAgent(GetUserAgent()); | |
| 362 #endif | |
| 358 } | 363 } |
| 359 | 364 |
| 360 ChromeContentRendererClient::~ChromeContentRendererClient() { | 365 ChromeContentRendererClient::~ChromeContentRendererClient() { |
| 361 } | 366 } |
| 362 | 367 |
| 363 void ChromeContentRendererClient::RenderThreadStarted() { | 368 void ChromeContentRendererClient::RenderThreadStarted() { |
| 364 RenderThread* thread = RenderThread::Get(); | 369 RenderThread* thread = RenderThread::Get(); |
| 365 | 370 |
| 366 chrome_observer_.reset(new ChromeRenderProcessObserver()); | 371 chrome_observer_.reset(new ChromeRenderProcessObserver()); |
| 367 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); | 372 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1465 // chrome.system.network.getNetworkInterfaces provides the same | 1470 // chrome.system.network.getNetworkInterfaces provides the same |
| 1466 // information. Also, the enforcement of sending and binding UDP is already done | 1471 // information. Also, the enforcement of sending and binding UDP is already done |
| 1467 // by chrome extension permission model. | 1472 // by chrome extension permission model. |
| 1468 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1473 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1469 #if defined(ENABLE_EXTENSIONS) | 1474 #if defined(ENABLE_EXTENSIONS) |
| 1470 return !IsStandaloneExtensionProcess(); | 1475 return !IsStandaloneExtensionProcess(); |
| 1471 #else | 1476 #else |
| 1472 return true; | 1477 return true; |
| 1473 #endif | 1478 #endif |
| 1474 } | 1479 } |
| OLD | NEW |