| 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/webui/chrome_web_ui_controller_factory.h" | 94 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 95 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 95 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 96 #include "chrome/browser/usb/usb_tab_helper.h" | 96 #include "chrome/browser/usb/usb_tab_helper.h" |
| 97 #include "chrome/common/channel_info.h" | 97 #include "chrome/common/channel_info.h" |
| 98 #include "chrome/common/chrome_constants.h" | 98 #include "chrome/common/chrome_constants.h" |
| 99 #include "chrome/common/chrome_paths.h" | 99 #include "chrome/common/chrome_paths.h" |
| 100 #include "chrome/common/chrome_switches.h" | 100 #include "chrome/common/chrome_switches.h" |
| 101 #include "chrome/common/env_vars.h" | 101 #include "chrome/common/env_vars.h" |
| 102 #include "chrome/common/features.h" | 102 #include "chrome/common/features.h" |
| 103 #include "chrome/common/logging_chrome.h" | 103 #include "chrome/common/logging_chrome.h" |
| 104 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
| 104 #include "chrome/common/pepper_permission_util.h" | 105 #include "chrome/common/pepper_permission_util.h" |
| 105 #include "chrome/common/pref_names.h" | 106 #include "chrome/common/pref_names.h" |
| 106 #include "chrome/common/render_messages.h" | 107 #include "chrome/common/render_messages.h" |
| 107 #include "chrome/common/secure_origin_whitelist.h" | 108 #include "chrome/common/secure_origin_whitelist.h" |
| 108 #include "chrome/common/url_constants.h" | 109 #include "chrome/common/url_constants.h" |
| 109 #include "chrome/grit/generated_resources.h" | 110 #include "chrome/grit/generated_resources.h" |
| 110 #include "chrome/installer/util/google_update_settings.h" | 111 #include "chrome/installer/util/google_update_settings.h" |
| 111 #include "chromeos/chromeos_constants.h" | 112 #include "chromeos/chromeos_constants.h" |
| 112 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 113 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
| 113 #include "components/autofill/core/common/autofill_switches.h" | 114 #include "components/autofill/core/common/autofill_switches.h" |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 // this point. | 1403 // this point. |
| 1403 LOG(WARNING) << "Received field trial params, " | 1404 LOG(WARNING) << "Received field trial params, " |
| 1404 "but blink-settings switch already specified."; | 1405 "but blink-settings switch already specified."; |
| 1405 return; | 1406 return; |
| 1406 } | 1407 } |
| 1407 | 1408 |
| 1408 command_line->AppendSwitchASCII(switches::kBlinkSettings, | 1409 command_line->AppendSwitchASCII(switches::kBlinkSettings, |
| 1409 base::JoinString(blink_settings, ",")); | 1410 base::JoinString(blink_settings, ",")); |
| 1410 } | 1411 } |
| 1411 | 1412 |
| 1413 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 1414 void ForwardShareServiceRequest( |
| 1415 base::WeakPtr<shell::InterfaceProvider> interface_provider, |
| 1416 blink::mojom::ShareServiceRequest request) { |
| 1417 if (!interface_provider || |
| 1418 ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { |
| 1419 return; |
| 1420 } |
| 1421 |
| 1422 interface_provider->GetInterface(std::move(request)); |
| 1423 } |
| 1424 #endif |
| 1425 |
| 1412 } // namespace | 1426 } // namespace |
| 1413 | 1427 |
| 1414 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( | 1428 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| 1415 base::CommandLine* command_line, | 1429 base::CommandLine* command_line, |
| 1416 int child_process_id) { | 1430 int child_process_id) { |
| 1417 #if defined(OS_MACOSX) | 1431 #if defined(OS_MACOSX) |
| 1418 std::unique_ptr<metrics::ClientInfo> client_info = | 1432 std::unique_ptr<metrics::ClientInfo> client_info = |
| 1419 GoogleUpdateSettings::LoadMetricsClientInfo(); | 1433 GoogleUpdateSettings::LoadMetricsClientInfo(); |
| 1420 if (client_info) { | 1434 if (client_info) { |
| 1421 command_line->AppendSwitchASCII(switches::kMetricsClientID, | 1435 command_line->AppendSwitchASCII(switches::kMetricsClientID, |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2835 render_frame_host)); | 2849 render_frame_host)); |
| 2836 | 2850 |
| 2837 #if BUILDFLAG(ANDROID_JAVA_UI) | 2851 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 2838 content::WebContents* web_contents = | 2852 content::WebContents* web_contents = |
| 2839 content::WebContents::FromRenderFrameHost(render_frame_host); | 2853 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2840 if (web_contents) { | 2854 if (web_contents) { |
| 2841 registry->AddInterface( | 2855 registry->AddInterface( |
| 2842 web_contents->GetJavaInterfaces() | 2856 web_contents->GetJavaInterfaces() |
| 2843 ->GetInterfaceFactory<blink::mojom::PaymentRequest>()); | 2857 ->GetInterfaceFactory<blink::mojom::PaymentRequest>()); |
| 2844 registry->AddInterface( | 2858 registry->AddInterface( |
| 2845 web_contents->GetJavaInterfaces() | 2859 base::Bind(&ForwardShareServiceRequest, |
| 2846 ->GetInterfaceFactory<blink::mojom::ShareService>()); | 2860 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 2847 } | 2861 } |
| 2848 #endif | 2862 #endif |
| 2849 } | 2863 } |
| 2850 | 2864 |
| 2851 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 2865 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
| 2852 shell::InterfaceRegistry* registry, | 2866 shell::InterfaceRegistry* registry, |
| 2853 content::GpuProcessHost* render_process_host) { | 2867 content::GpuProcessHost* render_process_host) { |
| 2854 } | 2868 } |
| 2855 | 2869 |
| 2856 void ChromeContentBrowserClient::RegisterInProcessMojoApplications( | 2870 void ChromeContentBrowserClient::RegisterInProcessMojoApplications( |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 if (channel <= kMaxDisableEncryptionChannel) { | 3082 if (channel <= kMaxDisableEncryptionChannel) { |
| 3069 static const char* const kWebRtcDevSwitchNames[] = { | 3083 static const char* const kWebRtcDevSwitchNames[] = { |
| 3070 switches::kDisableWebRtcEncryption, | 3084 switches::kDisableWebRtcEncryption, |
| 3071 }; | 3085 }; |
| 3072 to_command_line->CopySwitchesFrom(from_command_line, | 3086 to_command_line->CopySwitchesFrom(from_command_line, |
| 3073 kWebRtcDevSwitchNames, | 3087 kWebRtcDevSwitchNames, |
| 3074 arraysize(kWebRtcDevSwitchNames)); | 3088 arraysize(kWebRtcDevSwitchNames)); |
| 3075 } | 3089 } |
| 3076 } | 3090 } |
| 3077 #endif // defined(ENABLE_WEBRTC) | 3091 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |