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

Unified 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: Add comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/system/mock_statistics_provider.cc ('k') | chromeos/system/statistics_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/system/statistics_provider.h
diff --git a/chrome/browser/chromeos/system/statistics_provider.h b/chromeos/system/statistics_provider.h
similarity index 37%
rename from chrome/browser/chromeos/system/statistics_provider.h
rename to chromeos/system/statistics_provider.h
index 35ab756426964492f18bd0c9d81f13538f4d3f09..d7e9619976149101adca78f4b033a1fa45aa2873 100644
--- a/chrome/browser/chromeos/system/statistics_provider.h
+++ b/chromeos/system/statistics_provider.h
@@ -2,64 +2,76 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
-#define CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
+#ifndef CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
+#define CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
#include <string>
+#include "base/memory/ref_counted.h"
+#include "chromeos/chromeos_export.h"
+
+namespace base {
+class TaskRunner;
+}
+
namespace chromeos {
namespace system {
// Developer switch value.
-extern const char kDevSwitchBootMode[];
+CHROMEOS_EXPORT extern const char kDevSwitchBootMode[];
// HWID key.
-extern const char kHardwareClass[];
+CHROMEOS_EXPORT extern const char kHardwareClassKey[];
// OEM customization flag that permits exiting enterprise enrollment flow in
// OOBE when 'oem_enterprise_managed' flag is set.
-extern const char kOemCanExitEnterpriseEnrollmentKey[];
+CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[];
// OEM customization directive that specified intended device purpose.
-extern const char kOemDeviceRequisitionKey[];
+CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[];
// OEM customization flag that enforces enterprise enrollment flow in OOBE.
-extern const char kOemIsEnterpriseManagedKey[];
+CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[];
// OEM customization flag that specifies if OOBE flow should be enhanced for
// keyboard driven control.
-extern const char kOemKeyboardDrivenOobeKey[];
+CHROMEOS_EXPORT extern const char kOemKeyboardDrivenOobeKey[];
// Offer coupon code key.
-extern const char kOffersCouponCodeKey[];
+CHROMEOS_EXPORT extern const char kOffersCouponCodeKey[];
// Offer group key.
-extern const char kOffersGroupCodeKey[];
+CHROMEOS_EXPORT extern const char kOffersGroupCodeKey[];
// This interface provides access to Chrome OS statistics.
-class StatisticsProvider {
+class CHROMEOS_EXPORT StatisticsProvider {
public:
- // Initializes the statistics provider.
- virtual void Init() = 0;
-
- // Starts loading the machine statistcs.
- virtual void StartLoadingMachineStatistics() = 0;
-
- // Retrieve the named machine statistic (e.g. "hardware_class").
- // This does not update the statistcs. If the |name| is not set, |result|
- // preserves old value.
+ // Starts loading the machine statistics. File operations are performed on
+ // |file_task_runner|.
+ virtual void StartLoadingMachineStatistics(
+ const scoped_refptr<base::TaskRunner>& file_task_runner,
+ bool load_oem_manifest) = 0;
+
+ // Retrieves the named machine statistic (e.g. "hardware_class"). If |name|
+ // is found, sets |result| and returns true. Safe to call from any thread
+ // except the task runner passed to Initialize() (e.g. FILE). This may block
+ // if called early before the statistics are loaded from disk.
+ // StartLoadingMachineStatistics() must be called before this.
virtual bool GetMachineStatistic(const std::string& name,
std::string* result) = 0;
- // Retrieve boolean value for named machine flag.
- virtual bool GetMachineFlag(const std::string& name,
- bool* result) = 0;
+ // Similar to GetMachineStatistic for boolean flags.
+ virtual bool GetMachineFlag(const std::string& name, bool* result) = 0;
- // Loads kiosk oem manifest file.
- virtual void LoadOemManifest() = 0;
+ // Cancels any pending file operations.
+ virtual void Shutdown() = 0;
+ // Get the Singleton instance.
static StatisticsProvider* GetInstance();
+ // Set the instance returned by GetInstance() for testing.
+ static void SetTestProvider(StatisticsProvider* test_provider);
+
protected:
virtual ~StatisticsProvider() {}
};
@@ -67,4 +79,4 @@ class StatisticsProvider {
} // namespace system
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
+#endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_
« no previous file with comments | « chromeos/system/mock_statistics_provider.cc ('k') | chromeos/system/statistics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698