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

Unified Diff: chrome/browser/chromeos/extensions/info_private_api.cc

Issue 2686233006: Add managed device signal (Closed)
Patch Set: Minor comments change Created 3 years, 10 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/chromeos/extensions/info_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/info_private_api.cc b/chrome/browser/chromeos/extensions/info_private_api.cc
index 3eb609e93a46de44e2cba84f19595badaa776f3b..4bfbdc0f8e923b87eaede8ff8f23cdafa78d7d81 100644
--- a/chrome/browser/chromeos/extensions/info_private_api.cc
+++ b/chrome/browser/chromeos/extensions/info_private_api.cc
@@ -135,6 +135,17 @@ const char kPlayStoreStatusAvailable[] = "available";
// JS.
const char kPlayStoreStatusEnabled[] = "enabled";
+// Key which corresponds to the managedDeviceStatus property in JS.
+const char kPropertyManagedDeviceStatus[] = "managedDeviceStatus";
+
+// Key which corresponds to the "not mananged" value of the ManagedDeviceStatus
tbarzic 2017/02/22 02:18:35 nit: This is not really a key - it's a managedDevi
Wenzhao (Colin) Zang 2017/02/22 03:11:06 Done.
+// enum in JS.
+const char kManagedDeviceStatusNotManaged[] = "not managed";
+
+// Key which corresponds to the "managed" value of the ManagedDeviceStatus
tbarzic 2017/02/22 02:18:35 ditto
Wenzhao (Colin) Zang 2017/02/22 03:11:06 Done.
+// enum in JS.
+const char kManagedDeviceStatusManaged[] = "managed";
+
const struct {
const char* api_name;
const char* preference_name;
@@ -268,6 +279,16 @@ base::Value* ChromeosInfoPrivateGetFunction::GetValue(
return new base::StringValue(kPlayStoreStatusNotAvailable);
}
+ if (property_name == kPropertyManagedDeviceStatus) {
+ policy::BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()->browser_policy_connector_chromeos();
+ if (connector->IsEnterpriseManaged()) {
+ return new base::StringValue(kManagedDeviceStatusManaged);
+ } else {
tbarzic 2017/02/22 02:18:35 nit: no else after return, and no {}
Wenzhao (Colin) Zang 2017/02/22 03:11:06 Done.
+ return new base::StringValue(kManagedDeviceStatusNotManaged);
+ }
+ }
+
if (property_name == kPropertyClientId) {
return new base::StringValue(GetClientId());
}

Powered by Google App Engine
This is Rietveld 408576698