Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 const localStrings = new LocalStrings(); | 9 const localStrings = new LocalStrings(); |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 }, | 83 }, |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Set the profile info used in the dialog. | 86 * Set the profile info used in the dialog. |
| 87 * @param {Object} profileInfo An object of the form: | 87 * @param {Object} profileInfo An object of the form: |
| 88 * profileInfo = { | 88 * profileInfo = { |
| 89 * name: "Profile Name", | 89 * name: "Profile Name", |
| 90 * iconURL: "chrome://path/to/icon/image", | 90 * iconURL: "chrome://path/to/icon/image", |
| 91 * filePath: "/path/to/profile/data/on/disk" | 91 * filePath: "/path/to/profile/data/on/disk" |
| 92 * isCurrentProfile: false, | 92 * isCurrentProfile: false, |
| 93 * }; | 93 * }. |
|
James Hawkins
2012/02/09 02:51:52
Revert
Tyler Breisacher (Chromium)
2012/02/09 03:04:34
Done.
| |
| 94 * @private | 94 * @private |
| 95 */ | 95 */ |
| 96 setProfileInfo_: function(profileInfo) { | 96 setProfileInfo_: function(profileInfo) { |
| 97 this.iconGridSelectedURL_ = profileInfo.iconURL; | 97 this.iconGridSelectedURL_ = profileInfo.iconURL; |
| 98 this.profileInfo_ = profileInfo; | 98 this.profileInfo_ = profileInfo; |
| 99 $('manage-profile-name').value = profileInfo.name; | 99 $('manage-profile-name').value = profileInfo.name; |
| 100 $('manage-profile-icon-grid').selectedItem = profileInfo.iconURL; | 100 $('manage-profile-icon-grid').selectedItem = profileInfo.iconURL; |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 /** | 103 /** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 * Hide the error bubble. | 158 * Hide the error bubble. |
| 159 * @private | 159 * @private |
| 160 */ | 160 */ |
| 161 hideErrorBubble_: function() { | 161 hideErrorBubble_: function() { |
| 162 $('manage-profile-error-bubble').hidden = true; | 162 $('manage-profile-error-bubble').hidden = true; |
| 163 $('manage-profile-ok').disabled = false; | 163 $('manage-profile-ok').disabled = false; |
| 164 }, | 164 }, |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * oninput callback for <input> field. | 167 * oninput callback for <input> field. |
| 168 * @param event The event object | 168 * @param {Event} event The event object. |
| 169 * @private | 169 * @private |
| 170 */ | 170 */ |
| 171 onNameChanged_: function(event) { | 171 onNameChanged_: function(event) { |
| 172 var newName = event.target.value; | 172 var newName = event.target.value; |
| 173 var oldName = this.profileInfo_.name; | 173 var oldName = this.profileInfo_.name; |
| 174 | 174 |
| 175 if (newName == oldName) { | 175 if (newName == oldName) { |
| 176 this.hideErrorBubble_(); | 176 this.hideErrorBubble_(); |
| 177 } else if (this.profileNames_[newName] != undefined) { | 177 } else if (this.profileNames_[newName] != undefined) { |
| 178 this.showErrorBubble_('manageProfilesDuplicateNameError'); | 178 this.showErrorBubble_('manageProfilesDuplicateNameError'); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 var instance = ManageProfileOverlay.getInstance(); | 257 var instance = ManageProfileOverlay.getInstance(); |
| 258 return instance[name + '_'].apply(instance, arguments); | 258 return instance[name + '_'].apply(instance, arguments); |
| 259 }; | 259 }; |
| 260 }); | 260 }); |
| 261 | 261 |
| 262 // Export | 262 // Export |
| 263 return { | 263 return { |
| 264 ManageProfileOverlay: ManageProfileOverlay | 264 ManageProfileOverlay: ManageProfileOverlay |
| 265 }; | 265 }; |
| 266 }); | 266 }); |
| OLD | NEW |