Chromium Code Reviews| 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 get the | |
| 7 * profile info, which consists of the profile name and icon. Used for both | |
| 8 * Chrome browser and ChromeOS. | |
| 9 */ | |
| 10 cr.exportPath('settings'); | |
| 11 | |
| 12 /** | |
| 13 * An object describing the profile. | |
| 14 * @typedef {{ | |
| 15 * name: string, | |
| 16 * iconUrl: string | |
| 17 * }} | |
| 18 */ | |
| 19 settings.ProfileInfo; | |
| 20 | |
| 21 cr.define('settings', function() { | |
| 22 /** @interface */ | |
| 23 function ProfileInfoBrowserProxy() {} | |
| 24 | |
| 25 ProfileInfoBrowserProxy.prototype = { | |
| 26 /** | |
| 27 * Returns a Promise for the profile info. | |
| 28 * @return {!Promise<!settings.ProfileInfo>} | |
| 29 */ | |
| 30 getProfileInfo: function() {}, | |
| 31 }; | |
| 32 | |
| 33 /** | |
| 34 * @constructor | |
| 35 * @implements {ProfileInfoBrowserProxy} | |
| 36 */ | |
| 37 function ProfileInfoBrowserProxyImpl() {} | |
| 38 // The singleton instance_ is replaced with a test version of this wrapper | |
|
dpapad
2016/04/18 23:30:49
Nit(optional): I think it is OK to not copy this c
tommycli
2016/04/19 00:03:26
Done.
| |
| 39 // during testing. | |
| 40 cr.addSingletonGetter(ProfileInfoBrowserProxyImpl); | |
| 41 | |
| 42 ProfileInfoBrowserProxyImpl.prototype = { | |
| 43 /** @override */ | |
| 44 getProfileInfo: function() { | |
| 45 return cr.sendWithPromise('getProfileInfo'); | |
| 46 }, | |
| 47 }; | |
| 48 | |
| 49 return { | |
| 50 ProfileInfoBrowserProxyImpl: ProfileInfoBrowserProxyImpl, | |
| 51 }; | |
| 52 }); | |
| OLD | NEW |