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

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: 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..03db81b81aecaa1d94d51a6ffdb87a9b10f5d461 100644
--- a/chrome/browser/resources/settings/people_page/manage_profile.js
+++ b/chrome/browser/resources/settings/people_page/manage_profile.js
@@ -55,15 +55,9 @@ Polymer({
/**
* True if the profile shortcuts feature is enabled.
- * @private
+ * @private {boolean}
*/
- isProfileShortcutsEnabled_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('profileShortcutsEnabled');
- },
- readOnly: true,
- },
+ isProfileShortcutSettingVisible_: false,
Dan Beam 2016/11/23 00:29:16 this should either be isProfileShortcutSettingVis
tommycli 2016/11/23 19:00:46 Done.
},
/** @override */
@@ -81,11 +75,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