OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 16 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
17 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
18 #include "components/sync_preferences/synced_pref_change_registrar.h" | 18 #include "components/sync_preferences/synced_pref_change_registrar.h" |
19 | 19 |
20 class PrefRegistrySimple; | |
21 | |
22 // PrefMetricsService is responsible for recording prefs-related UMA stats. | 20 // PrefMetricsService is responsible for recording prefs-related UMA stats. |
23 class PrefMetricsService : public KeyedService { | 21 class PrefMetricsService : public KeyedService { |
24 public: | 22 public: |
25 explicit PrefMetricsService(Profile* profile); | 23 explicit PrefMetricsService(Profile* profile); |
26 ~PrefMetricsService() override; | 24 ~PrefMetricsService() override; |
27 | 25 |
28 // Records metrics about the state of the homepage on launch. | 26 // Records metrics about the state of the homepage on launch. |
29 static void RecordHomePageLaunchMetrics(bool show_home_button, | 27 static void RecordHomePageLaunchMetrics(bool show_home_button, |
30 bool homepage_is_ntp, | 28 bool homepage_is_ntp, |
31 const GURL& homepage_url); | 29 const GURL& homepage_url); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 89 |
92 std::unique_ptr<sync_preferences::SyncedPrefChangeRegistrar> | 90 std::unique_ptr<sync_preferences::SyncedPrefChangeRegistrar> |
93 synced_pref_change_registrar_; | 91 synced_pref_change_registrar_; |
94 | 92 |
95 base::WeakPtrFactory<PrefMetricsService> weak_factory_; | 93 base::WeakPtrFactory<PrefMetricsService> weak_factory_; |
96 | 94 |
97 DISALLOW_COPY_AND_ASSIGN(PrefMetricsService); | 95 DISALLOW_COPY_AND_ASSIGN(PrefMetricsService); |
98 }; | 96 }; |
99 | 97 |
100 #endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ | 98 #endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
OLD | NEW |