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

Side by Side Diff: android_webview/browser/aw_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 "android_webview/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 void SaveAccessToken(const GURL& server_url, 154 void SaveAccessToken(const GURL& server_url,
155 const base::string16& access_token) override {} 155 const base::string16& access_token) override {}
156 156
157 private: 157 private:
158 ~AwAccessTokenStore() override {} 158 ~AwAccessTokenStore() override {}
159 159
160 DISALLOW_COPY_AND_ASSIGN(AwAccessTokenStore); 160 DISALLOW_COPY_AND_ASSIGN(AwAccessTokenStore);
161 }; 161 };
162 162
163 // A provider of Geolocation services to override AccessTokenStore.
164 class AwGeolocationDelegate : public content::GeolocationProvider::Delegate {
165 public:
166 AwGeolocationDelegate() = default;
167
168 content::AccessTokenStore* CreateAccessTokenStore() final {
169 return new AwAccessTokenStore();
170 }
171
172 private:
173 DISALLOW_COPY_AND_ASSIGN(AwGeolocationDelegate);
174 };
175
163 AwLocaleManager* g_locale_manager = NULL; 176 AwLocaleManager* g_locale_manager = NULL;
164 177
165 } // anonymous namespace 178 } // anonymous namespace
166 179
167 // static 180 // static
168 std::string AwContentBrowserClient::GetAcceptLangsImpl() { 181 std::string AwContentBrowserClient::GetAcceptLangsImpl() {
169 // Start with the current locale. 182 // Start with the current locale.
170 std::string langs = g_locale_manager->GetLocale(); 183 std::string langs = g_locale_manager->GetLocale();
171 184
172 // If we're not en-US, add in en-US which will be 185 // If we're not en-US, add in en-US which will be
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 434 }
422 435
423 void AwContentBrowserClient::ResourceDispatcherHostCreated() { 436 void AwContentBrowserClient::ResourceDispatcherHostCreated() {
424 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); 437 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
425 } 438 }
426 439
427 net::NetLog* AwContentBrowserClient::GetNetLog() { 440 net::NetLog* AwContentBrowserClient::GetNetLog() {
428 return browser_context_->GetAwURLRequestContext()->GetNetLog(); 441 return browser_context_->GetAwURLRequestContext()->GetNetLog();
429 } 442 }
430 443
431 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { 444 content::GeolocationProvider::Delegate*
432 return new AwAccessTokenStore(); 445 AwContentBrowserClient::CreateGeolocationDelegate() {
446 return new AwGeolocationDelegate();
433 } 447 }
434 448
435 bool AwContentBrowserClient::IsFastShutdownPossible() { 449 bool AwContentBrowserClient::IsFastShutdownPossible() {
436 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 450 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
437 switches::kSingleProcess)) { 451 switches::kSingleProcess)) {
438 NOTREACHED() 452 NOTREACHED()
439 << "Android WebView is single process, so IsFastShutdownPossible" 453 << "Android WebView is single process, so IsFastShutdownPossible"
440 << " should never be called"; 454 << " should never be called";
441 return false; 455 return false;
442 } else { 456 } else {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 551
538 #if defined(VIDEO_HOLE) 552 #if defined(VIDEO_HOLE)
539 content::ExternalVideoSurfaceContainer* 553 content::ExternalVideoSurfaceContainer*
540 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 554 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
541 content::WebContents* web_contents) { 555 content::WebContents* web_contents) {
542 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 556 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
543 } 557 }
544 #endif 558 #endif
545 559
546 } // namespace android_webview 560 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | blimp/engine/app/blimp_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698