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

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 12211047: Implementing geolocation for the Android Webview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added const Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 void AwContentBrowserClient::ResourceDispatcherHostCreated() { 324 void AwContentBrowserClient::ResourceDispatcherHostCreated() {
320 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); 325 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
321 } 326 }
322 327
323 net::NetLog* AwContentBrowserClient::GetNetLog() { 328 net::NetLog* AwContentBrowserClient::GetNetLog() {
324 // TODO(boliu): Implement AwNetLog. 329 // TODO(boliu): Implement AwNetLog.
325 return NULL; 330 return NULL;
326 } 331 }
327 332
328 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { 333 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() {
329 // TODO(boliu): Implement as part of geolocation code. 334 return new AwAccessTokenStore();
330 return new DummyAccessTokenStore();
331 } 335 }
332 336
333 bool AwContentBrowserClient::IsFastShutdownPossible() { 337 bool AwContentBrowserClient::IsFastShutdownPossible() {
334 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" 338 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible"
335 << " should never be called"; 339 << " should never be called";
336 return false; 340 return false;
337 } 341 }
338 342
339 void AwContentBrowserClient::UpdateInspectorSetting( 343 void AwContentBrowserClient::UpdateInspectorSetting(
340 content::RenderViewHost* rvh, 344 content::RenderViewHost* rvh,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 385
382 bool AwContentBrowserClient::AllowPepperSocketAPI( 386 bool AwContentBrowserClient::AllowPepperSocketAPI(
383 content::BrowserContext* browser_context, 387 content::BrowserContext* browser_context,
384 const GURL& url, 388 const GURL& url,
385 const content::SocketPermissionRequest& params) { 389 const content::SocketPermissionRequest& params) {
386 NOTREACHED() << "Android WebView does not support plugins"; 390 NOTREACHED() << "Android WebView does not support plugins";
387 return false; 391 return false;
388 } 392 }
389 393
390 } // namespace android_webview 394 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698