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 #ifndef CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ | 5 #ifndef CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ |
6 #define CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ | 6 #define CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/public/browser/access_token_store.h" | 9 #include "content/public/browser/access_token_store.h" |
10 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class ShellBrowserContext; | 13 class ShellBrowserContext; |
14 | 14 |
15 // Dummy access token store used to initialise the network location provider. | 15 // Dummy access token store used to initialise the network location provider. |
16 class ShellAccessTokenStore : public content::AccessTokenStore { | 16 class ShellAccessTokenStore : public content::AccessTokenStore { |
17 public: | 17 public: |
18 explicit ShellAccessTokenStore( | 18 explicit ShellAccessTokenStore( |
19 content::ShellBrowserContext* shell_browser_context); | 19 content::ShellBrowserContext* shell_browser_context); |
20 | 20 |
21 private: | 21 private: |
22 virtual ~ShellAccessTokenStore(); | 22 ~ShellAccessTokenStore() override; |
23 | 23 |
24 void GetRequestContextOnUIThread( | 24 void GetRequestContextOnUIThread( |
25 content::ShellBrowserContext* shell_browser_context); | 25 content::ShellBrowserContext* shell_browser_context); |
26 void RespondOnOriginatingThread(const LoadAccessTokensCallbackType& callback); | 26 void RespondOnOriginatingThread(const LoadAccessTokensCallbackType& callback); |
27 | 27 |
28 // AccessTokenStore | 28 // AccessTokenStore |
29 virtual void LoadAccessTokens( | 29 void LoadAccessTokens(const LoadAccessTokensCallbackType& callback) override; |
30 const LoadAccessTokensCallbackType& callback) override; | |
31 | 30 |
32 virtual void SaveAccessToken( | 31 void SaveAccessToken(const GURL& server_url, |
33 const GURL& server_url, const base::string16& access_token) override; | 32 const base::string16& access_token) override; |
34 | 33 |
35 content::ShellBrowserContext* shell_browser_context_; | 34 content::ShellBrowserContext* shell_browser_context_; |
36 scoped_refptr<net::URLRequestContextGetter> system_request_context_; | 35 scoped_refptr<net::URLRequestContextGetter> system_request_context_; |
37 | 36 |
38 DISALLOW_COPY_AND_ASSIGN(ShellAccessTokenStore); | 37 DISALLOW_COPY_AND_ASSIGN(ShellAccessTokenStore); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace content | 40 } // namespace content |
42 | 41 |
43 #endif // CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ | 42 #endif // CONTENT_SHELL_GEOLOCATION_SHELL_ACCESS_TOKEN_STORE_H_ |
OLD | NEW |