OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_AP
I_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_AP
I_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_AP
I_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_AP
I_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 struct SeekDeviceResult; | 26 struct SeekDeviceResult; |
27 } // easy_unlock | 27 } // easy_unlock |
28 | 28 |
29 class EasyUnlockPrivateCryptoDelegate; | 29 class EasyUnlockPrivateCryptoDelegate; |
30 | 30 |
31 class EasyUnlockPrivateAPI : public BrowserContextKeyedAPI { | 31 class EasyUnlockPrivateAPI : public BrowserContextKeyedAPI { |
32 public: | 32 public: |
33 static BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>* | 33 static BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>* |
34 GetFactoryInstance(); | 34 GetFactoryInstance(); |
35 | 35 |
| 36 static const bool kServiceRedirectedInIncognito = true; |
| 37 |
36 explicit EasyUnlockPrivateAPI(content::BrowserContext* context); | 38 explicit EasyUnlockPrivateAPI(content::BrowserContext* context); |
37 virtual ~EasyUnlockPrivateAPI(); | 39 virtual ~EasyUnlockPrivateAPI(); |
38 | 40 |
39 EasyUnlockPrivateCryptoDelegate* crypto_delegate() { | 41 EasyUnlockPrivateCryptoDelegate* crypto_delegate() { |
40 return crypto_delegate_.get(); | 42 return crypto_delegate_.get(); |
41 } | 43 } |
42 | 44 |
43 private: | 45 private: |
44 friend class BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>; | 46 friend class BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>; |
45 | 47 |
46 // BrowserContextKeyedAPI implementation. | 48 // BrowserContextKeyedAPI implementation. |
47 static const char* service_name() { return "EasyUnlockPrivate"; } | 49 static const char* service_name() { return "EasyUnlockPrivate"; } |
48 | 50 |
49 scoped_ptr<EasyUnlockPrivateCryptoDelegate> crypto_delegate_; | 51 scoped_ptr<EasyUnlockPrivateCryptoDelegate> crypto_delegate_; |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateAPI); | 53 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateAPI); |
52 }; | 54 }; |
53 | 55 |
| 56 // TODO(tbarzic): Replace SyncExtensionFunction/AsyncExtensionFunction overrides |
| 57 // with UIThreadExtensionFunction throughout the file. |
54 class EasyUnlockPrivateGetStringsFunction : public SyncExtensionFunction { | 58 class EasyUnlockPrivateGetStringsFunction : public SyncExtensionFunction { |
55 public: | 59 public: |
56 EasyUnlockPrivateGetStringsFunction(); | 60 EasyUnlockPrivateGetStringsFunction(); |
57 | 61 |
58 protected: | 62 protected: |
59 virtual ~EasyUnlockPrivateGetStringsFunction(); | 63 virtual ~EasyUnlockPrivateGetStringsFunction(); |
60 | 64 |
61 // SyncExtensionFunction: | 65 // SyncExtensionFunction: |
62 virtual bool RunSync() OVERRIDE; | 66 virtual bool RunSync() OVERRIDE; |
63 | 67 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 307 |
304 private: | 308 private: |
305 virtual ~EasyUnlockPrivateTrySignInSecretFunction(); | 309 virtual ~EasyUnlockPrivateTrySignInSecretFunction(); |
306 | 310 |
307 // AsyncExtensionFunction: | 311 // AsyncExtensionFunction: |
308 virtual bool RunAsync() OVERRIDE; | 312 virtual bool RunAsync() OVERRIDE; |
309 | 313 |
310 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateTrySignInSecretFunction); | 314 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateTrySignInSecretFunction); |
311 }; | 315 }; |
312 | 316 |
| 317 class EasyUnlockPrivateGetUserInfoFunction : public SyncExtensionFunction { |
| 318 public: |
| 319 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.getUserInfo", |
| 320 EASYUNLOCKPRIVATE_GETUSERINFO) |
| 321 EasyUnlockPrivateGetUserInfoFunction(); |
| 322 |
| 323 private: |
| 324 virtual ~EasyUnlockPrivateGetUserInfoFunction(); |
| 325 |
| 326 // SyncExtensionFunction: |
| 327 virtual bool RunSync() OVERRIDE; |
| 328 |
| 329 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateGetUserInfoFunction); |
| 330 }; |
| 331 |
313 } // namespace api | 332 } // namespace api |
314 } // namespace extensions | 333 } // namespace extensions |
315 | 334 |
316 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ | 335 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ |
OLD | NEW |