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

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

Issue 2498153002: [MD Settings][MD User Manager] create/manage profile desktop shortcut (Windows only) (Closed)
Patch Set: Addressed comments 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 740d4b3eeae7307e7968b8962e5132c954d5f81d..898085276ba0b88190ddbb50e665094d7656afba 100644
--- a/chrome/browser/resources/settings/people_page/manage_profile.js
+++ b/chrome/browser/resources/settings/people_page/manage_profile.js
@@ -24,6 +24,11 @@ Polymer({
profileName: String,
/**
+ * True if the current profile has a shortcut.
+ */
+ hasProfileShortcut_: Boolean,
+
+ /**
* The available icons for selection.
* @type {!Array<string>}
*/
@@ -47,6 +52,18 @@ Polymer({
return settings.ManageProfileBrowserProxyImpl.getInstance();
},
},
+
+ /**
+ * True if the profile shortcuts feature is enabled.
+ * @private
+ */
+ isProfileShortcutsEnabled_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('profileShortcutsEnabled');
+ },
+ readOnly: true,
+ },
},
/** @override */
@@ -61,8 +78,16 @@ Polymer({
/** @protected */
currentRouteChanged: function() {
- if (settings.getCurrentRoute() == settings.Route.MANAGE_PROFILE)
+ 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);
+ }
+ }
},
/**
@@ -96,4 +121,17 @@ Polymer({
isProfileNameDisabled_: function(syncStatus) {
return !!syncStatus.supervisedUser && !syncStatus.childUser;
},
+
+ /**
+ * Handler for when the profile shortcut toggle is changed.
+ * @param {!Event} event
+ * @private
+ */
+ onHasProfileShortcutChange_: function(event) {
+ if (this.hasProfileShortcut_) {
+ this.browserProxy_.addProfileShortcut();
+ } else {
+ this.browserProxy_.removeProfileShortcut();
+ }
+ }
});

Powered by Google App Engine
This is Rietveld 408576698