OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview A helper object used from the the People section to interact |
| 7 * with the Easy Unlock functionality of the browser. ChromeOS only. |
| 8 */ |
| 9 cr.exportPath('settings'); |
| 10 |
| 11 cr.define('settings', function() { |
| 12 /** @interface */ |
| 13 function EasyUnlockBrowserProxy() {} |
| 14 |
| 15 EasyUnlockBrowserProxy.prototype = { |
| 16 /** |
| 17 * Returns a true promise if Easy Unlock is already enabled on the device. |
| 18 * @return {!Promise<boolean>} |
| 19 */ |
| 20 getEnabledStatus: function() {}, |
| 21 |
| 22 /** |
| 23 * Starts the Easy Unlock setup flow. |
| 24 */ |
| 25 launchSetup: function() {} |
| 26 }; |
| 27 |
| 28 /** |
| 29 * @constructor |
| 30 * @implements {EasyUnlockBrowserProxy} |
| 31 */ |
| 32 function EasyUnlockBrowserProxyImpl() {} |
| 33 // The singleton instance_ is replaced with a test version of this wrapper |
| 34 // during testing. |
| 35 cr.addSingletonGetter(EasyUnlockBrowserProxyImpl); |
| 36 |
| 37 EasyUnlockBrowserProxyImpl.prototype = { |
| 38 /** @override */ |
| 39 getEnabledStatus: function() { |
| 40 return cr.sendWithPromise('easyUnlockGetEnabledStatus'); |
| 41 }, |
| 42 |
| 43 /** @override */ |
| 44 launchSetup: function() { |
| 45 chrome.send('easyUnlockLaunchSetup'); |
| 46 }, |
| 47 }; |
| 48 |
| 49 return { |
| 50 EasyUnlockBrowserProxyImpl: EasyUnlockBrowserProxyImpl, |
| 51 }; |
| 52 }); |
OLD | NEW |