| 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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "chrome/browser/ui/browser_navigator_params.h" | 94 #include "chrome/browser/ui/browser_navigator_params.h" |
| 95 #include "chrome/browser/ui/chrome_select_file_policy.h" | 95 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 96 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 96 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 97 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 97 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| 98 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 98 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 99 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 99 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 100 #include "chrome/browser/usb/usb_tab_helper.h" | 100 #include "chrome/browser/usb/usb_tab_helper.h" |
| 101 #include "chrome/browser/webshare/share_service_impl.h" | 101 #include "chrome/browser/webshare/share_service_impl.h" |
| 102 #include "chrome/common/channel_info.h" | 102 #include "chrome/common/channel_info.h" |
| 103 #include "chrome/common/chrome_constants.h" | 103 #include "chrome/common/chrome_constants.h" |
| 104 #include "chrome/common/chrome_features.h" |
| 104 #include "chrome/common/chrome_paths.h" | 105 #include "chrome/common/chrome_paths.h" |
| 105 #include "chrome/common/chrome_switches.h" | 106 #include "chrome/common/chrome_switches.h" |
| 106 #include "chrome/common/env_vars.h" | 107 #include "chrome/common/env_vars.h" |
| 107 #include "chrome/common/features.h" | 108 #include "chrome/common/features.h" |
| 108 #include "chrome/common/logging_chrome.h" | 109 #include "chrome/common/logging_chrome.h" |
| 109 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" | 110 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
| 110 #include "chrome/common/pepper_permission_util.h" | 111 #include "chrome/common/pepper_permission_util.h" |
| 111 #include "chrome/common/pref_names.h" | 112 #include "chrome/common/pref_names.h" |
| 112 #include "chrome/common/render_messages.h" | 113 #include "chrome/common/render_messages.h" |
| 113 #include "chrome/common/renderer_configuration.mojom.h" | 114 #include "chrome/common/renderer_configuration.mojom.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" | 208 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" |
| 208 #include "ui/base/l10n/l10n_util.h" | 209 #include "ui/base/l10n/l10n_util.h" |
| 209 #include "ui/base/resource/resource_bundle.h" | 210 #include "ui/base/resource/resource_bundle.h" |
| 210 #include "ui/resources/grit/ui_resources.h" | 211 #include "ui/resources/grit/ui_resources.h" |
| 211 #include "url/gurl.h" | 212 #include "url/gurl.h" |
| 212 #include "url/origin.h" | 213 #include "url/origin.h" |
| 213 | 214 |
| 214 #if defined(OS_WIN) | 215 #if defined(OS_WIN) |
| 215 #include "base/strings/string_tokenizer.h" | 216 #include "base/strings/string_tokenizer.h" |
| 216 #include "chrome/browser/chrome_browser_main_win.h" | 217 #include "chrome/browser/chrome_browser_main_win.h" |
| 218 #include "chrome/browser/conflicts/module_database_win.h" |
| 219 #include "chrome/browser/conflicts/module_event_sink_impl_win.h" |
| 217 #include "sandbox/win/src/sandbox_policy.h" | 220 #include "sandbox/win/src/sandbox_policy.h" |
| 218 #elif defined(OS_MACOSX) | 221 #elif defined(OS_MACOSX) |
| 219 #include "chrome/browser/chrome_browser_main_mac.h" | 222 #include "chrome/browser/chrome_browser_main_mac.h" |
| 220 #elif defined(OS_CHROMEOS) | 223 #elif defined(OS_CHROMEOS) |
| 221 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 224 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 222 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_backend_de
legate.h" | 225 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_backend_de
legate.h" |
| 223 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_backend_del
egate.h" | 226 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_backend_del
egate.h" |
| 224 #include "chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h" | 227 #include "chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h" |
| 225 #include "chrome/browser/chromeos/attestation/platform_verification_impl.h" | 228 #include "chrome/browser/chromeos/attestation/platform_verification_impl.h" |
| 226 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 229 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| (...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2918 g_browser_process->rappor_service()), | 2921 g_browser_process->rappor_service()), |
| 2919 ui_task_runner); | 2922 ui_task_runner); |
| 2920 if (NetBenchmarking::CheckBenchmarkingEnabled()) { | 2923 if (NetBenchmarking::CheckBenchmarkingEnabled()) { |
| 2921 Profile* profile = | 2924 Profile* profile = |
| 2922 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); | 2925 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); |
| 2923 net::URLRequestContextGetter* context = | 2926 net::URLRequestContextGetter* context = |
| 2924 render_process_host->GetStoragePartition()->GetURLRequestContext(); | 2927 render_process_host->GetStoragePartition()->GetURLRequestContext(); |
| 2925 registry->AddInterface( | 2928 registry->AddInterface( |
| 2926 base::Bind(&NetBenchmarking::Create, profile, context)); | 2929 base::Bind(&NetBenchmarking::Create, profile, context)); |
| 2927 } | 2930 } |
| 2931 #if defined(OS_WIN) |
| 2932 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { |
| 2933 // Add the ModuleDatabase interface. This is the interface used by renderer |
| 2934 // processes to notify the browser of modules in their address space. It |
| 2935 // ultimately drives the chrome://conflicts UI. The process handle is not |
| 2936 // yet available at this point so pass in a callback to allow it to be |
| 2937 // retrieved at the time the interface is actually created. It is safe to |
| 2938 // pass a raw pointer to |render_process_host|: the callback will be invoked |
| 2939 // in the context of ModuleDatabase::GetInstance, which is invoked by Mojo |
| 2940 // initialization, which occurs while the |render_process_host| is alive. |
| 2941 auto get_process = base::Bind(&content::RenderProcessHost::GetHandle, |
| 2942 base::Unretained(render_process_host)); |
| 2943 // The ModuleDatabase is a global singleton so passing an unretained pointer |
| 2944 // is safe. |
| 2945 registry->AddInterface( |
| 2946 base::Bind(&ModuleEventSinkImpl::Create, std::move(get_process), |
| 2947 content::PROCESS_TYPE_RENDERER, |
| 2948 base::Unretained(ModuleDatabase::GetInstance())), |
| 2949 ui_task_runner); |
| 2950 } |
| 2951 #endif |
| 2952 |
| 2928 #if defined(OS_CHROMEOS) | 2953 #if defined(OS_CHROMEOS) |
| 2929 registry->AddInterface<metrics::mojom::LeakDetector>( | 2954 registry->AddInterface<metrics::mojom::LeakDetector>( |
| 2930 base::Bind(&metrics::LeakDetectorRemoteController::Create), | 2955 base::Bind(&metrics::LeakDetectorRemoteController::Create), |
| 2931 ui_task_runner); | 2956 ui_task_runner); |
| 2932 #endif | 2957 #endif |
| 2933 } | 2958 } |
| 2934 | 2959 |
| 2935 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( | 2960 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( |
| 2936 service_manager::InterfaceRegistry* registry, | 2961 service_manager::InterfaceRegistry* registry, |
| 2937 content::RenderFrameHost* render_frame_host) { | 2962 content::RenderFrameHost* render_frame_host) { |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3367 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3392 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
| 3368 return variations::GetVariationParamValue( | 3393 return variations::GetVariationParamValue( |
| 3369 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3394 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
| 3370 } | 3395 } |
| 3371 | 3396 |
| 3372 bool ChromeContentBrowserClient:: | 3397 bool ChromeContentBrowserClient:: |
| 3373 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3398 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3374 return variations::GetVariationParamValue( | 3399 return variations::GetVariationParamValue( |
| 3375 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3400 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3376 } | 3401 } |
| OLD | NEW |