diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/content_browser_client.h | 4 | ||||
-rw-r--r-- | content/browser/geolocation/access_token_store.cc | 23 | ||||
-rw-r--r-- | content/browser/geolocation/access_token_store.h | 5 | ||||
-rw-r--r-- | content/browser/geolocation/arbitrator_dependency_factory.cc | 2 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.cc | 4 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.h | 1 | ||||
-rw-r--r-- | content/content_browser.gypi | 1 |
7 files changed, 34 insertions, 6 deletions
diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index c88e169..de3fcc4 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -13,6 +13,7 @@ #include "content/common/window_container_type.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h" +class AccessTokenStore; class BrowserRenderProcessHost; class BrowserURLHandler; class CommandLine; @@ -249,6 +250,9 @@ class ContentBrowserClient { virtual net::NetLog* GetNetLog() = 0; virtual speech_input::SpeechInputManager* GetSpeechInputManager() = 0; + // Creates a new AccessTokenStore for gelocation. + virtual AccessTokenStore* CreateAccessTokenStore() = 0; + // Returns true if fast shutdown is possible. virtual bool IsFastShutdownPossible() = 0; diff --git a/content/browser/geolocation/access_token_store.cc b/content/browser/geolocation/access_token_store.cc new file mode 100644 index 0000000..be1e578 --- /dev/null +++ b/content/browser/geolocation/access_token_store.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/geolocation/access_token_store.h" + +AccessTokenStore::AccessTokenStore() { +} + +AccessTokenStore::~AccessTokenStore() { +} + +AccessTokenStore::Handle AccessTokenStore::LoadAccessTokens( + CancelableRequestConsumerBase* consumer, + LoadAccessTokensCallbackType* callback) { + scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request( + new CancelableRequest<LoadAccessTokensCallbackType>(callback)); + AddRequest(request, consumer); + DCHECK(request->handle()); + + DoLoadAccessTokens(request); + return request->handle(); +} diff --git a/content/browser/geolocation/access_token_store.h b/content/browser/geolocation/access_token_store.h index ce42801..87ad577 100644 --- a/content/browser/geolocation/access_token_store.h +++ b/content/browser/geolocation/access_token_store.h @@ -23,13 +23,11 @@ #include "googleurl/src/gurl.h" class GURL; -class PrefService; // Provides storage for the access token used in the network request. class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>, public CancelableRequestProvider { public: - static void RegisterPrefs(PrefService* prefs); // Map of server URLs to associated access token. typedef std::map<GURL, string16> AccessTokenSet; @@ -55,7 +53,4 @@ class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>, DISALLOW_COPY_AND_ASSIGN(AccessTokenStore); }; -// Creates a new access token store backed by the global chome prefs. -AccessTokenStore* NewChromePrefsAccessTokenStore(); - #endif // CONTENT_BROWSER_GEOLOCATION_ACCESS_TOKEN_STORE_H_ diff --git a/content/browser/geolocation/arbitrator_dependency_factory.cc b/content/browser/geolocation/arbitrator_dependency_factory.cc index ada618d..252813d 100644 --- a/content/browser/geolocation/arbitrator_dependency_factory.cc +++ b/content/browser/geolocation/arbitrator_dependency_factory.cc @@ -29,7 +29,7 @@ DefaultGeolocationArbitratorDependencyFactory::GetTimeFunction() { AccessTokenStore* DefaultGeolocationArbitratorDependencyFactory::NewAccessTokenStore() { - return NewChromePrefsAccessTokenStore(); + return content::GetContentClient()->browser()->CreateAccessTokenStore(); } LocationProviderBase* diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index 4dbc53a..88d9102 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -211,6 +211,10 @@ speech_input::SpeechInputManager* return NULL; } +AccessTokenStore* MockContentBrowserClient::CreateAccessTokenStore() { + return NULL; +} + bool MockContentBrowserClient::IsFastShutdownPossible() { return true; } diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index cab870c..d4a13f1 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -104,6 +104,7 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual DevToolsManager* GetDevToolsManager() OVERRIDE; virtual net::NetLog* GetNetLog() OVERRIDE; virtual speech_input::SpeechInputManager* GetSpeechInputManager() OVERRIDE; + virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE; virtual bool IsFastShutdownPossible() OVERRIDE; virtual WebPreferences GetWebkitPrefs( content::BrowserContext* browser_context, diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 3c0b455..a78751a 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -161,6 +161,7 @@ 'browser/find_pasteboard.mm', 'browser/font_list_async.cc', 'browser/font_list_async.h', + 'browser/geolocation/access_token_store.cc', 'browser/geolocation/access_token_store.h', 'browser/geolocation/arbitrator_dependency_factory.cc', 'browser/geolocation/arbitrator_dependency_factory.h', |