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

Unified Diff: chrome/browser/ui/webui/policy_ui.cc

Issue 1052943002: Added device naming information to chrome://policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments Created 5 years, 8 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/ui/webui/policy_ui.cc
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index 50bf8deaa49097e6818243a26c4cad1ffa3e796a..c86874b3b25ffa06c48ce40e6f0a3876159a5f3e 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -90,6 +90,10 @@ content::WebUIDataSource* CreatePolicyUIHTMLSource() {
source->AddLocalizedString("labelDomain", IDS_POLICY_LABEL_DOMAIN);
source->AddLocalizedString("labelUsername", IDS_POLICY_LABEL_USERNAME);
source->AddLocalizedString("labelClientId", IDS_POLICY_LABEL_CLIENT_ID);
+ source->AddLocalizedString("labelAssetId", IDS_POLICY_LABEL_ASSET_ID);
+ source->AddLocalizedString("labelLocation", IDS_POLICY_LABEL_LOCATION);
+ source->AddLocalizedString("labelDirectoryApiId",
+ IDS_POLICY_LABEL_DIRECTORY_API_ID);
source->AddLocalizedString("labelTimeSinceLastRefresh",
IDS_POLICY_LABEL_TIME_SINCE_LAST_REFRESH);
source->AddLocalizedString("labelRefreshInterval",
@@ -168,6 +172,12 @@ void GetStatusFromCore(const policy::CloudPolicyCore* core,
const em::PolicyData* policy = store->policy();
std::string client_id = policy ? policy->device_id() : std::string();
std::string username = policy ? policy->username() : std::string();
+ std::string asset_id = (policy && policy->has_annotated_asset_id()) ?
+ policy->annotated_asset_id() : std::string("Not Specified");
Nikita (slow) 2015/04/14 13:21:39 This should be a localized string (here and below)
Polina Bondarenko 2015/04/14 16:41:34 Done, but I'm not sure that I fixed it as expected
Nikita (slow) 2015/04/15 09:06:25 Right, this string should be up for translation.
+ std::string location = (policy && policy->has_annotated_location()) ?
+ policy->annotated_location() : std::string("Not Specified");
+ std::string directory_api_id = (policy && policy->has_directory_api_id()) ?
+ policy->directory_api_id() : std::string("Not Specified");
base::TimeDelta refresh_interval =
base::TimeDelta::FromMilliseconds(refresh_scheduler ?
refresh_scheduler->refresh_delay() :
@@ -181,6 +191,9 @@ void GetStatusFromCore(const policy::CloudPolicyCore* core,
dict->SetString("status", status);
dict->SetString("clientId", client_id);
dict->SetString("username", username);
+ dict->SetString("assetId", asset_id);
+ dict->SetString("location", location);
+ dict->SetString("directoryApiId", directory_api_id);
dict->SetString("refreshInterval",
ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_DURATION,
ui::TimeFormat::LENGTH_SHORT,

Powered by Google App Engine
This is Rietveld 408576698