| 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 |
| 11 #include "base/command_line.h" | |
| 12 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
| 13 #include "base/values.h" | 12 #include "base/values.h" |
| 14 #include "chrome/browser/app_mode/app_mode_utils.h" | 13 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 15 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 15 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 17 #include "chrome/browser/chromeos/login/startup_utils.h" | 16 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 18 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 17 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 19 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 20 #include "chrome/browser/chromeos/system/timezone_util.h" | 19 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 23 #include "chromeos/network/device_state.h" | 22 #include "chromeos/network/device_state.h" |
| 24 #include "chromeos/network/network_handler.h" | 23 #include "chromeos/network/network_handler.h" |
| 25 #include "chromeos/network/network_state_handler.h" | 24 #include "chromeos/network/network_state_handler.h" |
| 26 #include "chromeos/settings/cros_settings_names.h" | 25 #include "chromeos/settings/cros_settings_names.h" |
| 27 #include "chromeos/system/statistics_provider.h" | 26 #include "chromeos/system/statistics_provider.h" |
| 28 #include "components/arc/arc_bridge_service.h" | 27 #include "components/arc/arc_util.h" |
| 29 #include "components/metrics/metrics_service.h" | 28 #include "components/metrics/metrics_service.h" |
| 30 #include "components/prefs/pref_service.h" | 29 #include "components/prefs/pref_service.h" |
| 31 #include "components/user_manager/user_manager.h" | 30 #include "components/user_manager/user_manager.h" |
| 32 #include "extensions/browser/extensions_browser_client.h" | 31 #include "extensions/browser/extensions_browser_client.h" |
| 33 #include "extensions/common/error_utils.h" | 32 #include "extensions/common/error_utils.h" |
| 34 #include "third_party/cros_system_api/dbus/service_constants.h" | 33 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 35 | 34 |
| 36 using chromeos::NetworkHandler; | 35 using chromeos::NetworkHandler; |
| 37 | 36 |
| 38 namespace extensions { | 37 namespace extensions { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 if (ExtensionsBrowserClient::Get()->IsLoggedInAsPublicAccount()) | 258 if (ExtensionsBrowserClient::Get()->IsLoggedInAsPublicAccount()) |
| 260 return new base::StringValue(kSessionTypePublicSession); | 259 return new base::StringValue(kSessionTypePublicSession); |
| 261 return new base::StringValue(kSessionTypeNormal); | 260 return new base::StringValue(kSessionTypeNormal); |
| 262 } | 261 } |
| 263 | 262 |
| 264 if (property_name == kPropertyPlayStoreStatus) { | 263 if (property_name == kPropertyPlayStoreStatus) { |
| 265 if (arc::ArcSessionManager::IsAllowedForProfile( | 264 if (arc::ArcSessionManager::IsAllowedForProfile( |
| 266 Profile::FromBrowserContext(context_))) { | 265 Profile::FromBrowserContext(context_))) { |
| 267 return new base::StringValue(kPlayStoreStatusEnabled); | 266 return new base::StringValue(kPlayStoreStatusEnabled); |
| 268 } | 267 } |
| 269 if (arc::ArcBridgeService::GetAvailable( | 268 if (arc::IsArcAvailable()) |
| 270 base::CommandLine::ForCurrentProcess())) { | |
| 271 return new base::StringValue(kPlayStoreStatusAvailable); | 269 return new base::StringValue(kPlayStoreStatusAvailable); |
| 272 } | |
| 273 return new base::StringValue(kPlayStoreStatusNotAvailable); | 270 return new base::StringValue(kPlayStoreStatusNotAvailable); |
| 274 } | 271 } |
| 275 | 272 |
| 276 if (property_name == kPropertyClientId) { | 273 if (property_name == kPropertyClientId) { |
| 277 return new base::StringValue(GetClientId()); | 274 return new base::StringValue(GetClientId()); |
| 278 } | 275 } |
| 279 | 276 |
| 280 if (property_name == kPropertyTimezone) { | 277 if (property_name == kPropertyTimezone) { |
| 281 return chromeos::CrosSettings::Get()->GetPref( | 278 return chromeos::CrosSettings::Get()->GetPref( |
| 282 chromeos::kSystemTimezone)->DeepCopy(); | 279 chromeos::kSystemTimezone)->DeepCopy(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 param_value); | 320 param_value); |
| 324 } else { | 321 } else { |
| 325 return RespondNow(Error(kPropertyNotFound, param_name)); | 322 return RespondNow(Error(kPropertyNotFound, param_name)); |
| 326 } | 323 } |
| 327 } | 324 } |
| 328 | 325 |
| 329 return RespondNow(NoArguments()); | 326 return RespondNow(NoArguments()); |
| 330 } | 327 } |
| 331 | 328 |
| 332 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |