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

Unified Diff: components/proximity_auth/webui/resources/proximity_auth.js

Issue 2953863002: [CrOS Tether] ProximityAuth WebUI improvement: show the local device's ID. (Closed)
Patch Set: Rebased. Created 3 years, 6 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/proximity_auth.js
diff --git a/components/proximity_auth/webui/resources/proximity_auth.js b/components/proximity_auth/webui/resources/proximity_auth.js
index c9d1928f7af9410bb9fae2ef98b226129d23f023..764c6ae06f21aa38a42e783055b110ef0f88bdf0 100644
--- a/components/proximity_auth/webui/resources/proximity_auth.js
+++ b/components/proximity_auth/webui/resources/proximity_auth.js
@@ -26,7 +26,7 @@ ProximityAuth = {
class CryptAuthController {
constructor() {
this.elements_ = {
- publicKey: document.getElementById('public-key'),
+ localDeviceId: document.getElementById('local-device-id'),
gcmRegistration: document.getElementById('gcm-registration'),
currentEid: document.getElementById('current-eid'),
enrollmentTitle: document.getElementById('enrollment-title'),
@@ -43,6 +43,14 @@ class CryptAuthController {
this.elements_.deviceSyncButton.onclick = this.forceDeviceSync_.bind(this);
}
+ /**
+ * Sets the local device's ID. Note that this value is truncated since the
+ * full value is very long and does not cleanly fit on the screen.
+ */
+ setLocalDeviceId(deviceIdTruncated) {
+ this.elements_.localDeviceId.textContent = deviceIdTruncated;
+ }
+
/**
* Update the enrollment state in the UI.
*/
@@ -253,12 +261,18 @@ class EligibleDevicesController {
* Interface for the native WebUI to call into our JS.
*/
LocalStateInterface = {
- onGotLocalState: function(enrollmentState, deviceSyncState, remoteDevices) {
+ onGotLocalState: function(
+ localDeviceId, enrollmentState, deviceSyncState, remoteDevices) {
+ LocalStateInterface.setLocalDeviceId(localDeviceId);
LocalStateInterface.onEnrollmentStateChanged(enrollmentState);
LocalStateInterface.onDeviceSyncStateChanged(deviceSyncState);
LocalStateInterface.onRemoteDevicesChanged(remoteDevices);
},
+ setLocalDeviceId: function(localDeviceId) {
+ ProximityAuth.cryptauthController_.setLocalDeviceId(localDeviceId);
+ },
+
onEnrollmentStateChanged: function(enrollmentState) {
ProximityAuth.cryptauthController_.updateEnrollmentState(enrollmentState);
},

Powered by Google App Engine
This is Rietveld 408576698