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 Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 onIconGridSelectionChanged_: function(mode) { | 493 onIconGridSelectionChanged_: function(mode) { |
494 var iconURL = $(mode + '-profile-icon-grid').selectedItem; | 494 var iconURL = $(mode + '-profile-icon-grid').selectedItem; |
495 if (!iconURL || iconURL == this.iconGridSelectedURL_) | 495 if (!iconURL || iconURL == this.iconGridSelectedURL_) |
496 return; | 496 return; |
497 this.iconGridSelectedURL_ = iconURL; | 497 this.iconGridSelectedURL_ = iconURL; |
498 if (this.profileNameIsDefault_) { | 498 if (this.profileNameIsDefault_) { |
499 var index = $(mode + '-profile-icon-grid').selectionModel.selectedIndex; | 499 var index = $(mode + '-profile-icon-grid').selectionModel.selectedIndex; |
500 var name = this.defaultProfileNames_[index]; | 500 var name = this.defaultProfileNames_[index]; |
501 if (name) { | 501 if (name) { |
502 this.setProfileName_(name, mode); | 502 this.setProfileName_(name, mode); |
| 503 this.updateCreateOrImport_(mode); |
503 } | 504 } |
504 } | 505 } |
505 if (this.profileInfo_ && this.profileInfo_.filePath) { | 506 if (this.profileInfo_ && this.profileInfo_.filePath) { |
506 chrome.send('profileIconSelectionChanged', | 507 chrome.send('profileIconSelectionChanged', |
507 [this.profileInfo_.filePath, iconURL]); | 508 [this.profileInfo_.filePath, iconURL]); |
508 } | 509 } |
509 }, | 510 }, |
510 | 511 |
511 /** | 512 /** |
512 * Updates the contents of the "Manage Profile" section of the dialog, | 513 * Updates the contents of the "Manage Profile" section of the dialog, |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 return instance[name + '_'].apply(instance, arguments); | 862 return instance[name + '_'].apply(instance, arguments); |
862 }; | 863 }; |
863 }); | 864 }); |
864 | 865 |
865 // Export | 866 // Export |
866 return { | 867 return { |
867 ManageProfileOverlay: ManageProfileOverlay, | 868 ManageProfileOverlay: ManageProfileOverlay, |
868 CreateProfileOverlay: CreateProfileOverlay, | 869 CreateProfileOverlay: CreateProfileOverlay, |
869 }; | 870 }; |
870 }); | 871 }); |
OLD | NEW |