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

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

Issue 2686233006: Add managed device signal (Closed)
Patch Set: Minor changes in comments 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/info_private_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c023ece9a493a6e18b20b36f1e7a36d6583a37f9 100644
--- a/chrome/browser/chromeos/extensions/info_private_api.cc
+++ b/chrome/browser/chromeos/extensions/info_private_api.cc
@@ -135,6 +135,15 @@ const char kPlayStoreStatusAvailable[] = "available";
// JS.
const char kPlayStoreStatusEnabled[] = "enabled";
+// Key which corresponds to the managedDeviceStatus property in JS.
+const char kPropertyManagedDeviceStatus[] = "managedDeviceStatus";
+
+// Value to which managedDeviceStatus property is set for unmanaged devices.
+const char kManagedDeviceStatusNotManaged[] = "not managed";
+
+// Value to which managedDeviceStatus property is set for managed devices.
+const char kManagedDeviceStatusManaged[] = "managed";
+
const struct {
const char* api_name;
const char* preference_name;
@@ -268,6 +277,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()) {
+ return new base::StringValue(kManagedDeviceStatusManaged);
+ }
+ return new base::StringValue(kManagedDeviceStatusNotManaged);
+ }
+
if (property_name == kPropertyClientId) {
return new base::StringValue(GetClientId());
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/info_private_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698