| 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 "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 class DummyAccessTokenStore : public content::AccessTokenStore { | 26 class AwAccessTokenStore : public content::AccessTokenStore { |
| 27 public: | 27 public: |
| 28 DummyAccessTokenStore() { } | 28 AwAccessTokenStore() { } |
| 29 | 29 |
| 30 // content::AccessTokenStore implementation |
| 30 virtual void LoadAccessTokens( | 31 virtual void LoadAccessTokens( |
| 31 const LoadAccessTokensCallbackType& request) OVERRIDE { } | 32 const LoadAccessTokensCallbackType& request) OVERRIDE { |
| 32 | 33 AccessTokenStore::AccessTokenSet access_token_set; |
| 33 private: | 34 // AccessTokenSet and net::URLRequestContextGetter not used on Android, |
| 34 virtual ~DummyAccessTokenStore() { } | 35 // but Run needs to be called to finish the geolocation setup. |
| 35 | 36 request.Run(access_token_set, NULL); |
| 37 } |
| 36 virtual void SaveAccessToken( | 38 virtual void SaveAccessToken( |
| 37 const GURL& server_url, const string16& access_token) OVERRIDE { } | 39 const GURL& server_url, const string16& access_token) OVERRIDE { } |
| 38 | 40 |
| 39 DISALLOW_COPY_AND_ASSIGN(DummyAccessTokenStore); | 41 private: |
| 42 virtual ~AwAccessTokenStore() { } |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(AwAccessTokenStore); |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 } | 47 } |
| 43 | 48 |
| 44 namespace android_webview { | 49 namespace android_webview { |
| 45 | 50 |
| 46 AwContentBrowserClient::AwContentBrowserClient( | 51 AwContentBrowserClient::AwContentBrowserClient( |
| 47 ViewDelegateFactoryFn* view_delegate_factory, | 52 ViewDelegateFactoryFn* view_delegate_factory, |
| 48 GeolocationPermissionFactoryFn* geolocation_permission_factory) | 53 GeolocationPermissionFactoryFn* geolocation_permission_factory) |
| 49 : view_delegate_factory_(view_delegate_factory) { | 54 : view_delegate_factory_(view_delegate_factory) { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); | 271 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); |
| 267 } | 272 } |
| 268 | 273 |
| 269 net::NetLog* AwContentBrowserClient::GetNetLog() { | 274 net::NetLog* AwContentBrowserClient::GetNetLog() { |
| 270 // TODO(boliu): Implement AwNetLog. | 275 // TODO(boliu): Implement AwNetLog. |
| 271 return NULL; | 276 return NULL; |
| 272 } | 277 } |
| 273 | 278 |
| 274 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { | 279 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { |
| 275 // TODO(boliu): Implement as part of geolocation code. | 280 // TODO(boliu): Implement as part of geolocation code. |
| 276 return new DummyAccessTokenStore(); | 281 return new AwAccessTokenStore(); |
| 277 } | 282 } |
| 278 | 283 |
| 279 bool AwContentBrowserClient::IsFastShutdownPossible() { | 284 bool AwContentBrowserClient::IsFastShutdownPossible() { |
| 280 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" | 285 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" |
| 281 << " should never be called"; | 286 << " should never be called"; |
| 282 return false; | 287 return false; |
| 283 } | 288 } |
| 284 | 289 |
| 285 void AwContentBrowserClient::UpdateInspectorSetting( | 290 void AwContentBrowserClient::UpdateInspectorSetting( |
| 286 content::RenderViewHost* rvh, | 291 content::RenderViewHost* rvh, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 332 |
| 328 bool AwContentBrowserClient::AllowPepperSocketAPI( | 333 bool AwContentBrowserClient::AllowPepperSocketAPI( |
| 329 content::BrowserContext* browser_context, | 334 content::BrowserContext* browser_context, |
| 330 const GURL& url, | 335 const GURL& url, |
| 331 const content::SocketPermissionRequest& params) { | 336 const content::SocketPermissionRequest& params) { |
| 332 NOTREACHED() << "Android WebView does not support plugins"; | 337 NOTREACHED() << "Android WebView does not support plugins"; |
| 333 return false; | 338 return false; |
| 334 } | 339 } |
| 335 | 340 |
| 336 } // namespace android_webview | 341 } // namespace android_webview |
| OLD | NEW |