| Index: chrome/browser/resources/settings/people_page/change_picture_browser_proxy.js
|
| diff --git a/chrome/browser/resources/settings/people_page/change_picture_browser_proxy.js b/chrome/browser/resources/settings/people_page/change_picture_browser_proxy.js
|
| index 05e3dc67591f717ce4bc7139211a542bc2a8389b..d6dc9b9137f3adae388d40ab42ca12d84a27ea51 100644
|
| --- a/chrome/browser/resources/settings/people_page/change_picture_browser_proxy.js
|
| +++ b/chrome/browser/resources/settings/people_page/change_picture_browser_proxy.js
|
| @@ -21,90 +21,86 @@ settings.DefaultImage;
|
|
|
| cr.define('settings', function() {
|
| /** @interface */
|
| - function ChangePictureBrowserProxy() {}
|
| -
|
| - ChangePictureBrowserProxy.prototype = {
|
| + class ChangePictureBrowserProxy {
|
| /**
|
| * Retrieves the initial set of default images, profile image, etc. As a
|
| * response, the C++ sends these WebUIListener events:
|
| * 'default-images-changed', 'profile-image-changed', 'old-image-changed',
|
| * and 'selected-image-changed'
|
| */
|
| - initialize: function() {},
|
| + initialize() {}
|
|
|
| /**
|
| * Sets the user image to one of the default images. As a response, the C++
|
| * sends the 'default-images-changed' WebUIListener event.
|
| * @param {string} imageUrl
|
| */
|
| - selectDefaultImage: function(imageUrl) {},
|
| + selectDefaultImage(imageUrl) {}
|
|
|
| /**
|
| * Sets the user image to the 'old' image. As a response, the C++ sends the
|
| * 'old-image-changed' WebUIListener event.
|
| */
|
| - selectOldImage: function() {},
|
| + selectOldImage() {}
|
|
|
| /**
|
| * Sets the user image to the profile image. As a response, the C++ sends
|
| * the 'profile-image-changed' WebUIListener event.
|
| */
|
| - selectProfileImage: function() {},
|
| + selectProfileImage() {}
|
|
|
| /**
|
| * Provides the taken photo as a data URL to the C++. No response is
|
| * expected.
|
| * @param {string} photoDataUrl
|
| */
|
| - photoTaken: function(photoDataUrl) {},
|
| + photoTaken(photoDataUrl) {}
|
|
|
| /**
|
| * Requests a file chooser to select a new user image. No response is
|
| * expected.
|
| */
|
| - chooseFile: function() {},
|
| - };
|
| + chooseFile() {}
|
| + }
|
|
|
| /**
|
| - * @constructor
|
| * @implements {settings.ChangePictureBrowserProxy}
|
| */
|
| - function ChangePictureBrowserProxyImpl() {}
|
| - // The singleton instance_ is replaced with a test version of this wrapper
|
| - // during testing.
|
| - cr.addSingletonGetter(ChangePictureBrowserProxyImpl);
|
| -
|
| - ChangePictureBrowserProxyImpl.prototype = {
|
| + class ChangePictureBrowserProxyImpl {
|
| /** @override */
|
| - initialize: function() {
|
| + initialize() {
|
| chrome.send('onChangePicturePageInitialized');
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - selectDefaultImage: function(imageUrl) {
|
| + selectDefaultImage(imageUrl) {
|
| chrome.send('selectImage', [imageUrl, 'default']);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - selectOldImage: function() {
|
| + selectOldImage() {
|
| chrome.send('selectImage', ['', 'old']);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - selectProfileImage: function() {
|
| + selectProfileImage() {
|
| chrome.send('selectImage', ['', 'profile']);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - photoTaken: function(photoDataUrl) {
|
| + photoTaken(photoDataUrl) {
|
| chrome.send('photoTaken', [photoDataUrl]);
|
| - },
|
| + }
|
|
|
| /** @override */
|
| - chooseFile: function() {
|
| + chooseFile() {
|
| chrome.send('chooseFile');
|
| - },
|
| - };
|
| + }
|
| + }
|
| +
|
| + // The singleton instance_ is replaced with a test version of this wrapper
|
| + // during testing.
|
| + cr.addSingletonGetter(ChangePictureBrowserProxyImpl);
|
|
|
| return {
|
| ChangePictureBrowserProxy: ChangePictureBrowserProxy,
|
|
|