Chromium Code Reviews| 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()); |
| } |