| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 | 9 |
| 10 // State variables. | 10 // State variables. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Profiles. | 55 // Profiles. |
| 56 var profilesList = $('profiles-list'); | 56 var profilesList = $('profiles-list'); |
| 57 options.personal_options.ProfileList.decorate(profilesList); | 57 options.personal_options.ProfileList.decorate(profilesList); |
| 58 profilesList.autoExpands = true; | 58 profilesList.autoExpands = true; |
| 59 | 59 |
| 60 profilesList.onchange = function(event) { | 60 profilesList.onchange = function(event) { |
| 61 var selectedProfile = profilesList.selectedItem; | 61 var selectedProfile = profilesList.selectedItem; |
| 62 var hasSelection = selectedProfile != null; | 62 var hasSelection = selectedProfile != null; |
| 63 var hasSingleProfile = profilesList.dataModel.length == 1; | 63 var hasSingleProfile = profilesList.dataModel.length == 1; |
| 64 $('profiles-manage').disabled = !hasSelection; | 64 $('profiles-manage').disabled = !hasSelection || |
| 65 !selectedProfile.isCurrentProfile; |
| 65 $('profiles-delete').disabled = !hasSingleProfile && !hasSelection; | 66 $('profiles-delete').disabled = !hasSingleProfile && !hasSelection; |
| 66 }; | 67 }; |
| 67 $('profiles-create').onclick = function(event) { | 68 $('profiles-create').onclick = function(event) { |
| 68 chrome.send('createProfile'); | 69 chrome.send('createProfile'); |
| 69 }; | 70 }; |
| 70 $('profiles-manage').onclick = function(event) { | 71 $('profiles-manage').onclick = function(event) { |
| 71 var selectedProfile = self.getSelectedProfileItem_(); | 72 var selectedProfile = self.getSelectedProfileItem_(); |
| 72 if (selectedProfile) | 73 if (selectedProfile) |
| 73 ManageProfileOverlay.showManageDialog(selectedProfile); | 74 ManageProfileOverlay.showManageDialog(selectedProfile); |
| 74 }; | 75 }; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 PersonalOptions.getInstance()[name + '_'](value); | 335 PersonalOptions.getInstance()[name + '_'](value); |
| 335 }; | 336 }; |
| 336 }); | 337 }); |
| 337 | 338 |
| 338 // Export | 339 // Export |
| 339 return { | 340 return { |
| 340 PersonalOptions: PersonalOptions | 341 PersonalOptions: PersonalOptions |
| 341 }; | 342 }; |
| 342 | 343 |
| 343 }); | 344 }); |
| OLD | NEW |