Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: chrome/browser/resources/settings/people_page/change_picture.js

Issue 2841653002: MD Settings: Fix initialization timing of browser proxy in change-picture. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * Contains the possible types of Change Picture selections. 6 * Contains the possible types of Change Picture selections.
7 * @enum {string} 7 * @enum {string}
8 */ 8 */
9 var ChangePictureSelectionTypes = { 9 var ChangePictureSelectionTypes = {
10 CAMERA: 'camera', 10 CAMERA: 'camera',
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 fallbackImage_: null, 107 fallbackImage_: null,
108 108
109 /** 109 /**
110 * Type of the last selected icon. This is used to jump back to the camera 110 * Type of the last selected icon. This is used to jump back to the camera
111 * after the user discards a newly taken photo. 111 * after the user discards a newly taken photo.
112 * @private {string} 112 * @private {string}
113 */ 113 */
114 lastSelectedImageType_: '', 114 lastSelectedImageType_: '',
115 115
116 /** @override */ 116 /** @override */
117 ready: function() {
118 this.browserProxy_ = settings.ChangePictureBrowserProxyImpl.getInstance();
119 },
120
121 /** @override */
117 attached: function() { 122 attached: function() {
118 this.browserProxy_ = settings.ChangePictureBrowserProxyImpl.getInstance();
119 this.addWebUIListener('default-images-changed', 123 this.addWebUIListener('default-images-changed',
120 this.receiveDefaultImages_.bind(this)); 124 this.receiveDefaultImages_.bind(this));
121 this.addWebUIListener('selected-image-changed', 125 this.addWebUIListener('selected-image-changed',
122 this.receiveSelectedImage_.bind(this)); 126 this.receiveSelectedImage_.bind(this));
123 this.addWebUIListener('old-image-changed', 127 this.addWebUIListener('old-image-changed',
124 this.receiveOldImage_.bind(this)); 128 this.receiveOldImage_.bind(this));
125 this.addWebUIListener('profile-image-changed', 129 this.addWebUIListener('profile-image-changed',
126 this.receiveProfileImage_.bind(this)); 130 this.receiveProfileImage_.bind(this));
127 this.addWebUIListener('camera-presence-changed', 131 this.addWebUIListener('camera-presence-changed',
128 this.receiveCameraPresence_.bind(this)); 132 this.receiveCameraPresence_.bind(this));
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 */ 445 */
442 getAuthorWebsite_: function(selectedItem, defaultImages) { 446 getAuthorWebsite_: function(selectedItem, defaultImages) {
443 if (!this.isAuthorCreditShown_(selectedItem)) 447 if (!this.isAuthorCreditShown_(selectedItem))
444 return ''; 448 return '';
445 449
446 assert(selectedItem.dataset.defaultImageIndex !== null && 450 assert(selectedItem.dataset.defaultImageIndex !== null &&
447 selectedItem.dataset.defaultImageIndex < defaultImages.length); 451 selectedItem.dataset.defaultImageIndex < defaultImages.length);
448 return defaultImages[selectedItem.dataset.defaultImageIndex].website; 452 return defaultImages[selectedItem.dataset.defaultImageIndex].website;
449 }, 453 },
450 }); 454 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698