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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // success, the user session will be started. | 322 // success, the user session will be started. |
309 static void trySignInSecret(ArrayBuffer signInSecret, | 323 static void trySignInSecret(ArrayBuffer signInSecret, |
310 EmptyCallback callback); | 324 EmptyCallback callback); |
311 | 325 |
312 // Retrieves information about the user associated with the Easy unlock | 326 // Retrieves information about the user associated with the Easy unlock |
313 // service. | 327 // service. |
314 static void getUserInfo(GetUserInfoCallback callback); | 328 static void getUserInfo(GetUserInfoCallback callback); |
315 | 329 |
316 // Gets the user's profile image as a bitmap. | 330 // Gets the user's profile image as a bitmap. |
317 static void getUserImage(DataCallback callback); | 331 static void getUserImage(DataCallback callback); |
| 332 |
| 333 // Shows an error bubble with the given |message|, anchored to the given |
| 334 // |anchorRect|. If the |link_range| is non-empty, renders the text within |
| 335 // the |message| that is contained in the |link_range| as a link with the |
| 336 // given |link_target| URL. |
| 337 static void showErrorBubble(DOMString message, |
| 338 Range link_range, |
| 339 DOMString link_target, |
| 340 Rect anchorRect); |
318 }; | 341 }; |
319 | 342 |
320 interface Events { | 343 interface Events { |
321 // Event fired when the data for the user currently associated with | 344 // Event fired when the data for the user currently associated with |
322 // Easy unlock service is updated. | 345 // Easy unlock service is updated. |
323 // |userInfo| The updated user information. | 346 // |userInfo| The updated user information. |
324 static void onUserInfoUpdated(UserInfo userInfo); | 347 static void onUserInfoUpdated(UserInfo userInfo); |
325 }; | 348 }; |
326 }; | 349 }; |
OLD | NEW |