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

Side by Side Diff: chrome/browser/resources/options/personal_options.js

Issue 8297001: Prevents a profile from editing the avatar and profile name of another profile in the Personal Op... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« 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 (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
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
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 });
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