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

Unified Diff: components/proximity_auth/webui/resources/local-state.js

Issue 1264703003: Implement debugging local unlock keys in chrome://proximity-auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + fixes Created 5 years, 5 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: components/proximity_auth/webui/resources/local-state.js
diff --git a/components/proximity_auth/webui/resources/local-state.js b/components/proximity_auth/webui/resources/local-state.js
index d606820b0ad4c57462634f76810839e73da213fa..865d203a5e8c9c7ff1eaa0650416bcb611c1e334 100644
--- a/components/proximity_auth/webui/resources/local-state.js
+++ b/components/proximity_auth/webui/resources/local-state.js
@@ -67,8 +67,8 @@ Polymer({
* Called when the page is about to be shown.
*/
activate: function() {
- SyncStateInterface = this;
- chrome.send('getSyncStates');
+ LocalStateInterface = this;
+ chrome.send('getLocalState');
},
/**
@@ -102,13 +102,23 @@ Polymer({
},
/**
+ * Called when the locally stored unlock keys change.
+ * @param {Array<DeviceInfo>} unlockKeys
+ */
+ onUnlockKeysChanged: function(unlockKeys) {
+ this.unlockKeys_ = unlockKeys;
+ },
+
+ /**
* Called for the chrome.send('getSyncStates') response.
* @param {SyncState} enrollmentState
* @param {SyncState} deviceSyncState
+ * @param {Array<DeviceInfo>} unlockKeys
*/
- onGotSyncStates: function(enrollmentState, deviceSyncState) {
+ onGotLocalState: function(enrollmentState, deviceSyncState, unlockKeys) {
this.enrollmentState_ = enrollmentState;
this.deviceSyncState_ = deviceSyncState;
+ this.unlockKeys_ = unlockKeys;
},
/**
@@ -170,9 +180,12 @@ Polymer({
},
});
-// Interface with the native WebUI component for the CryptAuthSync state (i.e.
-// enrollment and device sync).
-SyncStateInterface = {
+// Interface with the native WebUI component for getting the local state and
+// being notified when the local state changes.
+// The local state refers to state stored on the device rather than online in
+// CryptAuth. This state includes the enrollment and device sync states, as well
+// as the list of unlock keys.
+LocalStateInterface = {
/**
* Called when the enrollment state changes. For example, when a new
* enrollment is initiated.
@@ -188,9 +201,14 @@ SyncStateInterface = {
onDeviceSyncStateChanged: function(deviceSyncState) {},
/**
- * Called in response to chrome.send('getSyncStates') with the current
- * enrollment and device sync states of the user and device.
- * @type {function(SyncState, SyncState)}
+ * Called when the locally stored unlock keys changes.
+ * @type {function(Array<DeviceInfo>)}
+ */
+ onUnlockKeysChanged: function(unlockKeys) {},
+
+ /**
+ * Called in response to chrome.send('getLocalState') with the local state.
+ * @type {function(SyncState, SyncState, Array<DeviceInfo>)}
*/
- onGotSyncStates: function(enrollmentState, deviceSyncState) {},
+ onGotLocalState: function(enrollmentState, deviceSyncState, unlockKeys) {},
};
« no previous file with comments | « components/proximity_auth/webui/resources/device-list.js ('k') | components/proximity_auth/webui/resources/log-panel.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698