• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_METRICS_CROS_SETTINGS_PROVIDER_H_
6 #define CHROME_BROWSER_CHROMEOS_METRICS_CROS_SETTINGS_PROVIDER_H_
7 #pragma once
8 
9 #include <string>
10 
11 #include "base/basictypes.h"
12 #include "chrome/browser/chromeos/cros_settings_provider.h"
13 
14 namespace chromeos {
15 
16 // CrosSettingsProvider that abstracts switching of stats/crash
17 // reporting to Google.
18 class MetricsCrosSettingsProvider : public CrosSettingsProvider {
19  public:
MetricsCrosSettingsProvider()20   MetricsCrosSettingsProvider() {}
21 
22   // Actual methods to control stats/crash reporting. Currently these
23   // methods are public and static so they are accessible directly
24   // from cros code. But this will change soon: crosbug.com/7359
25   static bool SetMetricsStatus(bool enabled);
26   static bool GetMetricsStatus();
27 
28  private:
29   // CrosSettingsProvider implementation.
30   virtual void DoSet(const std::string& path, Value* value);
31   virtual bool Get(const std::string& path, Value** value) const;
32   virtual bool HandlesSetting(const std::string& path);
33 
34   DISALLOW_COPY_AND_ASSIGN(MetricsCrosSettingsProvider);
35 };
36 
37 };  // namespace chromeos
38 
39 #endif  // CHROME_BROWSER_CHROMEOS_METRICS_CROS_SETTINGS_PROVIDER_H_
40