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/system/statistics_provider.h" | 5 #include "chrome/browser/chromeos/system/statistics_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "chromeos/app_mode/kiosk_oem_manifest_parser.h" | 18 #include "chrome/browser/chromeos/app_mode/kiosk_oem_manifest_parser.h" |
19 #include "chromeos/chromeos_constants.h" | 19 #include "chrome/browser/chromeos/system/name_value_pairs_parser.h" |
| 20 #include "chrome/common/child_process_logging.h" |
| 21 #include "chrome/common/chrome_constants.h" |
| 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/chrome_version_info.h" |
20 #include "chromeos/chromeos_switches.h" | 24 #include "chromeos/chromeos_switches.h" |
21 #include "chromeos/system/name_value_pairs_parser.h" | |
22 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
23 | 26 |
24 using content::BrowserThread; | 27 using content::BrowserThread; |
25 | 28 |
26 namespace chromeos { | 29 namespace chromeos { |
27 namespace system { | 30 namespace system { |
28 namespace { | 31 namespace { |
29 | 32 |
30 // Path to the tool used to get system info, and delimiters for the output | 33 // Path to the tool used to get system info, and delimiters for the output |
31 // format of the tool. | 34 // format of the tool. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 on_statistics_loaded_.Signal(); | 244 on_statistics_loaded_.Signal(); |
242 VLOG(1) << "Finished loading statistics"; | 245 VLOG(1) << "Finished loading statistics"; |
243 } | 246 } |
244 | 247 |
245 void StatisticsProviderImpl::LoadOemManifestFromFile( | 248 void StatisticsProviderImpl::LoadOemManifestFromFile( |
246 const base::FilePath& file) { | 249 const base::FilePath& file) { |
247 KioskOemManifestParser::Manifest oem_manifest; | 250 KioskOemManifestParser::Manifest oem_manifest; |
248 if (!KioskOemManifestParser::Load(file, &oem_manifest)) | 251 if (!KioskOemManifestParser::Load(file, &oem_manifest)) |
249 return; | 252 return; |
250 | 253 |
251 machine_info_[chromeos::kOemDeviceRequisitionKey] = | 254 machine_info_[chrome::kOemDeviceRequisitionKey] = |
252 oem_manifest.device_requisition; | 255 oem_manifest.device_requisition; |
253 machine_flags_[chromeos::kOemIsEnterpriseManagedKey] = | 256 machine_flags_[chrome::kOemIsEnterpriseManagedKey] = |
254 oem_manifest.enterprise_managed; | 257 oem_manifest.enterprise_managed; |
255 machine_flags_[chromeos::kOemCanExitEnterpriseEnrollmentKey] = | 258 machine_flags_[chrome::kOemCanExitEnterpriseEnrollmentKey] = |
256 oem_manifest.can_exit_enrollment; | 259 oem_manifest.can_exit_enrollment; |
257 machine_flags_[chromeos::kOemKeyboardDrivenOobeKey] = | 260 machine_flags_[chrome::kOemKeyboardDrivenOobeKey] = |
258 oem_manifest.keyboard_driven_oobe; | 261 oem_manifest.keyboard_driven_oobe; |
259 } | 262 } |
260 | 263 |
261 StatisticsProviderImpl* StatisticsProviderImpl::GetInstance() { | 264 StatisticsProviderImpl* StatisticsProviderImpl::GetInstance() { |
262 return Singleton<StatisticsProviderImpl, | 265 return Singleton<StatisticsProviderImpl, |
263 DefaultSingletonTraits<StatisticsProviderImpl> >::get(); | 266 DefaultSingletonTraits<StatisticsProviderImpl> >::get(); |
264 } | 267 } |
265 | 268 |
266 // The stub StatisticsProvider implementation used on Linux desktop. | 269 // The stub StatisticsProvider implementation used on Linux desktop. |
267 class StatisticsProviderStubImpl : public StatisticsProviderImpl { | 270 class StatisticsProviderStubImpl : public StatisticsProviderImpl { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 StatisticsProvider* StatisticsProvider::GetInstance() { | 319 StatisticsProvider* StatisticsProvider::GetInstance() { |
317 if (base::chromeos::IsRunningOnChromeOS()) { | 320 if (base::chromeos::IsRunningOnChromeOS()) { |
318 return StatisticsProviderImpl::GetInstance(); | 321 return StatisticsProviderImpl::GetInstance(); |
319 } else { | 322 } else { |
320 return StatisticsProviderStubImpl::GetInstance(); | 323 return StatisticsProviderStubImpl::GetInstance(); |
321 } | 324 } |
322 } | 325 } |
323 | 326 |
324 } // namespace system | 327 } // namespace system |
325 } // namespace chromeos | 328 } // namespace chromeos |
OLD | NEW |