Commit 1ef25cff authored by Sergey Poromov's avatar Sergey Poromov Committed by Commit Bot

Add user GAIA ID to chrome://policy

GAIA ID is now provided as part of PolicyData for user policies.
It could be exposed together with user email if it's OK from privacy
perspective.
It will be useful because username field doesn't change on user rename
and GAIA ID is now used for PolicyData user identification.

BUG=831655
TEST=Open chrome://policy

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ia4cfea54c80a2a5cfa7f9e8803f7ca50f9596c70
Reviewed-on: https://chromium-review.googlesource.com/1016903Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarDrew Wilson <atwilson@chromium.org>
Commit-Queue: Sergey Poromov <poromov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551706}
parent 835b2491
......@@ -66,6 +66,10 @@
<div class="label">$i18n{labelUsername}</div>
<div class="username"></div>
</div>
<div class="status-entry" hidden>
<div class="label">$i18n{labelGaiaId}</div>
<div class="gaia-id"></div>
</div>
<div class="status-entry">
<div class="label">$i18n{labelClientId}</div>
<div class="client-id"></div>
......
......@@ -81,6 +81,11 @@ cr.define('policy', function() {
var username = this.querySelector('.username');
username.textContent = status.username;
username.parentElement.hidden = false;
// Populate the user gaia id.
var gaiaId = this.querySelector('.gaia-id');
gaiaId.textContent =
status.gaiaId || loadTimeData.getString('notSpecified');
gaiaId.parentElement.hidden = false;
}
// Populate all remaining items.
this.querySelector('.client-id').textContent = status.clientId || '';
......
......@@ -32,6 +32,7 @@ content::WebUIDataSource* CreatePolicyUIHtmlSource() {
source->AddLocalizedString("labelEnterpriseDisplayDomain",
IDS_POLICY_LABEL_ENTERPRISE_DISPLAY_DOMAIN);
source->AddLocalizedString("labelUsername", IDS_POLICY_LABEL_USERNAME);
source->AddLocalizedString("labelGaiaId", IDS_POLICY_LABEL_GAIA_ID);
source->AddLocalizedString("labelClientId", IDS_POLICY_LABEL_CLIENT_ID);
source->AddLocalizedString("labelAssetId", IDS_POLICY_LABEL_ASSET_ID);
source->AddLocalizedString("labelLocation", IDS_POLICY_LABEL_LOCATION);
......
......@@ -143,6 +143,8 @@ void GetStatusFromCore(const policy::CloudPolicyCore* core,
dict->SetString("location", policy->annotated_location());
if (policy && policy->has_directory_api_id())
dict->SetString("directoryApiId", policy->directory_api_id());
if (policy && policy->has_gaia_id())
dict->SetString("gaiaId", policy->gaia_id());
base::TimeDelta refresh_interval =
base::TimeDelta::FromMilliseconds(refresh_scheduler ?
......
......@@ -313,6 +313,9 @@
<message name="IDS_POLICY_LABEL_USERNAME" desc="Label for the username in the user policy status box.">
User:
</message>
<message name="IDS_POLICY_LABEL_GAIA_ID" desc="Label for the user GAIA ID in the user policy status box.">
Gaia ID:
</message>
<message name="IDS_POLICY_LABEL_CLIENT_ID" desc="Label for the client IDs in the policy status boxes.">
Client ID:
</message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment