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

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

Issue 863063002: Don't allow profile deletion in Metro mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ifdefs Created 5 years, 11 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/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 2dbfc5d0d5b7bee16236aa53c61d34a34429146d..fbb557d727dd319ac823f70f6447ad4cff5a3ba6 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -324,6 +324,7 @@ cr.define('options', function() {
var profilesList = $('profiles-list');
options.browser_options.ProfileList.decorate(profilesList);
profilesList.autoExpands = true;
+ profilesList.canDeleteItems = true;
// The profiles info data in |loadTimeData| might be stale.
this.setProfilesInfo_(loadTimeData.getValue('profilesInfo'));
@@ -353,6 +354,10 @@ cr.define('options', function() {
$('profiles-delete').disabled = true;
$('profiles-list').canDeleteItems = false;
}
+ if (!loadTimeData.getBoolean('allowProfileDeletion')) {
+ $('profiles-delete').disabled = true;
+ $('profiles-list').canDeleteItems = false;
+ }
}
if (cr.isChromeOS) {
@@ -1406,14 +1411,13 @@ cr.define('options', function() {
var selectedProfile = profilesList.selectedItem;
var hasSelection = selectedProfile != null;
var hasSingleProfile = profilesList.dataModel.length == 1;
- var isSupervised = loadTimeData.getBoolean('profileIsSupervised');
$('profiles-manage').disabled = !hasSelection ||
!selectedProfile.isCurrentProfile;
if (hasSelection && !selectedProfile.isCurrentProfile)
$('profiles-manage').title = loadTimeData.getString('currentUserOnly');
else
$('profiles-manage').title = '';
- $('profiles-delete').disabled = isSupervised ||
+ $('profiles-delete').disabled = !profilesList.canDeleteItems_ ||
(!hasSelection && !hasSingleProfile);
if (OptionsPage.isSettingsApp()) {
$('profiles-app-list-switch').disabled = !hasSelection ||

Powered by Google App Engine
This is Rietveld 408576698