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; | |
Mike West
2017/06/13 21:11:22
Why `NOTREACHED()` here rather than `DCHECK(web_co
kpaulhamus
2017/06/15 01:27:13
Updated.
| |
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 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3189 if (base::FeatureList::IsEnabled(features::kWebPayments)) { | 3204 if (base::FeatureList::IsEnabled(features::kWebPayments)) { |
3190 content::WebContents* web_contents = | 3205 content::WebContents* web_contents = |
3191 content::WebContents::FromRenderFrameHost(render_frame_host); | 3206 content::WebContents::FromRenderFrameHost(render_frame_host); |
3192 if (web_contents) { | 3207 if (web_contents) { |
3193 registry->AddInterface(base::Bind(payments::CreatePaymentRequest, | 3208 registry->AddInterface(base::Bind(payments::CreatePaymentRequest, |
3194 render_frame_host, web_contents)); | 3209 render_frame_host, web_contents)); |
3195 } | 3210 } |
3196 } | 3211 } |
3197 #endif | 3212 #endif |
3198 | 3213 |
3214 if (base::FeatureList::IsEnabled(features::kWebAuth)) { | |
3215 registry->AddInterface( | |
3216 base::Bind(&CreateAuthenticatorForWebContents, render_frame_host)); | |
3217 } | |
3218 | |
3199 #if defined(OS_LINUX) || defined(OS_WIN) | 3219 #if defined(OS_LINUX) || defined(OS_WIN) |
3200 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { | 3220 if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { |
3201 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); | 3221 registry->AddInterface(base::Bind(&ShareServiceImpl::Create)); |
3202 } | 3222 } |
3203 #endif | 3223 #endif |
3204 } | 3224 } |
3205 | 3225 |
3206 void ChromeContentBrowserClient::BindInterfaceRequest( | 3226 void ChromeContentBrowserClient::BindInterfaceRequest( |
3207 const service_manager::BindSourceInfo& source_info, | 3227 const service_manager::BindSourceInfo& source_info, |
3208 const std::string& interface_name, | 3228 const std::string& interface_name, |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3576 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3596 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3577 return variations::GetVariationParamValue( | 3597 return variations::GetVariationParamValue( |
3578 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3598 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3579 } | 3599 } |
3580 | 3600 |
3581 // static | 3601 // static |
3582 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3602 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3583 const storage::QuotaSettings* settings) { | 3603 const storage::QuotaSettings* settings) { |
3584 g_default_quota_settings = settings; | 3604 g_default_quota_settings = settings; |
3585 } | 3605 } |
OLD | NEW |