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

Unified Diff: chrome/browser/metrics/metrics_service.h

Issue 137623002: Let MetricsService know about some Android Activities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line warp fix Created 6 years, 11 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
Index: chrome/browser/metrics/metrics_service.h
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index dadbf592cf92377041e59853903f66d08ccb0cfd..199d6b76cfc16a670644ed8c038bd71b90e0891a 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -30,7 +30,9 @@
#include "content/public/browser/user_metrics.h"
#include "net/url_request/url_fetcher_delegate.h"
-#if defined(OS_CHROMEOS)
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/activity_type_ids.h"
+#elif defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/external_metrics.h"
#endif
@@ -175,6 +177,9 @@ class MetricsService
// At startup, prefs needs to be called with a list of all the pref names and
// types we'll be using.
static void RegisterPrefs(PrefRegistrySimple* registry);
+#if defined(OS_ANDROID)
+ static void RegisterPrefsAndroid(PrefRegistrySimple* registry);
+#endif // defined(OS_ANDROID)
// Set up notifications which indicate that a user is performing work. This is
// useful to allow some features to sleep, until the machine becomes active,
@@ -203,6 +208,18 @@ class MetricsService
// that session end was successful.
void RecordCompletedSessionEnd();
+#if defined(OS_ANDROID)
+ // Called to log launch and crash stats to preferences.
+ void LogAndroidStabilityToPrefs(PrefService* pref);
+
+ // Converts crash stats stored in the preferences into histograms.
+ void ConvertAndroidStabilityPrefsToHistograms(PrefService* pref);
+
+ // Called when the Activity that the user interacts with is swapped out.
+ void OnForegroundActivityChanged(PrefService* pref,
+ ActivityTypeIds::Type type);
+#endif // defined(OS_ANDROID)
+
#if defined(OS_ANDROID) || defined(OS_IOS)
// Called when the application is going into background mode.
void OnAppEnterBackground();
@@ -346,6 +363,9 @@ class MetricsService
// the old version (after an autoupdate has arrived), and so we'd bias
// initial results towards showing crashes :-(.
static void DiscardOldStabilityStats(PrefService* local_state);
+#if defined(OS_ANDROID)
+ static void DiscardOldStabilityStatsAndroid(PrefService* local_state);
+#endif // defined(OS_ANDROID)
// Turns recording on or off.
// DisableRecording() also forces a persistent save of logging state (if

Powered by Google App Engine
This is Rietveld 408576698