Index: chromeos/system/fake_statistics_provider.h |
diff --git a/chromeos/system/fake_statistics_provider.h b/chromeos/system/fake_statistics_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8d9cd8423cf8c4cde6c98e60cda14f3456e56b48 |
--- /dev/null |
+++ b/chromeos/system/fake_statistics_provider.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |
+#define CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "chromeos/system/statistics_provider.h" |
+ |
+namespace chromeos { |
+namespace system { |
+ |
+// Custom StatisticsProvider that will return each set of region settings. |
+class FakeStatisticsProvider : public StatisticsProvider { |
+ public: |
+ virtual ~FakeStatisticsProvider() {} |
Dmitry Polukhin
2014/10/03 07:49:52
Missing OVERRIDE.
Alexander Alekseev
2014/10/03 12:59:17
Done.
|
+ |
+ void set_locale(const std::string& locale) { initial_locale_ = locale; } |
+ |
+ void set_keyboard_layout(const std::string& keyboard_layout) { |
+ keyboard_layout_ = keyboard_layout; |
+ } |
+ |
+ private: |
+ // StatisticsProvider overrides. |
+ virtual void StartLoadingMachineStatistics( |
+ const scoped_refptr<base::TaskRunner>& file_task_runner, |
+ bool load_oem_manifest) OVERRIDE; |
+ |
+ // Populates the named machine statistic for initial_locale and |
+ // keyboard_layout only. |
+ virtual bool GetMachineStatistic(const std::string& name, |
+ std::string* result) OVERRIDE; |
+ |
+ virtual bool GetMachineFlag(const std::string& name, bool* result) OVERRIDE; |
+ virtual void Shutdown() OVERRIDE; |
+ |
+ std::string initial_locale_; |
+ std::string keyboard_layout_; |
+}; |
+ |
+} // namespace system |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |