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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 protected: | 74 protected: |
75 virtual ~EasyUnlockPrivatePerformECDHKeyAgreementFunction(); | 75 virtual ~EasyUnlockPrivatePerformECDHKeyAgreementFunction(); |
76 | 76 |
77 virtual bool RunAsync() OVERRIDE; | 77 virtual bool RunAsync() OVERRIDE; |
78 | 78 |
79 private: | 79 private: |
80 void OnData(const std::string& secret_key); | 80 void OnData(const std::string& secret_key); |
81 | 81 |
82 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.performECDHKeyAgreement", | 82 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.performECDHKeyAgreement", |
83 EASYUNLOCKPRIVATE_PERFORMECDHKEYAGREEMENT) | 83 EASYUNLOCKPRIVATE_PERFORMECDHKEYAGREEMENT) |
| 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivatePerformECDHKeyAgreementFunction); |
84 }; | 86 }; |
85 | 87 |
86 class EasyUnlockPrivateGenerateEcP256KeyPairFunction | 88 class EasyUnlockPrivateGenerateEcP256KeyPairFunction |
87 : public AsyncExtensionFunction { | 89 : public AsyncExtensionFunction { |
88 public: | 90 public: |
89 EasyUnlockPrivateGenerateEcP256KeyPairFunction(); | 91 EasyUnlockPrivateGenerateEcP256KeyPairFunction(); |
90 | 92 |
91 protected: | 93 protected: |
92 virtual ~EasyUnlockPrivateGenerateEcP256KeyPairFunction(); | 94 virtual ~EasyUnlockPrivateGenerateEcP256KeyPairFunction(); |
93 | 95 |
94 virtual bool RunAsync() OVERRIDE; | 96 virtual bool RunAsync() OVERRIDE; |
95 | 97 |
96 private: | 98 private: |
97 void OnData(const std::string& public_key, | 99 void OnData(const std::string& public_key, |
98 const std::string& private_key); | 100 const std::string& private_key); |
99 | 101 |
100 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.generateEcP256KeyPair", | 102 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.generateEcP256KeyPair", |
101 EASYUNLOCKPRIVATE_GENERATEECP256KEYPAIR) | 103 EASYUNLOCKPRIVATE_GENERATEECP256KEYPAIR) |
| 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateGenerateEcP256KeyPairFunction); |
102 }; | 106 }; |
103 | 107 |
104 class EasyUnlockPrivateCreateSecureMessageFunction | 108 class EasyUnlockPrivateCreateSecureMessageFunction |
105 : public AsyncExtensionFunction { | 109 : public AsyncExtensionFunction { |
106 public: | 110 public: |
107 EasyUnlockPrivateCreateSecureMessageFunction(); | 111 EasyUnlockPrivateCreateSecureMessageFunction(); |
108 | 112 |
109 protected: | 113 protected: |
110 virtual ~EasyUnlockPrivateCreateSecureMessageFunction(); | 114 virtual ~EasyUnlockPrivateCreateSecureMessageFunction(); |
111 | 115 |
112 virtual bool RunAsync() OVERRIDE; | 116 virtual bool RunAsync() OVERRIDE; |
113 | 117 |
114 private: | 118 private: |
115 void OnData(const std::string& message); | 119 void OnData(const std::string& message); |
116 | 120 |
117 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.createSecureMessage", | 121 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.createSecureMessage", |
118 EASYUNLOCKPRIVATE_CREATESECUREMESSAGE) | 122 EASYUNLOCKPRIVATE_CREATESECUREMESSAGE) |
| 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateCreateSecureMessageFunction); |
119 }; | 125 }; |
120 | 126 |
121 class EasyUnlockPrivateUnwrapSecureMessageFunction | 127 class EasyUnlockPrivateUnwrapSecureMessageFunction |
122 : public AsyncExtensionFunction { | 128 : public AsyncExtensionFunction { |
123 public: | 129 public: |
124 EasyUnlockPrivateUnwrapSecureMessageFunction(); | 130 EasyUnlockPrivateUnwrapSecureMessageFunction(); |
125 | 131 |
126 protected: | 132 protected: |
127 virtual ~EasyUnlockPrivateUnwrapSecureMessageFunction(); | 133 virtual ~EasyUnlockPrivateUnwrapSecureMessageFunction(); |
128 | 134 |
129 virtual bool RunAsync() OVERRIDE; | 135 virtual bool RunAsync() OVERRIDE; |
130 | 136 |
131 private: | 137 private: |
132 void OnData(const std::string& data); | 138 void OnData(const std::string& data); |
133 | 139 |
134 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.unwrapSecureMessage", | 140 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.unwrapSecureMessage", |
135 EASYUNLOCKPRIVATE_UNWRAPSECUREMESSAGE) | 141 EASYUNLOCKPRIVATE_UNWRAPSECUREMESSAGE) |
| 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateUnwrapSecureMessageFunction); |
136 }; | 144 }; |
137 | 145 |
138 class EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction | 146 class EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction |
139 : public AsyncExtensionFunction { | 147 : public AsyncExtensionFunction { |
140 public: | 148 public: |
141 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.seekBluetoothDeviceByAddress", | 149 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.seekBluetoothDeviceByAddress", |
142 EASYUNLOCKPRIVATE_SEEKBLUETOOTHDEVICEBYADDRESS) | 150 EASYUNLOCKPRIVATE_SEEKBLUETOOTHDEVICEBYADDRESS) |
143 EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction(); | 151 EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction(); |
144 | 152 |
145 private: | 153 private: |
146 virtual ~EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction(); | 154 virtual ~EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction(); |
147 | 155 |
148 // AsyncExtensionFunction: | 156 // AsyncExtensionFunction: |
149 virtual bool RunAsync() OVERRIDE; | 157 virtual bool RunAsync() OVERRIDE; |
150 | 158 |
151 // Callback that is called when the seek operation succeeds. | 159 // Callback that is called when the seek operation succeeds. |
152 void OnSeekCompleted(const easy_unlock::SeekDeviceResult& seek_result); | 160 void OnSeekCompleted(const easy_unlock::SeekDeviceResult& seek_result); |
153 | 161 |
154 DISALLOW_COPY_AND_ASSIGN( | 162 DISALLOW_COPY_AND_ASSIGN( |
155 EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction); | 163 EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction); |
156 }; | 164 }; |
157 | 165 |
| 166 class EasyUnlockPrivateUpdateScreenlockStateFunction |
| 167 : public SyncExtensionFunction { |
| 168 public: |
| 169 EasyUnlockPrivateUpdateScreenlockStateFunction(); |
| 170 |
| 171 protected: |
| 172 virtual ~EasyUnlockPrivateUpdateScreenlockStateFunction(); |
| 173 |
| 174 virtual bool RunSync() OVERRIDE; |
| 175 |
| 176 private: |
| 177 DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.updateScreenlockState", |
| 178 EASYUNLOCKPRIVATE_UPDATESCREENLOCKSTATE) |
| 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateUpdateScreenlockStateFunction); |
| 181 }; |
| 182 |
158 } // namespace api | 183 } // namespace api |
159 } // namespace extensions | 184 } // namespace extensions |
160 | 185 |
161 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ | 186 #endif // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE
_API_H_ |
OLD | NEW |