Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/extensions/info_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/info_private_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 const char kPlayStoreStatusNotAvailable[] = "not available"; | 128 const char kPlayStoreStatusNotAvailable[] = "not available"; |
| 129 | 129 |
| 130 // Key which corresponds to the "available" value of the PlayStoreStatus enum in | 130 // Key which corresponds to the "available" value of the PlayStoreStatus enum in |
| 131 // JS. | 131 // JS. |
| 132 const char kPlayStoreStatusAvailable[] = "available"; | 132 const char kPlayStoreStatusAvailable[] = "available"; |
| 133 | 133 |
| 134 // Key which corresponds to the "enabled" value of the PlayStoreStatus enum in | 134 // Key which corresponds to the "enabled" value of the PlayStoreStatus enum in |
| 135 // JS. | 135 // JS. |
| 136 const char kPlayStoreStatusEnabled[] = "enabled"; | 136 const char kPlayStoreStatusEnabled[] = "enabled"; |
| 137 | 137 |
| 138 // Key which corresponds to the managedDeviceStatus property in JS. | |
| 139 const char kPropertyManagedDeviceStatus[] = "managedDeviceStatus"; | |
| 140 | |
| 141 // 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.
| |
| 142 // mananged" value of the ManagedDeviceStatus enum in JS. | |
| 143 const char kManagedDeviceStatusNotManaged[] = "not managed"; | |
| 144 | |
| 145 // Property indicating a managed device, which corresponds to the "managed" | |
| 146 // value of the ManagedDeviceStatus enum in JS. | |
| 147 const char kManagedDeviceStatusManaged[] = "managed"; | |
| 148 | |
| 138 const struct { | 149 const struct { |
| 139 const char* api_name; | 150 const char* api_name; |
| 140 const char* preference_name; | 151 const char* preference_name; |
| 141 } kPreferencesMap[] = { | 152 } kPreferencesMap[] = { |
| 142 {kPropertyLargeCursorEnabled, prefs::kAccessibilityLargeCursorEnabled}, | 153 {kPropertyLargeCursorEnabled, prefs::kAccessibilityLargeCursorEnabled}, |
| 143 {kPropertyStickyKeysEnabled, prefs::kAccessibilityStickyKeysEnabled}, | 154 {kPropertyStickyKeysEnabled, prefs::kAccessibilityStickyKeysEnabled}, |
| 144 {kPropertySpokenFeedbackEnabled, | 155 {kPropertySpokenFeedbackEnabled, |
| 145 prefs::kAccessibilitySpokenFeedbackEnabled}, | 156 prefs::kAccessibilitySpokenFeedbackEnabled}, |
| 146 {kPropertyHighContrastEnabled, prefs::kAccessibilityHighContrastEnabled}, | 157 {kPropertyHighContrastEnabled, prefs::kAccessibilityHighContrastEnabled}, |
| 147 {kPropertyScreenMagnifierEnabled, | 158 {kPropertyScreenMagnifierEnabled, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 } | 272 } |
| 262 | 273 |
| 263 if (property_name == kPropertyPlayStoreStatus) { | 274 if (property_name == kPropertyPlayStoreStatus) { |
| 264 if (arc::IsArcAllowedForProfile(Profile::FromBrowserContext(context_))) | 275 if (arc::IsArcAllowedForProfile(Profile::FromBrowserContext(context_))) |
| 265 return new base::StringValue(kPlayStoreStatusEnabled); | 276 return new base::StringValue(kPlayStoreStatusEnabled); |
| 266 if (arc::IsArcAvailable()) | 277 if (arc::IsArcAvailable()) |
| 267 return new base::StringValue(kPlayStoreStatusAvailable); | 278 return new base::StringValue(kPlayStoreStatusAvailable); |
| 268 return new base::StringValue(kPlayStoreStatusNotAvailable); | 279 return new base::StringValue(kPlayStoreStatusNotAvailable); |
| 269 } | 280 } |
| 270 | 281 |
| 282 if (property_name == kPropertyManagedDeviceStatus) { | |
| 283 policy::BrowserPolicyConnectorChromeOS* connector = | |
| 284 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
| 285 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
| |
| 286 return new base::StringValue(kManagedDeviceStatusManaged); | |
| 287 } | |
| 288 return new base::StringValue(kManagedDeviceStatusNotManaged); | |
| 289 } | |
| 290 | |
| 271 if (property_name == kPropertyClientId) { | 291 if (property_name == kPropertyClientId) { |
| 272 return new base::StringValue(GetClientId()); | 292 return new base::StringValue(GetClientId()); |
| 273 } | 293 } |
| 274 | 294 |
| 275 if (property_name == kPropertyTimezone) { | 295 if (property_name == kPropertyTimezone) { |
| 276 return chromeos::CrosSettings::Get()->GetPref( | 296 return chromeos::CrosSettings::Get()->GetPref( |
| 277 chromeos::kSystemTimezone)->DeepCopy(); | 297 chromeos::kSystemTimezone)->DeepCopy(); |
| 278 } | 298 } |
| 279 | 299 |
| 280 if (property_name == kPropertySupportedTimezones) { | 300 if (property_name == kPropertySupportedTimezones) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 param_value); | 338 param_value); |
| 319 } else { | 339 } else { |
| 320 return RespondNow(Error(kPropertyNotFound, param_name)); | 340 return RespondNow(Error(kPropertyNotFound, param_name)); |
| 321 } | 341 } |
| 322 } | 342 } |
| 323 | 343 |
| 324 return RespondNow(NoArguments()); | 344 return RespondNow(NoArguments()); |
| 325 } | 345 } |
| 326 | 346 |
| 327 } // namespace extensions | 347 } // namespace extensions |
| OLD | NEW |