Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2174613002: Geolocation: move creation of the GeolocationDelegate to the embedders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 30 matching lines...) Expand all
41 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" 41 #include "chrome/browser/chrome_net_benchmarking_message_filter.h"
42 #include "chrome/browser/chrome_quota_permission_context.h" 42 #include "chrome/browser/chrome_quota_permission_context.h"
43 #include "chrome/browser/content_settings/cookie_settings_factory.h" 43 #include "chrome/browser/content_settings/cookie_settings_factory.h"
44 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 44 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
45 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 45 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
46 #include "chrome/browser/defaults.h" 46 #include "chrome/browser/defaults.h"
47 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" 47 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
48 #include "chrome/browser/download/download_prefs.h" 48 #include "chrome/browser/download/download_prefs.h"
49 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" 49 #include "chrome/browser/engagement/site_engagement_eviction_policy.h"
50 #include "chrome/browser/font_family_cache.h" 50 #include "chrome/browser/font_family_cache.h"
51 #include "chrome/browser/geolocation/chrome_access_token_store.h"
52 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 51 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
53 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" 52 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
54 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 53 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
55 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 54 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
56 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" 55 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
57 #include "chrome/browser/notifications/platform_notification_service_impl.h" 56 #include "chrome/browser/notifications/platform_notification_service_impl.h"
58 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 57 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
59 #include "chrome/browser/permissions/permission_context_base.h" 58 #include "chrome/browser/permissions/permission_context_base.h"
60 #include "chrome/browser/platform_util.h" 59 #include "chrome/browser/platform_util.h"
61 #include "chrome/browser/prerender/prerender_final_status.h" 60 #include "chrome/browser/prerender/prerender_final_status.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 #include "components/variations/variations_associated_data.h" 138 #include "components/variations/variations_associated_data.h"
140 #include "components/version_info/version_info.h" 139 #include "components/version_info/version_info.h"
141 #include "content/public/browser/browser_child_process_host.h" 140 #include "content/public/browser/browser_child_process_host.h"
142 #include "content/public/browser/browser_main_parts.h" 141 #include "content/public/browser/browser_main_parts.h"
143 #include "content/public/browser/browser_ppapi_host.h" 142 #include "content/public/browser/browser_ppapi_host.h"
144 #include "content/public/browser/browser_thread.h" 143 #include "content/public/browser/browser_thread.h"
145 #include "content/public/browser/browser_url_handler.h" 144 #include "content/public/browser/browser_url_handler.h"
146 #include "content/public/browser/child_process_data.h" 145 #include "content/public/browser/child_process_data.h"
147 #include "content/public/browser/child_process_security_policy.h" 146 #include "content/public/browser/child_process_security_policy.h"
148 #include "content/public/browser/client_certificate_delegate.h" 147 #include "content/public/browser/client_certificate_delegate.h"
149 #include "content/public/browser/geolocation_delegate.h"
150 #include "content/public/browser/navigation_handle.h" 148 #include "content/public/browser/navigation_handle.h"
151 #include "content/public/browser/navigation_throttle.h" 149 #include "content/public/browser/navigation_throttle.h"
152 #include "content/public/browser/render_frame_host.h" 150 #include "content/public/browser/render_frame_host.h"
153 #include "content/public/browser/render_process_host.h" 151 #include "content/public/browser/render_process_host.h"
154 #include "content/public/browser/render_view_host.h" 152 #include "content/public/browser/render_view_host.h"
155 #include "content/public/browser/resource_context.h" 153 #include "content/public/browser/resource_context.h"
156 #include "content/public/browser/site_instance.h" 154 #include "content/public/browser/site_instance.h"
157 #include "content/public/browser/storage_partition.h" 155 #include "content/public/browser/storage_partition.h"
158 #include "content/public/browser/vpn_service_proxy.h" 156 #include "content/public/browser/vpn_service_proxy.h"
159 #include "content/public/browser/web_contents.h" 157 #include "content/public/browser/web_contents.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 324 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
327 #include "media/mojo/services/mojo_media_application_factory.h" // nogncheck 325 #include "media/mojo/services/mojo_media_application_factory.h" // nogncheck
328 #endif 326 #endif
329 327
330 #if defined(OS_CHROMEOS) 328 #if defined(OS_CHROMEOS)
331 #include "chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h " 329 #include "chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h "
332 #endif 330 #endif
333 331
334 using base::FileDescriptor; 332 using base::FileDescriptor;
335 using blink::WebWindowFeatures; 333 using blink::WebWindowFeatures;
336 using content::AccessTokenStore;
337 using content::BrowserThread; 334 using content::BrowserThread;
338 using content::BrowserURLHandler; 335 using content::BrowserURLHandler;
339 using content::ChildProcessSecurityPolicy; 336 using content::ChildProcessSecurityPolicy;
340 using content::QuotaPermissionContext; 337 using content::QuotaPermissionContext;
341 using content::RenderFrameHost; 338 using content::RenderFrameHost;
342 using content::RenderViewHost; 339 using content::RenderViewHost;
343 using content::ResourceType; 340 using content::ResourceType;
344 using content::SiteInstance; 341 using content::SiteInstance;
345 using content::WebContents; 342 using content::WebContents;
346 using content::WebPreferences; 343 using content::WebPreferences;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 safe_browsing_ui_manager_->ReportInvalidCertificateChain( 629 safe_browsing_ui_manager_->ReportInvalidCertificateChain(
633 serialized_report, base::Bind(&base::DoNothing)); 630 serialized_report, base::Bind(&base::DoNothing));
634 } 631 }
635 } 632 }
636 633
637 private: 634 private:
638 const scoped_refptr<safe_browsing::SafeBrowsingUIManager> 635 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>
639 safe_browsing_ui_manager_; 636 safe_browsing_ui_manager_;
640 }; 637 };
641 638
642 // A provider of Geolocation services to override AccessTokenStore.
643 class ChromeGeolocationDelegate : public content::GeolocationDelegate {
644 public:
645 ChromeGeolocationDelegate() = default;
646
647 scoped_refptr<AccessTokenStore> CreateAccessTokenStore() final {
648 return new ChromeAccessTokenStore();
649 }
650
651 private:
652 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationDelegate);
653 };
654
655 #if BUILDFLAG(ANDROID_JAVA_UI) 639 #if BUILDFLAG(ANDROID_JAVA_UI)
656 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { 640 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) {
657 WebContents* web_contents = tab_util::GetWebContentsByFrameID( 641 WebContents* web_contents = tab_util::GetWebContentsByFrameID(
658 params.render_process_id(), params.opener_render_frame_id()); 642 params.render_process_id(), params.opener_render_frame_id());
659 if (!web_contents) 643 if (!web_contents)
660 return; 644 return;
661 645
662 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params); 646 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params);
663 } 647 }
664 #endif // BUILDFLAG(ANDROID_JAVA_UI) 648 #endif // BUILDFLAG(ANDROID_JAVA_UI)
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 2290
2307 content::SpeechRecognitionManagerDelegate* 2291 content::SpeechRecognitionManagerDelegate*
2308 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { 2292 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
2309 return new speech::ChromeSpeechRecognitionManagerDelegate(); 2293 return new speech::ChromeSpeechRecognitionManagerDelegate();
2310 } 2294 }
2311 2295
2312 net::NetLog* ChromeContentBrowserClient::GetNetLog() { 2296 net::NetLog* ChromeContentBrowserClient::GetNetLog() {
2313 return g_browser_process->net_log(); 2297 return g_browser_process->net_log();
2314 } 2298 }
2315 2299
2316 content::GeolocationDelegate*
2317 ChromeContentBrowserClient::CreateGeolocationDelegate() {
2318 return new ChromeGeolocationDelegate();
2319 }
2320
2321 bool ChromeContentBrowserClient::IsFastShutdownPossible() { 2300 bool ChromeContentBrowserClient::IsFastShutdownPossible() {
2322 return true; 2301 return true;
2323 } 2302 }
2324 2303
2325 void ChromeContentBrowserClient::OverrideWebkitPrefs( 2304 void ChromeContentBrowserClient::OverrideWebkitPrefs(
2326 RenderViewHost* rvh, WebPreferences* web_prefs) { 2305 RenderViewHost* rvh, WebPreferences* web_prefs) {
2327 Profile* profile = Profile::FromBrowserContext( 2306 Profile* profile = Profile::FromBrowserContext(
2328 rvh->GetProcess()->GetBrowserContext()); 2307 rvh->GetProcess()->GetBrowserContext());
2329 PrefService* prefs = profile->GetPrefs(); 2308 PrefService* prefs = profile->GetPrefs();
2330 2309
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
3083 if (channel <= kMaxDisableEncryptionChannel) { 3062 if (channel <= kMaxDisableEncryptionChannel) {
3084 static const char* const kWebRtcDevSwitchNames[] = { 3063 static const char* const kWebRtcDevSwitchNames[] = {
3085 switches::kDisableWebRtcEncryption, 3064 switches::kDisableWebRtcEncryption,
3086 }; 3065 };
3087 to_command_line->CopySwitchesFrom(from_command_line, 3066 to_command_line->CopySwitchesFrom(from_command_line,
3088 kWebRtcDevSwitchNames, 3067 kWebRtcDevSwitchNames,
3089 arraysize(kWebRtcDevSwitchNames)); 3068 arraysize(kWebRtcDevSwitchNames));
3090 } 3069 }
3091 } 3070 }
3092 #endif // defined(ENABLE_WEBRTC) 3071 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chromecast/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698