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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
94 #include "chrome/browser/ui/browser_navigator.h" | 94 #include "chrome/browser/ui/browser_navigator.h" |
95 #include "chrome/browser/ui/browser_navigator_params.h" | 95 #include "chrome/browser/ui/browser_navigator_params.h" |
96 #include "chrome/browser/ui/chrome_select_file_policy.h" | 96 #include "chrome/browser/ui/chrome_select_file_policy.h" |
97 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 97 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
98 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 98 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
99 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 99 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
100 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 100 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
101 #include "chrome/browser/usb/usb_tab_helper.h" | 101 #include "chrome/browser/usb/usb_tab_helper.h" |
102 #include "chrome/browser/webauth/authenticator_web_contents_manager.h" | |
102 #include "chrome/common/channel_info.h" | 103 #include "chrome/common/channel_info.h" |
103 #include "chrome/common/chrome_constants.h" | 104 #include "chrome/common/chrome_constants.h" |
104 #include "chrome/common/chrome_features.h" | 105 #include "chrome/common/chrome_features.h" |
105 #include "chrome/common/chrome_paths.h" | 106 #include "chrome/common/chrome_paths.h" |
106 #include "chrome/common/chrome_switches.h" | 107 #include "chrome/common/chrome_switches.h" |
107 #include "chrome/common/env_vars.h" | 108 #include "chrome/common/env_vars.h" |
108 #include "chrome/common/features.h" | 109 #include "chrome/common/features.h" |
109 #include "chrome/common/logging_chrome.h" | 110 #include "chrome/common/logging_chrome.h" |
110 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" | 111 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
111 #include "chrome/common/pepper_permission_util.h" | 112 #include "chrome/common/pepper_permission_util.h" |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
883 } | 884 } |
884 } | 885 } |
885 // The forbidden app URL was being opened by a different app or extension. | 886 // The forbidden app URL was being opened by a different app or extension. |
886 return APP_LOADED_IN_TAB_SOURCE_OTHER_EXTENSION; | 887 return APP_LOADED_IN_TAB_SOURCE_OTHER_EXTENSION; |
887 } | 888 } |
888 // The forbidden app URL was being opened by a non-extension page (e.g. http). | 889 // The forbidden app URL was being opened by a non-extension page (e.g. http). |
889 return APP_LOADED_IN_TAB_SOURCE_OTHER; | 890 return APP_LOADED_IN_TAB_SOURCE_OTHER; |
890 } | 891 } |
891 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 892 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
892 | 893 |
894 void CreateAuthenticatorForWebContents( | |
895 content::RenderFrameHost* render_frame_host, | |
896 const service_manager::BindSourceInfo& source_info, | |
897 webauth::mojom::AuthenticatorRequest request) { | |
898 content::WebContents* web_contents = | |
899 content::WebContents::FromRenderFrameHost(render_frame_host); | |
900 if (!web_contents) { | |
901 NOTREACHED(); | |
902 return; | |
903 } | |
904 AuthenticatorWebContentsManager::GetOrCreateForWebContents(web_contents) | |
905 ->CreateAuthenticator(render_frame_host, std::move(request)); | |
906 } | |
907 | |
893 void CreateUsbDeviceManager(RenderFrameHost* render_frame_host, | 908 void CreateUsbDeviceManager(RenderFrameHost* render_frame_host, |
894 const service_manager::BindSourceInfo& source_info, | 909 const service_manager::BindSourceInfo& source_info, |
895 device::mojom::UsbDeviceManagerRequest request) { | 910 device::mojom::UsbDeviceManagerRequest request) { |
896 WebContents* web_contents = | 911 WebContents* web_contents = |
897 WebContents::FromRenderFrameHost(render_frame_host); | 912 WebContents::FromRenderFrameHost(render_frame_host); |
898 if (!web_contents) { | 913 if (!web_contents) { |
899 NOTREACHED(); | 914 NOTREACHED(); |
900 return; | 915 return; |
901 } | 916 } |
902 | 917 |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1683 return; | 1698 return; |
1684 } | 1699 } |
1685 | 1700 |
1686 command_line->AppendSwitchASCII(switches::kBlinkSettings, | 1701 command_line->AppendSwitchASCII(switches::kBlinkSettings, |
1687 base::JoinString(blink_settings, ",")); | 1702 base::JoinString(blink_settings, ",")); |
1688 } | 1703 } |
1689 | 1704 |
1690 #if defined(OS_ANDROID) | 1705 #if defined(OS_ANDROID) |
1691 void ForwardInstalledAppProviderRequest( | 1706 void ForwardInstalledAppProviderRequest( |
1692 base::WeakPtr<service_manager::InterfaceProvider> interface_provider, | 1707 base::WeakPtr<service_manager::InterfaceProvider> interface_provider, |
1693 const service_manager::BindSourceInfo& source_info, | |
jochen (gone - plz use gerrit)
2017/05/30 12:03:02
why this change?
kpaulhamus
2017/05/31 20:56:05
Ah, unintentional. Rebase gone bad, perhaps.
| |
1694 blink::mojom::InstalledAppProviderRequest request) { | 1708 blink::mojom::InstalledAppProviderRequest request) { |
1695 if (!interface_provider || | 1709 if (!interface_provider || |
1696 ChromeOriginTrialPolicy().IsFeatureDisabled("InstalledApp")) { | 1710 ChromeOriginTrialPolicy().IsFeatureDisabled("InstalledApp")) { |
1697 return; | 1711 return; |
1698 } | 1712 } |
1699 interface_provider->GetInterface(std::move(request)); | 1713 interface_provider->GetInterface(std::move(request)); |
1700 } | 1714 } |
1701 | 1715 |
1702 void ForwardShareServiceRequest( | 1716 void ForwardShareServiceRequest( |
1703 base::WeakPtr<service_manager::InterfaceProvider> interface_provider, | 1717 base::WeakPtr<service_manager::InterfaceProvider> interface_provider, |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3189 if (base::FeatureList::IsEnabled(features::kWebPayments)) { | 3203 if (base::FeatureList::IsEnabled(features::kWebPayments)) { |
3190 content::WebContents* web_contents = | 3204 content::WebContents* web_contents = |
3191 content::WebContents::FromRenderFrameHost(render_frame_host); | 3205 content::WebContents::FromRenderFrameHost(render_frame_host); |
3192 if (web_contents) { | 3206 if (web_contents) { |
3193 registry->AddInterface(base::Bind(payments::CreatePaymentRequest, | 3207 registry->AddInterface(base::Bind(payments::CreatePaymentRequest, |
3194 render_frame_host, web_contents)); | 3208 render_frame_host, web_contents)); |
3195 } | 3209 } |
3196 } | 3210 } |
3197 #endif | 3211 #endif |
3198 | 3212 |
3213 if (base::FeatureList::IsEnabled(features::kWebAuth)) { | |
3214 registry->AddInterface( | |
3215 base::Bind(&CreateAuthenticatorForWebContents, render_frame_host)); | |
3216 } | |
3217 | |
3199 #if defined(OS_LINUX) || defined(OS_WIN) | 3218 #if defined(OS_LINUX) || defined(OS_WIN) |
3200 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { | 3219 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { |
3201 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); | 3220 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); |
3202 } | 3221 } |
3203 #endif | 3222 #endif |
3204 } | 3223 } |
3205 | 3224 |
3206 void ChromeContentBrowserClient::BindInterfaceRequest( | 3225 void ChromeContentBrowserClient::BindInterfaceRequest( |
3207 const service_manager::BindSourceInfo& source_info, | 3226 const service_manager::BindSourceInfo& source_info, |
3208 const std::string& interface_name, | 3227 const std::string& interface_name, |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3576 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3595 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3577 return variations::GetVariationParamValue( | 3596 return variations::GetVariationParamValue( |
3578 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3597 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3579 } | 3598 } |
3580 | 3599 |
3581 // static | 3600 // static |
3582 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3601 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3583 const storage::QuotaSettings* settings) { | 3602 const storage::QuotaSettings* settings) { |
3584 g_default_quota_settings = settings; | 3603 g_default_quota_settings = settings; |
3585 } | 3604 } |
OLD | NEW |