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..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()); |
| } |