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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 90 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
91 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 91 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
92 #include "chrome/browser/ui/browser_navigator.h" | 92 #include "chrome/browser/ui/browser_navigator.h" |
93 #include "chrome/browser/ui/browser_navigator_params.h" | 93 #include "chrome/browser/ui/browser_navigator_params.h" |
94 #include "chrome/browser/ui/chrome_select_file_policy.h" | 94 #include "chrome/browser/ui/chrome_select_file_policy.h" |
95 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 95 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
96 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 96 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
97 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 97 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
98 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 98 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
99 #include "chrome/browser/usb/usb_tab_helper.h" | 99 #include "chrome/browser/usb/usb_tab_helper.h" |
| 100 #include "chrome/browser/webauth/authenticator_web_contents_manager.h" |
100 #include "chrome/common/channel_info.h" | 101 #include "chrome/common/channel_info.h" |
101 #include "chrome/common/chrome_constants.h" | 102 #include "chrome/common/chrome_constants.h" |
102 #include "chrome/common/chrome_features.h" | 103 #include "chrome/common/chrome_features.h" |
103 #include "chrome/common/chrome_paths.h" | 104 #include "chrome/common/chrome_paths.h" |
104 #include "chrome/common/chrome_switches.h" | 105 #include "chrome/common/chrome_switches.h" |
105 #include "chrome/common/env_vars.h" | 106 #include "chrome/common/env_vars.h" |
106 #include "chrome/common/features.h" | 107 #include "chrome/common/features.h" |
107 #include "chrome/common/logging_chrome.h" | 108 #include "chrome/common/logging_chrome.h" |
108 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" | 109 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
109 #include "chrome/common/pepper_permission_util.h" | 110 #include "chrome/common/pepper_permission_util.h" |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 incognito)); | 886 incognito)); |
886 rules->autoplay_rules.push_back( | 887 rules->autoplay_rules.push_back( |
887 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), | 888 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), |
888 ContentSettingsPattern::Wildcard(), | 889 ContentSettingsPattern::Wildcard(), |
889 CONTENT_SETTING_ALLOW, | 890 CONTENT_SETTING_ALLOW, |
890 std::string(), | 891 std::string(), |
891 incognito)); | 892 incognito)); |
892 } | 893 } |
893 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 894 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
894 | 895 |
| 896 void CreateAuthenticatorForWebContents( |
| 897 content::RenderFrameHost* render_frame_host, |
| 898 mojo::InterfaceRequest<webauth::mojom::Authenticator> request) { |
| 899 content::WebContents* web_contents = |
| 900 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 901 if (!web_contents) { |
| 902 NOTREACHED(); |
| 903 return; |
| 904 } |
| 905 AuthenticatorWebContentsManager::GetOrCreateForWebContents(web_contents) |
| 906 ->CreateAuthenticator(render_frame_host, std::move(request)); |
| 907 } |
| 908 |
895 void CreateUsbDeviceManager( | 909 void CreateUsbDeviceManager( |
896 RenderFrameHost* render_frame_host, | 910 RenderFrameHost* render_frame_host, |
897 mojo::InterfaceRequest<device::usb::DeviceManager> request) { | 911 mojo::InterfaceRequest<device::usb::DeviceManager> request) { |
898 WebContents* web_contents = | 912 WebContents* web_contents = |
899 WebContents::FromRenderFrameHost(render_frame_host); | 913 WebContents::FromRenderFrameHost(render_frame_host); |
900 if (!web_contents) { | 914 if (!web_contents) { |
901 NOTREACHED(); | 915 NOTREACHED(); |
902 return; | 916 return; |
903 } | 917 } |
904 | 918 |
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3212 base::FeatureList::IsEnabled(features::kWebPayments)) { | 3226 base::FeatureList::IsEnabled(features::kWebPayments)) { |
3213 content::WebContents* web_contents = | 3227 content::WebContents* web_contents = |
3214 content::WebContents::FromRenderFrameHost(render_frame_host); | 3228 content::WebContents::FromRenderFrameHost(render_frame_host); |
3215 if (web_contents) { | 3229 if (web_contents) { |
3216 registry->AddInterface(base::Bind( | 3230 registry->AddInterface(base::Bind( |
3217 payments::CreatePaymentRequestForWebContents, web_contents)); | 3231 payments::CreatePaymentRequestForWebContents, web_contents)); |
3218 } | 3232 } |
3219 } | 3233 } |
3220 #endif | 3234 #endif |
3221 | 3235 |
| 3236 if (AreExperimentalWebPlatformFeaturesEnabled() && |
| 3237 base::FeatureList::IsEnabled(features::kWebAuth)) { |
| 3238 registry->AddInterface( |
| 3239 base::Bind(&CreateAuthenticatorForWebContents, render_frame_host)); |
| 3240 } |
| 3241 |
3222 #if defined(OS_LINUX) || defined(OS_WIN) | 3242 #if defined(OS_LINUX) || defined(OS_WIN) |
3223 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { | 3243 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { |
3224 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); | 3244 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); |
3225 } | 3245 } |
3226 #endif | 3246 #endif |
3227 } | 3247 } |
3228 | 3248 |
3229 void ChromeContentBrowserClient::BindInterfaceRequest( | 3249 void ChromeContentBrowserClient::BindInterfaceRequest( |
3230 const service_manager::ServiceInfo& source_info, | 3250 const service_manager::ServiceInfo& source_info, |
3231 const std::string& interface_name, | 3251 const std::string& interface_name, |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3639 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3620 return variations::GetVariationParamValue( | 3640 return variations::GetVariationParamValue( |
3621 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3641 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3622 } | 3642 } |
3623 | 3643 |
3624 // static | 3644 // static |
3625 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3645 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3626 const storage::QuotaSettings* settings) { | 3646 const storage::QuotaSettings* settings) { |
3627 g_default_quota_settings = settings; | 3647 g_default_quota_settings = settings; |
3628 } | 3648 } |
OLD | NEW |