Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service_accessor.h |
| diff --git a/chrome/browser/metrics/metrics_service_accessor.h b/chrome/browser/metrics/metrics_service_accessor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cf19f0a894d8eff9f9ee8be0d4719b02176c03ed |
| --- /dev/null |
| +++ b/chrome/browser/metrics/metrics_service_accessor.h |
| @@ -0,0 +1,30 @@ |
| +// 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 CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ |
| +#define CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ |
| + |
| +#include "base/macros.h" |
| + |
| +class MetricsServiceObserver; |
| + |
| +// This class limits and documents access to metrics service helper methods. |
| +// These methods are protected so each user has to inherit own program-specific |
| +// specialization and enable access there by declaring friends. |
| +class MetricsServiceAccessor { |
| + protected: |
| + // Constructor declared as protected to enable inheritance. Decendants have to |
|
Ilya Sherman
2014/05/21 13:18:30
nit: "have to" -> "should"
motek.
2014/05/21 14:41:09
Done.
|
| + // disallow instantiation. |
| + MetricsServiceAccessor() {} |
| + |
| + // Registers/unregisters |observer| to receive MetricsLog notifications |
| + // from metrics service. |
| + static void AddMetricsServiceObserver(MetricsServiceObserver* observer); |
| + static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ |