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

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: Changing to ContentBrowserClient::GetGeolocationServiceOverrides and impl'd in the 6 impl's. Unitte… Created 4 years, 6 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 AwGeolocationServiceOverrides
165 : public content::GeolocationProvider::ServiceOverrides {
166 public:
167 AccessTokenStore* CreateAccessTokenStore() override {
168 return new AwAccessTokenStore();
169 }
170 };
171
163 AwLocaleManager* g_locale_manager = NULL; 172 AwLocaleManager* g_locale_manager = NULL;
164 173
165 } // anonymous namespace 174 } // anonymous namespace
166 175
167 // static 176 // static
168 std::string AwContentBrowserClient::GetAcceptLangsImpl() { 177 std::string AwContentBrowserClient::GetAcceptLangsImpl() {
169 // Start with the current locale. 178 // Start with the current locale.
170 std::string langs = g_locale_manager->GetLocale(); 179 std::string langs = g_locale_manager->GetLocale();
171 180
172 // If we're not en-US, add in en-US which will be 181 // 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 } 430 }
422 431
423 void AwContentBrowserClient::ResourceDispatcherHostCreated() { 432 void AwContentBrowserClient::ResourceDispatcherHostCreated() {
424 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); 433 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
425 } 434 }
426 435
427 net::NetLog* AwContentBrowserClient::GetNetLog() { 436 net::NetLog* AwContentBrowserClient::GetNetLog() {
428 return browser_context_->GetAwURLRequestContext()->GetNetLog(); 437 return browser_context_->GetAwURLRequestContext()->GetNetLog();
429 } 438 }
430 439
431 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { 440 content::GeolocationProvider::ServiceOverrides*
432 return new AwAccessTokenStore(); 441 AwContentBrowserClient::GetGeolocationServiceOverrides() {
442 return new AwGeolocationServiceOverrides();
Michael van Ouwerkerk 2016/06/24 13:57:18 For a getter, I would expect the client to own the
mcasas 2016/06/24 19:25:52 The easiest way code-wise would be to change it to
433 } 443 }
434 444
435 bool AwContentBrowserClient::IsFastShutdownPossible() { 445 bool AwContentBrowserClient::IsFastShutdownPossible() {
436 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 446 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
437 switches::kSingleProcess)) { 447 switches::kSingleProcess)) {
438 NOTREACHED() 448 NOTREACHED()
439 << "Android WebView is single process, so IsFastShutdownPossible" 449 << "Android WebView is single process, so IsFastShutdownPossible"
440 << " should never be called"; 450 << " should never be called";
441 return false; 451 return false;
442 } else { 452 } else {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 547
538 #if defined(VIDEO_HOLE) 548 #if defined(VIDEO_HOLE)
539 content::ExternalVideoSurfaceContainer* 549 content::ExternalVideoSurfaceContainer*
540 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 550 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
541 content::WebContents* web_contents) { 551 content::WebContents* web_contents) {
542 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 552 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
543 } 553 }
544 #endif 554 #endif
545 555
546 } // namespace android_webview 556 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698