Chromium Code Reviews| 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 "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 Loading... | |
| 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 { | |
|
Michael van Ouwerkerk
2016/06/28 11:17:07
nit: add DISALLOW_COPY_AND_ASSIGN
mcasas
2016/06/28 16:51:25
Done.
| |
| 165 public: | |
| 166 content::AccessTokenStore* CreateAccessTokenStore() final { | |
| 167 return new AwAccessTokenStore(); | |
| 168 } | |
| 169 }; | |
| 170 | |
| 163 AwLocaleManager* g_locale_manager = NULL; | 171 AwLocaleManager* g_locale_manager = NULL; |
| 164 | 172 |
| 165 } // anonymous namespace | 173 } // anonymous namespace |
| 166 | 174 |
| 167 // static | 175 // static |
| 168 std::string AwContentBrowserClient::GetAcceptLangsImpl() { | 176 std::string AwContentBrowserClient::GetAcceptLangsImpl() { |
| 169 // Start with the current locale. | 177 // Start with the current locale. |
| 170 std::string langs = g_locale_manager->GetLocale(); | 178 std::string langs = g_locale_manager->GetLocale(); |
| 171 | 179 |
| 172 // If we're not en-US, add in en-US which will be | 180 // 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 Loading... | |
| 421 } | 429 } |
| 422 | 430 |
| 423 void AwContentBrowserClient::ResourceDispatcherHostCreated() { | 431 void AwContentBrowserClient::ResourceDispatcherHostCreated() { |
| 424 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); | 432 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); |
| 425 } | 433 } |
| 426 | 434 |
| 427 net::NetLog* AwContentBrowserClient::GetNetLog() { | 435 net::NetLog* AwContentBrowserClient::GetNetLog() { |
| 428 return browser_context_->GetAwURLRequestContext()->GetNetLog(); | 436 return browser_context_->GetAwURLRequestContext()->GetNetLog(); |
| 429 } | 437 } |
| 430 | 438 |
| 431 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { | 439 content::GeolocationProvider::Delegate* |
| 432 return new AwAccessTokenStore(); | 440 AwContentBrowserClient::CreateGeolocationDelegate() { |
| 441 return new AwGeolocationDelegate(); | |
| 433 } | 442 } |
| 434 | 443 |
| 435 bool AwContentBrowserClient::IsFastShutdownPossible() { | 444 bool AwContentBrowserClient::IsFastShutdownPossible() { |
| 436 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 445 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 437 switches::kSingleProcess)) { | 446 switches::kSingleProcess)) { |
| 438 NOTREACHED() | 447 NOTREACHED() |
| 439 << "Android WebView is single process, so IsFastShutdownPossible" | 448 << "Android WebView is single process, so IsFastShutdownPossible" |
| 440 << " should never be called"; | 449 << " should never be called"; |
| 441 return false; | 450 return false; |
| 442 } else { | 451 } else { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 | 546 |
| 538 #if defined(VIDEO_HOLE) | 547 #if defined(VIDEO_HOLE) |
| 539 content::ExternalVideoSurfaceContainer* | 548 content::ExternalVideoSurfaceContainer* |
| 540 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 549 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
| 541 content::WebContents* web_contents) { | 550 content::WebContents* web_contents) { |
| 542 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 551 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
| 543 } | 552 } |
| 544 #endif | 553 #endif |
| 545 | 554 |
| 546 } // namespace android_webview | 555 } // namespace android_webview |
| OLD | NEW |