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 "android_webview/browser/aw_browser_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
| 8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 9 #include "android_webview/browser/aw_quota_permission_context.h" | 9 #include "android_webview/browser/aw_quota_permission_context.h" |
| 10 #include "android_webview/browser/net_disk_cache_remover.h" | 10 #include "android_webview/browser/net_disk_cache_remover.h" |
| 11 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" | 11 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" |
| 12 #include "android_webview/common/url_constants.h" | 12 #include "android_webview/common/url_constants.h" |
| 13 #include "base/android/locale_utils.h" | 13 #include "base/android/locale_utils.h" |
| 14 #include "base/base_paths_android.h" | 14 #include "base/base_paths_android.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "content/public/browser/access_token_store.h" | 16 #include "content/public/browser/access_token_store.h" |
| 17 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
| 18 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 21 #include "grit/ui_resources.h" | 21 #include "grit/ui_resources.h" |
| 22 #include "net/android/network_library.h" | 22 #include "net/android/network_library.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class DummyAccessTokenStore : public content::AccessTokenStore { | 27 class AwAccessTokenStore : public content::AccessTokenStore { |
| 28 public: | 28 public: |
| 29 DummyAccessTokenStore() { } | 29 AwAccessTokenStore() { } |
| 30 | 30 |
| 31 // content::AccessTokenStore implementation | |
| 31 virtual void LoadAccessTokens( | 32 virtual void LoadAccessTokens( |
| 32 const LoadAccessTokensCallbackType& request) OVERRIDE { } | 33 const LoadAccessTokensCallbackType& request) OVERRIDE { |
| 34 AccessTokenStore::AccessTokenSet access_token_set; | |
| 35 // AccessTokenSet and net::URLRequestContextGetter not used on Android, | |
| 36 // but Run needs to be called to finish the geolocation setup. | |
| 37 request.Run(access_token_set, NULL); | |
| 38 } | |
| 39 virtual void SaveAccessToken(const GURL& server_url, | |
| 40 const string16& access_token) OVERRIDE { } | |
| 33 | 41 |
| 34 private: | 42 private: |
| 35 virtual ~DummyAccessTokenStore() { } | 43 virtual ~AwAccessTokenStore() { } |
| 36 | 44 |
| 37 virtual void SaveAccessToken( | 45 DISALLOW_COPY_AND_ASSIGN(AwAccessTokenStore); |
| 38 const GURL& server_url, const string16& access_token) OVERRIDE { } | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(DummyAccessTokenStore); | |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 } | 48 } |
| 44 | 49 |
| 45 namespace android_webview { | 50 namespace android_webview { |
| 46 | 51 |
| 47 AwContentBrowserClient::AwContentBrowserClient( | 52 AwContentBrowserClient::AwContentBrowserClient( |
| 48 ViewDelegateFactoryFn* view_delegate_factory, | 53 ViewDelegateFactoryFn* view_delegate_factory, |
| 49 GeolocationPermissionFactoryFn* geolocation_permission_factory) | 54 GeolocationPermissionFactoryFn* geolocation_permission_factory) |
| 50 : view_delegate_factory_(view_delegate_factory) { | 55 : view_delegate_factory_(view_delegate_factory) { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 void AwContentBrowserClient::ResourceDispatcherHostCreated() { | 281 void AwContentBrowserClient::ResourceDispatcherHostCreated() { |
| 277 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); | 282 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); |
| 278 } | 283 } |
| 279 | 284 |
| 280 net::NetLog* AwContentBrowserClient::GetNetLog() { | 285 net::NetLog* AwContentBrowserClient::GetNetLog() { |
| 281 // TODO(boliu): Implement AwNetLog. | 286 // TODO(boliu): Implement AwNetLog. |
| 282 return NULL; | 287 return NULL; |
| 283 } | 288 } |
| 284 | 289 |
| 285 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { | 290 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { |
| 286 // TODO(boliu): Implement as part of geolocation code. | 291 // TODO(boliu): Implement as part of geolocation code. |
|
benm (inactive)
2013/02/08 13:25:19
nit: remove this todo now?
Kristian Monsen
2013/02/12 18:53:03
Done.
| |
| 287 return new DummyAccessTokenStore(); | 292 return new AwAccessTokenStore(); |
| 288 } | 293 } |
| 289 | 294 |
| 290 bool AwContentBrowserClient::IsFastShutdownPossible() { | 295 bool AwContentBrowserClient::IsFastShutdownPossible() { |
| 291 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" | 296 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" |
| 292 << " should never be called"; | 297 << " should never be called"; |
| 293 return false; | 298 return false; |
| 294 } | 299 } |
| 295 | 300 |
| 296 void AwContentBrowserClient::UpdateInspectorSetting( | 301 void AwContentBrowserClient::UpdateInspectorSetting( |
| 297 content::RenderViewHost* rvh, | 302 content::RenderViewHost* rvh, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 | 343 |
| 339 bool AwContentBrowserClient::AllowPepperSocketAPI( | 344 bool AwContentBrowserClient::AllowPepperSocketAPI( |
| 340 content::BrowserContext* browser_context, | 345 content::BrowserContext* browser_context, |
| 341 const GURL& url, | 346 const GURL& url, |
| 342 const content::SocketPermissionRequest& params) { | 347 const content::SocketPermissionRequest& params) { |
| 343 NOTREACHED() << "Android WebView does not support plugins"; | 348 NOTREACHED() << "Android WebView does not support plugins"; |
| 344 return false; | 349 return false; |
| 345 } | 350 } |
| 346 | 351 |
| 347 } // namespace android_webview | 352 } // namespace android_webview |
| OLD | NEW |