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

Unified Diff: chrome/browser/resources/options/personal_options.js

Issue 8200017: [Multi Profile] Add "Delete this user" button for singleton profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/personal_options.js
diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js
index 3b44018deacb49d5b97e49616dcc266422bc4968..3b44c5d17250b855c3727df900793def26e0f4cf 100644
--- a/chrome/browser/resources/options/personal_options.js
+++ b/chrome/browser/resources/options/personal_options.js
@@ -60,8 +60,9 @@ cr.define('options', function() {
profilesList.onchange = function(event) {
var selectedProfile = profilesList.selectedItem;
var hasSelection = selectedProfile != null;
+ var hasOneProfile = profilesList.dataModel.length <= 1;
James Hawkins 2011/10/08 18:17:39 What if the length is 0? I don't think this varia
binji 2011/10/10 17:23:03 Done.
$('profiles-manage').disabled = !hasSelection;
- $('profiles-delete').disabled = !hasSelection;
+ $('profiles-delete').disabled = !hasOneProfile && !hasSelection;
};
$('profiles-create').onclick = function(event) {
chrome.send('createProfile');
@@ -220,10 +221,13 @@ cr.define('options', function() {
* @param {number} numProfiles The number of profiles to display.
*/
setProfileViewSingle_: function(numProfiles) {
- $('profiles-list').hidden = numProfiles <= 1;
- $('profiles-single-message').hidden = numProfiles > 1;
- $('profiles-manage').hidden = numProfiles <= 1;
- $('profiles-delete').hidden = numProfiles <= 1;
+ var hasOneProfile = numProfiles <= 1;
+ $('profiles-list').hidden = hasOneProfile;
+ $('profiles-single-message').hidden = !hasOneProfile;
+ $('profiles-manage').hidden = hasOneProfile;
+ $('profiles-delete').textContent = hasOneProfile ?
+ templateData.profilesDeleteSingle :
+ templateData.profilesDelete;
},
/**
« no previous file with comments | « chrome/browser/resources/options/personal_options.html ('k') | chrome/browser/ui/webui/options/personal_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698