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

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..23483d01a22fd0f27e2d2e8adac4a2c5a06e742a 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 hasSingleProfile = profilesList.dataModel.length == 1;
$('profiles-manage').disabled = !hasSelection;
- $('profiles-delete').disabled = !hasSelection;
+ $('profiles-delete').disabled = !hasSingleProfile && !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 hasSingleProfile = numProfiles == 1;
+ $('profiles-list').hidden = hasSingleProfile;
+ $('profiles-single-message').hidden = !hasSingleProfile;
+ $('profiles-manage').hidden = hasSingleProfile;
+ $('profiles-delete').textContent = hasSingleProfile ?
+ 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