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

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

Issue 1799913003: Settings People Revamp: Easy Unlock: Add basic UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 4 years, 9 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/settings/people_page/people_page.js
diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.js
index ba9d9e029b1242a25044f29ced1b61f57f2b60af..6e5f80d6878ac1deb02ed79d3c8d43808e5dc9cb 100644
--- a/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -18,6 +18,7 @@ Polymer({
behaviors: [
I18nBehavior,
+ WebUIListenerBehavior,
],
properties: {
@@ -54,13 +55,46 @@ Polymer({
* @private {string}
*/
profileName_: String,
+
+<if expr="chromeos">
+ /**
+ * True if Easy Unlock is allowed on this machine.
+ * @private {boolean}
+ */
+ easyUnlockAllowed_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('easyUnlockAllowed');
+ },
+ readOnly: true,
+ },
+
+ /**
+ * True if Easy Unlock is enabled.
+ * @private {boolean}
+ */
+ easyUnlockEnabled_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('easyUnlockEnabled');
+ },
+ },
+</if>
},
/** @override */
- created: function() {
+ attached: function() {
settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this));
settings.SyncPrivateApi.getSyncStatus(
this.handleSyncStatusFetched_.bind(this));
+
+<if expr="chromeos">
+ if (this.easyUnlockAllowed_) {
+ this.addWebUIListener(
+ 'easy-unlock-enabled-status',
+ this.handleEasyUnlockEnabledStatusChanged_.bind(this));
+ }
+</if>
},
/**
@@ -86,6 +120,16 @@ Polymer({
this.$.syncStatusText.innerHTML = syncStatus.statusText;
},
+<if expr="chromeos">
+ /**
+ * Handler for when the Easy Unlock enabled status has changed.
+ * @private
+ */
+ handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) {
+ this.easyUnlockEnabled_ = easyUnlockEnabled;
+ },
+</if>
+
/** @private */
onActionLinkTap_: function() {
settings.SyncPrivateApi.showSetupUI();
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.html ('k') | chrome/browser/signin/easy_unlock_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698