| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 /** | 5 /** |
| 6 * @fileoverview A helper object used from the "Manage Profile" subpage of | 6 * @fileoverview A helper object used from the "Manage Profile" subpage of |
| 7 * the People section to interact with the browser. Chrome Browser only. | 7 * the People section to interact with the browser. Chrome Browser only. |
| 8 */ | 8 */ |
| 9 cr.define('settings', function() { | 9 cr.define('settings', function() { |
| 10 /** @interface */ | 10 /** @interface */ |
| 11 function ManageProfileBrowserProxy() {} | 11 function ManageProfileBrowserProxy() {} |
| 12 | 12 |
| 13 ManageProfileBrowserProxy.prototype = { | 13 ManageProfileBrowserProxy.prototype = { |
| 14 /** | 14 /** |
| 15 * Gets the available profile icons to choose from. | 15 * Gets the available profile icons to choose from. |
| 16 * @return {!Promise<!Array<string>>} | 16 * @return {!Promise<!Array<string>>} |
| 17 */ | 17 */ |
| 18 getAvailableIcons: function() {}, | 18 getAvailableIcons: function() {}, |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * Sets the profile's icon and name. There is no response. | 21 * Sets the profile's icon and name. There is no response. |
| 22 * @param {!string} iconUrl The new profile URL. | 22 * @param {!string} iconUrl The new profile URL. |
| 23 * @param {!string} name The new profile name. | 23 * @param {!string} name The new profile name. |
| 24 */ | 24 */ |
| 25 setProfileIconAndName: function(iconUrl, name) {}, | 25 setProfileIconAndName: function(iconUrl, name) {}, |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * @constructor | 29 * @constructor |
| 30 * @implements {ManageProfileBrowserProxy} | 30 * @implements {settings.ManageProfileBrowserProxy} |
| 31 */ | 31 */ |
| 32 function ManageProfileBrowserProxyImpl() {} | 32 function ManageProfileBrowserProxyImpl() {} |
| 33 // The singleton instance_ is replaced with a test version of this wrapper | 33 // The singleton instance_ is replaced with a test version of this wrapper |
| 34 // during testing. | 34 // during testing. |
| 35 cr.addSingletonGetter(ManageProfileBrowserProxyImpl); | 35 cr.addSingletonGetter(ManageProfileBrowserProxyImpl); |
| 36 | 36 |
| 37 ManageProfileBrowserProxyImpl.prototype = { | 37 ManageProfileBrowserProxyImpl.prototype = { |
| 38 /** @override */ | 38 /** @override */ |
| 39 getAvailableIcons: function() { | 39 getAvailableIcons: function() { |
| 40 return cr.sendWithPromise('getAvailableIcons'); | 40 return cr.sendWithPromise('getAvailableIcons'); |
| 41 }, | 41 }, |
| 42 | 42 |
| 43 /** @override */ | 43 /** @override */ |
| 44 setProfileIconAndName: function(iconUrl, name) { | 44 setProfileIconAndName: function(iconUrl, name) { |
| 45 chrome.send('setProfileIconAndName', [iconUrl, name]); | 45 chrome.send('setProfileIconAndName', [iconUrl, name]); |
| 46 }, | 46 }, |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 return { | 49 return { |
| 50 ManageProfileBrowserProxy: ManageProfileBrowserProxy, |
| 50 ManageProfileBrowserProxyImpl: ManageProfileBrowserProxyImpl, | 51 ManageProfileBrowserProxyImpl: ManageProfileBrowserProxyImpl, |
| 51 }; | 52 }; |
| 52 }); | 53 }); |
| OLD | NEW |