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

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

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 5 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
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 * @fileoverview 6 * @fileoverview
7 * 'settings-manage-profile' is the settings subpage containing controls to 7 * 'settings-manage-profile' is the settings subpage containing controls to
8 * edit a profile's name, icon, and desktop shortcut. 8 * edit a profile's name, icon, and desktop shortcut.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 /** @private {?settings.ManageProfileBrowserProxy} */ 60 /** @private {?settings.ManageProfileBrowserProxy} */
61 browserProxy_: null, 61 browserProxy_: null,
62 62
63 /** @override */ 63 /** @override */
64 created: function() { 64 created: function() {
65 this.browserProxy_ = settings.ManageProfileBrowserProxyImpl.getInstance(); 65 this.browserProxy_ = settings.ManageProfileBrowserProxyImpl.getInstance();
66 }, 66 },
67 67
68 /** @override */ 68 /** @override */
69 attached: function() { 69 attached: function() {
70 var setIcons = function(icons) { 70 var setIcons = icons => {
71 this.availableIcons = icons; 71 this.availableIcons = icons;
72 }.bind(this); 72 };
73 73
74 this.addWebUIListener('available-icons-changed', setIcons); 74 this.addWebUIListener('available-icons-changed', setIcons);
75 this.browserProxy_.getAvailableIcons().then(setIcons); 75 this.browserProxy_.getAvailableIcons().then(setIcons);
76 }, 76 },
77 77
78 /** @protected */ 78 /** @protected */
79 currentRouteChanged: function() { 79 currentRouteChanged: function() {
80 if (settings.getCurrentRoute() == settings.routes.MANAGE_PROFILE) { 80 if (settings.getCurrentRoute() == settings.routes.MANAGE_PROFILE) {
81 this.$.name.value = this.profileName; 81 this.$.name.value = this.profileName;
82 82
83 if (loadTimeData.getBoolean('profileShortcutsEnabled')) { 83 if (loadTimeData.getBoolean('profileShortcutsEnabled')) {
84 this.browserProxy_.getProfileShortcutStatus().then(function(status) { 84 this.browserProxy_.getProfileShortcutStatus().then(status => {
85 if (status == ProfileShortcutStatus.PROFILE_SHORTCUT_SETTING_HIDDEN) { 85 if (status == ProfileShortcutStatus.PROFILE_SHORTCUT_SETTING_HIDDEN) {
86 this.isProfileShortcutSettingVisible_ = false; 86 this.isProfileShortcutSettingVisible_ = false;
87 return; 87 return;
88 } 88 }
89 89
90 this.isProfileShortcutSettingVisible_ = true; 90 this.isProfileShortcutSettingVisible_ = true;
91 this.hasProfileShortcut_ = 91 this.hasProfileShortcut_ =
92 status == ProfileShortcutStatus.PROFILE_SHORTCUT_FOUND; 92 status == ProfileShortcutStatus.PROFILE_SHORTCUT_FOUND;
93 }.bind(this)); 93 });
94 } 94 }
95 } 95 }
96 }, 96 },
97 97
98 /** 98 /**
99 * Handler for when the profile name field is changed, then blurred. 99 * Handler for when the profile name field is changed, then blurred.
100 * @param {!Event} event 100 * @param {!Event} event
101 * @private 101 * @private
102 */ 102 */
103 onProfileNameChanged_: function(event) { 103 onProfileNameChanged_: function(event) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 * @private 145 * @private
146 */ 146 */
147 onHasProfileShortcutChange_: function(event) { 147 onHasProfileShortcutChange_: function(event) {
148 if (this.hasProfileShortcut_) { 148 if (this.hasProfileShortcut_) {
149 this.browserProxy_.addProfileShortcut(); 149 this.browserProxy_.addProfileShortcut();
150 } else { 150 } else {
151 this.browserProxy_.removeProfileShortcut(); 151 this.browserProxy_.removeProfileShortcut();
152 } 152 }
153 } 153 }
154 }); 154 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698