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

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

Issue 2098553002: Geolocation: extract ContentBrowserClient methods specific to Geolocation into a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a TODO 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 safe_browsing_ui_manager_->ReportInvalidCertificateChain( 620 safe_browsing_ui_manager_->ReportInvalidCertificateChain(
621 serialized_report, base::Bind(&base::DoNothing)); 621 serialized_report, base::Bind(&base::DoNothing));
622 } 622 }
623 } 623 }
624 624
625 private: 625 private:
626 const scoped_refptr<safe_browsing::SafeBrowsingUIManager> 626 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>
627 safe_browsing_ui_manager_; 627 safe_browsing_ui_manager_;
628 }; 628 };
629 629
630 // A provider of Geolocation services to override AccessTokenStore.
631 class ChromeGeolocationDelegate
632 : public content::GeolocationProvider::Delegate {
633 public:
634 ChromeGeolocationDelegate() = default;
635
636 AccessTokenStore* CreateAccessTokenStore() final {
637 return new ChromeAccessTokenStore();
638 }
639
640 private:
641 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationDelegate);
642 };
643
630 #if BUILDFLAG(ANDROID_JAVA_UI) 644 #if BUILDFLAG(ANDROID_JAVA_UI)
631 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { 645 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) {
632 WebContents* web_contents = tab_util::GetWebContentsByFrameID( 646 WebContents* web_contents = tab_util::GetWebContentsByFrameID(
633 params.render_process_id(), params.opener_render_frame_id()); 647 params.render_process_id(), params.opener_render_frame_id());
634 if (!web_contents) 648 if (!web_contents)
635 return; 649 return;
636 650
637 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params); 651 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params);
638 } 652 }
639 #endif // BUILDFLAG(ANDROID_JAVA_UI) 653 #endif // BUILDFLAG(ANDROID_JAVA_UI)
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 2252
2239 content::SpeechRecognitionManagerDelegate* 2253 content::SpeechRecognitionManagerDelegate*
2240 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { 2254 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
2241 return new speech::ChromeSpeechRecognitionManagerDelegate(); 2255 return new speech::ChromeSpeechRecognitionManagerDelegate();
2242 } 2256 }
2243 2257
2244 net::NetLog* ChromeContentBrowserClient::GetNetLog() { 2258 net::NetLog* ChromeContentBrowserClient::GetNetLog() {
2245 return g_browser_process->net_log(); 2259 return g_browser_process->net_log();
2246 } 2260 }
2247 2261
2248 AccessTokenStore* ChromeContentBrowserClient::CreateAccessTokenStore() { 2262 content::GeolocationProvider::Delegate*
2249 return new ChromeAccessTokenStore(); 2263 ChromeContentBrowserClient::CreateGeolocationDelegate() {
2264 return new ChromeGeolocationDelegate();
2250 } 2265 }
2251 2266
2252 bool ChromeContentBrowserClient::IsFastShutdownPossible() { 2267 bool ChromeContentBrowserClient::IsFastShutdownPossible() {
2253 return true; 2268 return true;
2254 } 2269 }
2255 2270
2256 void ChromeContentBrowserClient::OverrideWebkitPrefs( 2271 void ChromeContentBrowserClient::OverrideWebkitPrefs(
2257 RenderViewHost* rvh, WebPreferences* web_prefs) { 2272 RenderViewHost* rvh, WebPreferences* web_prefs) {
2258 Profile* profile = Profile::FromBrowserContext( 2273 Profile* profile = Profile::FromBrowserContext(
2259 rvh->GetProcess()->GetBrowserContext()); 2274 rvh->GetProcess()->GetBrowserContext());
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 if (channel <= kMaxDisableEncryptionChannel) { 2984 if (channel <= kMaxDisableEncryptionChannel) {
2970 static const char* const kWebRtcDevSwitchNames[] = { 2985 static const char* const kWebRtcDevSwitchNames[] = {
2971 switches::kDisableWebRtcEncryption, 2986 switches::kDisableWebRtcEncryption,
2972 }; 2987 };
2973 to_command_line->CopySwitchesFrom(from_command_line, 2988 to_command_line->CopySwitchesFrom(from_command_line,
2974 kWebRtcDevSwitchNames, 2989 kWebRtcDevSwitchNames,
2975 arraysize(kWebRtcDevSwitchNames)); 2990 arraysize(kWebRtcDevSwitchNames));
2976 } 2991 }
2977 } 2992 }
2978 #endif // defined(ENABLE_WEBRTC) 2993 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698