Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: chromeos/system/statistics_provider.h

Issue 25112004: Move statistics_provider to chromeos/system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, fix DeviceManagement Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ 5 #ifndef CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ 6 #define CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h"
11 #include "chromeos/chromeos_export.h"
12
13 namespace base {
14 class TaskRunner;
15 }
16
10 namespace chromeos { 17 namespace chromeos {
11 namespace system { 18 namespace system {
12 19
13 // Developer switch value. 20 // Developer switch value.
14 extern const char kDevSwitchBootMode[]; 21 CHROMEOS_EXPORT extern const char kDevSwitchBootMode[];
15 22
16 // HWID key. 23 // HWID key.
17 extern const char kHardwareClass[]; 24 CHROMEOS_EXPORT extern const char kHardwareClassKey[];
18 25
19 // OEM customization flag that permits exiting enterprise enrollment flow in 26 // OEM customization flag that permits exiting enterprise enrollment flow in
20 // OOBE when 'oem_enterprise_managed' flag is set. 27 // OOBE when 'oem_enterprise_managed' flag is set.
21 extern const char kOemCanExitEnterpriseEnrollmentKey[]; 28 CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[];
22 29
23 // OEM customization directive that specified intended device purpose. 30 // OEM customization directive that specified intended device purpose.
24 extern const char kOemDeviceRequisitionKey[]; 31 CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[];
25 32
26 // OEM customization flag that enforces enterprise enrollment flow in OOBE. 33 // OEM customization flag that enforces enterprise enrollment flow in OOBE.
27 extern const char kOemIsEnterpriseManagedKey[]; 34 CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[];
28 35
29 // OEM customization flag that specifies if OOBE flow should be enhanced for 36 // OEM customization flag that specifies if OOBE flow should be enhanced for
30 // keyboard driven control. 37 // keyboard driven control.
31 extern const char kOemKeyboardDrivenOobeKey[]; 38 CHROMEOS_EXPORT extern const char kOemKeyboardDrivenOobeKey[];
32 39
33 // Offer coupon code key. 40 // Offer coupon code key.
34 extern const char kOffersCouponCodeKey[]; 41 CHROMEOS_EXPORT extern const char kOffersCouponCodeKey[];
35 42
36 // Offer group key. 43 // Offer group key.
37 extern const char kOffersGroupCodeKey[]; 44 CHROMEOS_EXPORT extern const char kOffersGroupCodeKey[];
38 45
39 // This interface provides access to Chrome OS statistics. 46 // This interface provides access to Chrome OS statistics.
40 class StatisticsProvider { 47 class CHROMEOS_EXPORT StatisticsProvider {
41 public: 48 public:
42 // Initializes the statistics provider. 49 // Starts loading the machine statistics.
43 virtual void Init() = 0; 50 virtual void StartLoadingMachineStatistics(bool load_oem_manifest) = 0;
44
45 // Starts loading the machine statistcs.
46 virtual void StartLoadingMachineStatistics() = 0;
47 51
48 // Retrieve the named machine statistic (e.g. "hardware_class"). 52 // Retrieve the named machine statistic (e.g. "hardware_class").
49 // This does not update the statistcs. If the |name| is not set, |result| 53 // This does not update the statistcs. If the |name| is not set, |result|
50 // preserves old value. 54 // preserves old value.
satorux1 2013/10/02 01:36:55 You might want to document that this can be called
stevenjb 2013/10/03 01:17:23 Documentation updated.
51 virtual bool GetMachineStatistic(const std::string& name, 55 virtual bool GetMachineStatistic(const std::string& name,
52 std::string* result) = 0; 56 std::string* result) = 0;
53 57
54 // Retrieve boolean value for named machine flag. 58 // Retrieve boolean value for named machine flag.
satorux1 2013/10/02 01:36:55 You might want to document that this can be called
stevenjb 2013/10/03 01:17:23 Ditto.
55 virtual bool GetMachineFlag(const std::string& name, 59 virtual bool GetMachineFlag(const std::string& name, bool* result) = 0;
56 bool* result) = 0;
57 60
58 // Loads kiosk oem manifest file. 61 // Manage the singleton. Initialize must be called before GetInstance.
59 virtual void LoadOemManifest() = 0; 62 static void Initialize(const scoped_refptr<base::TaskRunner>& io_task_runner);
60 63 static void Shutdown();
61 static StatisticsProvider* GetInstance(); 64 static StatisticsProvider* GetInstance();
62 65
63 protected: 66 protected:
64 virtual ~StatisticsProvider() {} 67 virtual ~StatisticsProvider() {}
65 }; 68 };
66 69
67 } // namespace system 70 } // namespace system
68 } // namespace chromeos 71 } // namespace chromeos
69 72
70 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ 73 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698