OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_PREFS_PREF_METRICS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
| 7 |
| 8 #include "base/memory/singleton.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 11 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" |
| 12 |
| 13 // PrefMetricsService is responsible for recording prefs-related UMA stats. |
| 14 class PrefMetricsService : public BrowserContextKeyedService { |
| 15 public: |
| 16 explicit PrefMetricsService(Profile* profile); |
| 17 virtual ~PrefMetricsService(); |
| 18 |
| 19 class Factory : public BrowserContextKeyedServiceFactory { |
| 20 public: |
| 21 static Factory* GetInstance(); |
| 22 static PrefMetricsService* GetForProfile(Profile* profile); |
| 23 private: |
| 24 friend struct DefaultSingletonTraits<Factory>; |
| 25 |
| 26 Factory(); |
| 27 virtual ~Factory(); |
| 28 |
| 29 // BrowserContextKeyedServiceFactory implementation |
| 30 virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
| 31 content::BrowserContext* profile) const OVERRIDE; |
| 32 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| 33 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; |
| 34 virtual content::BrowserContext* GetBrowserContextToUse( |
| 35 content::BrowserContext* context) const OVERRIDE; |
| 36 }; |
| 37 private: |
| 38 // Record prefs state on browser context creation. |
| 39 void RecordLaunchPrefs(); |
| 40 |
| 41 Profile* profile_; |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
OLD | NEW |