Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: chrome/browser/prefs/pref_metrics_service.h

Issue 19776015: Add UMA stat to track home button and page prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for real Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/prefs/pref_metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_metrics_service.h
diff --git a/chrome/browser/prefs/pref_metrics_service.h b/chrome/browser/prefs/pref_metrics_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..4b820de92521c83ff56fc8f2fd3eed6dc043b4fe
--- /dev/null
+++ b/chrome/browser/prefs/pref_metrics_service.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2013 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_PREFS_PREF_METRICS_SERVICE_H_
+#define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_
+
+#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
+
+// PrefMetricsService is responsible for recording prefs-related UMA stats.
+class PrefMetricsService : public BrowserContextKeyedService {
+ public:
+ explicit PrefMetricsService(Profile* profile);
+ virtual ~PrefMetricsService();
+
+ class Factory : public BrowserContextKeyedServiceFactory {
+ public:
+ static Factory* GetInstance();
+ static PrefMetricsService* GetForProfile(Profile* profile);
+ private:
+ friend struct DefaultSingletonTraits<Factory>;
+
+ Factory();
+ virtual ~Factory();
+
+ // BrowserContextKeyedServiceFactory implementation
+ virtual BrowserContextKeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* profile) const OVERRIDE;
+ virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
+ virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
+ virtual content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const OVERRIDE;
+ };
+ private:
+ // Record prefs state on browser context creation.
+ void RecordLaunchPrefs();
+
+ Profile* profile_;
+};
+
+#endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/prefs/pref_metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698