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

Unified Diff: chrome/browser/resources/settings/people_page/manage_profile.js

Issue 2525783002: MD Settings: Hide Profile Shortcut switch for single-profile machines. (Closed)
Patch Set: one more fix to make it actually work Created 4 years, 1 month 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/settings/people_page/manage_profile.js
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.js b/chrome/browser/resources/settings/people_page/manage_profile.js
index 898085276ba0b88190ddbb50e665094d7656afba..6b757451dc660b1a45dc66efb8023aa5ee35de82 100644
--- a/chrome/browser/resources/settings/people_page/manage_profile.js
+++ b/chrome/browser/resources/settings/people_page/manage_profile.js
@@ -55,15 +55,8 @@ Polymer({
/**
* True if the profile shortcuts feature is enabled.
- * @private
*/
- isProfileShortcutsEnabled_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('profileShortcutsEnabled');
- },
- readOnly: true,
- },
+ isProfileShortcutSettingVisible_: Boolean,
},
/** @override */
@@ -81,11 +74,17 @@ Polymer({
if (settings.getCurrentRoute() == settings.Route.MANAGE_PROFILE) {
this.$.name.value = this.profileName;
- if (this.isProfileShortcutsEnabled_) {
- var setHasProfileShortcut = function(hasProfileShortcut) {
- this.hasProfileShortcut_ = hasProfileShortcut;
- }.bind(this);
- this.browserProxy_.getHasProfileShortcut().then(setHasProfileShortcut);
+ if (loadTimeData.getBoolean('profileShortcutsEnabled')) {
+ this.browserProxy_.getProfileShortcutStatus().then(function(status) {
+ if (status == ProfileShortcutStatus.PROFILE_SHORTCUT_SETTING_HIDDEN) {
+ this.isProfileShortcutSettingVisible_ = false;
+ return;
+ }
+
+ this.isProfileShortcutSettingVisible_ = true;
+ this.hasProfileShortcut_ =
+ status == ProfileShortcutStatus.PROFILE_SHORTCUT_FOUND;
+ }.bind(this));
}
}
},

Powered by Google App Engine
This is Rietveld 408576698