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 // <code>chrome.easyUnlockPrivate</code> API that provides hooks to Chrome to | 5 // <code>chrome.easyUnlockPrivate</code> API that provides hooks to Chrome to |
6 // be used by Easy Unlock component app. | 6 // be used by Easy Unlock component app. |
7 namespace easyUnlockPrivate { | 7 namespace easyUnlockPrivate { |
8 // Signature algorithms supported by the crypto library methods used by | 8 // Signature algorithms supported by the crypto library methods used by |
9 // Easy Unlock. | 9 // Easy Unlock. |
10 enum SignatureType { | 10 enum SignatureType { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Whether the user is logged in. If not logged in, the app is running on | 142 // Whether the user is logged in. If not logged in, the app is running on |
143 // the signin screen. | 143 // the signin screen. |
144 boolean loggedIn; | 144 boolean loggedIn; |
145 | 145 |
146 // Whether all data needed to use Easy unlock service has been loaded for | 146 // Whether all data needed to use Easy unlock service has been loaded for |
147 // the user. | 147 // the user. |
148 boolean dataReady; | 148 boolean dataReady; |
149 }; | 149 }; |
150 | 150 |
| 151 // A range. |
| 152 dictionary Range { |
| 153 long start; |
| 154 long end; |
| 155 }; |
| 156 |
| 157 // A rectangle, in screen coordinates, measured in device-independent pixels. |
| 158 dictionary Rect { |
| 159 long left; |
| 160 long top; |
| 161 long width; |
| 162 long height; |
| 163 }; |
| 164 |
151 // Callback for crypto methods that return a single array buffer. | 165 // Callback for crypto methods that return a single array buffer. |
152 callback DataCallback = void(optional ArrayBuffer data); | 166 callback DataCallback = void(optional ArrayBuffer data); |
153 | 167 |
154 // An empty callback used purely for signalling success vs. failure. | 168 // An empty callback used purely for signalling success vs. failure. |
155 callback EmptyCallback = void(); | 169 callback EmptyCallback = void(); |
156 | 170 |
157 // Callback for the getStrings() method. | 171 // Callback for the getStrings() method. |
158 callback GetStringsCallback = void(object strings); | 172 callback GetStringsCallback = void(object strings); |
159 | 173 |
160 // Callback for method that generates an encryption key pair. | 174 // Callback for method that generates an encryption key pair. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 EmptyCallback callback); | 331 EmptyCallback callback); |
318 | 332 |
319 // Retrieves information about the user associated with the Easy unlock | 333 // Retrieves information about the user associated with the Easy unlock |
320 // service. | 334 // service. |
321 static void getUserInfo(GetUserInfoCallback callback); | 335 static void getUserInfo(GetUserInfoCallback callback); |
322 | 336 |
323 // Gets the connection info for the Bluetooth device identified by | 337 // Gets the connection info for the Bluetooth device identified by |
324 // deviceAddress. | 338 // deviceAddress. |
325 static void getConnectionInfo(DOMString deviceAddress, | 339 static void getConnectionInfo(DOMString deviceAddress, |
326 ConnectionInfoCallback callback); | 340 ConnectionInfoCallback callback); |
| 341 |
| 342 // Shows an error bubble with the given |message|, anchored to an edge of |
| 343 // the given |anchorRect| -- typically the right edge, but possibly a |
| 344 // different edge if there is not space for the bubble to the right of the |
| 345 // anchor rectangle. If the |link_range| is non-empty, renders the text |
| 346 // within the |message| that is contained in the |link_range| as a link with |
| 347 // the given |link_target| URL. |
| 348 static void showErrorBubble(DOMString message, |
| 349 Range link_range, |
| 350 DOMString link_target, |
| 351 Rect anchorRect); |
327 }; | 352 }; |
328 | 353 |
329 interface Events { | 354 interface Events { |
330 // Event fired when the data for the user currently associated with | 355 // Event fired when the data for the user currently associated with |
331 // Easy unlock service is updated. | 356 // Easy unlock service is updated. |
332 // |userInfo| The updated user information. | 357 // |userInfo| The updated user information. |
333 static void onUserInfoUpdated(UserInfo userInfo); | 358 static void onUserInfoUpdated(UserInfo userInfo); |
334 }; | 359 }; |
335 }; | 360 }; |
OLD | NEW |