| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "device/bluetooth/bluetooth_device.h" | 12 #include "device/bluetooth/bluetooth_device.h" |
| 13 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" | 13 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" |
| 14 #include "extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h" | 14 #include "extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h" |
| 15 #include "extensions/browser/browser_context_keyed_api_factory.h" | 15 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 16 #include "extensions/browser/extension_function.h" | 16 #include "extensions/browser/extension_function.h" |
| 17 | 17 |
| 18 // Implementations for chrome.easyUnlockPrivate API functions. | 18 // Implementations for chrome.easyUnlockPrivate API functions. |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class BrowserContext; | 21 class BrowserContext; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace extensions { | 24 namespace extensions { |
| 25 namespace api { | |
| 26 | |
| 27 namespace easy_unlock { | |
| 28 struct SeekDeviceResult; | |
| 29 } // easy_unlock | |
| 30 | 25 |
| 31 class EasyUnlockPrivateCryptoDelegate; | 26 class EasyUnlockPrivateCryptoDelegate; |
| 32 | 27 |
| 33 class EasyUnlockPrivateAPI : public BrowserContextKeyedAPI { | 28 class EasyUnlockPrivateAPI : public BrowserContextKeyedAPI { |
| 34 public: | 29 public: |
| 35 static BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>* | 30 static BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>* |
| 36 GetFactoryInstance(); | 31 GetFactoryInstance(); |
| 37 | 32 |
| 38 static const bool kServiceRedirectedInIncognito = true; | 33 static const bool kServiceRedirectedInIncognito = true; |
| 39 | 34 |
| 40 explicit EasyUnlockPrivateAPI(content::BrowserContext* context); | 35 explicit EasyUnlockPrivateAPI(content::BrowserContext* context); |
| 41 ~EasyUnlockPrivateAPI() override; | 36 ~EasyUnlockPrivateAPI() override; |
| 42 | 37 |
| 43 EasyUnlockPrivateCryptoDelegate* crypto_delegate() { | 38 EasyUnlockPrivateCryptoDelegate* GetCryptoDelegate(); |
| 44 return crypto_delegate_.get(); | |
| 45 } | |
| 46 | 39 |
| 47 private: | 40 private: |
| 48 friend class BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>; | 41 friend class BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>; |
| 49 | 42 |
| 50 // BrowserContextKeyedAPI implementation. | 43 // BrowserContextKeyedAPI implementation. |
| 51 static const char* service_name() { return "EasyUnlockPrivate"; } | 44 static const char* service_name() { return "EasyUnlockPrivate"; } |
| 52 | 45 |
| 53 scoped_ptr<EasyUnlockPrivateCryptoDelegate> crypto_delegate_; | 46 scoped_ptr<EasyUnlockPrivateCryptoDelegate> crypto_delegate_; |
| 54 | 47 |
| 55 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateAPI); | 48 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateAPI); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 385 |
| 393 private: | 386 private: |
| 394 ~EasyUnlockPrivateSetAutoPairingResultFunction() override; | 387 ~EasyUnlockPrivateSetAutoPairingResultFunction() override; |
| 395 | 388 |
| 396 // SyncExtensionFunction: | 389 // SyncExtensionFunction: |
| 397 bool RunSync() override; | 390 bool RunSync() override; |
| 398 | 391 |
| 399 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateSetAutoPairingResultFunction); | 392 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateSetAutoPairingResultFunction); |
| 400 }; | 393 }; |
| 401 | 394 |
| 402 } // namespace api | |
| 403 } // namespace extensions | 395 } // namespace extensions |
| 404 | 396 |
| 405 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ | 397 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ |
| OLD | NEW |