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

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

Issue 2686233006: Add managed device signal (Closed)
Patch Set: Add callback 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..65202fd6c909104efeba2c473269fa7dc138f5f3 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";
+
+// Property indicating an unmanaged device, which corresponds to the "not
tbarzic 2017/02/22 06:55:27 how about: "Value to which managedDeviceStatus pro
Wenzhao (Colin) Zang 2017/02/22 20:30:56 Done.
+// mananged" value of the ManagedDeviceStatus enum in JS.
+const char kManagedDeviceStatusNotManaged[] = "not managed";
+
+// Property indicating a managed device, which corresponds to the "managed"
+// value of the ManagedDeviceStatus enum in JS.
+const char kManagedDeviceStatusManaged[] = "managed";
+
const struct {
const char* api_name;
const char* preference_name;
@@ -268,6 +279,15 @@ 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()) {
tbarzic 2017/02/22 06:55:27 nit: no {} here
Wenzhao (Colin) Zang 2017/02/22 20:30:56 Done. Out of curiosity, is there a reason why in g
+ return new base::StringValue(kManagedDeviceStatusManaged);
+ }
+ return new base::StringValue(kManagedDeviceStatusNotManaged);
+ }
+
if (property_name == kPropertyClientId) {
return new base::StringValue(GetClientId());
}

Powered by Google App Engine
This is Rietveld 408576698