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. |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // service. | 334 // service. |
321 static void getUserInfo(GetUserInfoCallback callback); | 335 static void getUserInfo(GetUserInfoCallback callback); |
322 | 336 |
323 // Gets the user's profile image as a bitmap. | 337 // Gets the user's profile image as a bitmap. |
324 static void getUserImage(DataCallback callback); | 338 static void getUserImage(DataCallback callback); |
325 | 339 |
326 // Gets the connection info for the Bluetooth device identified by | 340 // Gets the connection info for the Bluetooth device identified by |
327 // deviceAddress. | 341 // deviceAddress. |
328 static void getConnectionInfo(DOMString deviceAddress, | 342 static void getConnectionInfo(DOMString deviceAddress, |
329 ConnectionInfoCallback callback); | 343 ConnectionInfoCallback callback); |
| 344 |
| 345 // Shows an error bubble with the given |message|, anchored to an edge of |
| 346 // the given |anchorRect| -- typically the right edge, but possibly a |
| 347 // different edge if there is not space for the bubble to the right of the |
| 348 // anchor rectangle. If the |link_range| is non-empty, renders the text |
| 349 // within the |message| that is contained in the |link_range| as a link with |
| 350 // the given |link_target| URL. |
| 351 static void showErrorBubble(DOMString message, |
| 352 Range link_range, |
| 353 DOMString link_target, |
| 354 Rect anchorRect); |
330 }; | 355 }; |
331 | 356 |
332 interface Events { | 357 interface Events { |
333 // Event fired when the data for the user currently associated with | 358 // Event fired when the data for the user currently associated with |
334 // Easy unlock service is updated. | 359 // Easy unlock service is updated. |
335 // |userInfo| The updated user information. | 360 // |userInfo| The updated user information. |
336 static void onUserInfoUpdated(UserInfo userInfo); | 361 static void onUserInfoUpdated(UserInfo userInfo); |
337 }; | 362 }; |
338 }; | 363 }; |
OLD | NEW |