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

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

Issue 103943006: Let MetricsService know about some Android Activities (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding more activities, addressing comments Created 7 years 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 2c5ea8a00ef5556f45a2068a6e8332e6a60cb677..ddccabe92aae162793ab3a8cce36c9b2f2d3c3b3 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -29,7 +29,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
@@ -174,6 +176,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,
@@ -202,6 +207,17 @@ class MetricsService
// that session end was successful.
void RecordCompletedSessionEnd();
+#if defined(OS_ANDROID)
+ // Called to record launch and crash stats to preferences.
+ void RecordAndroidStabilityPrefs();
+
+ // Converts crash stats stored in the preferences into histograms.
+ void RecordAndroidStabilityHistograms();
+
+ // Called when the Activity that the user interacts with is swapped out.
+ void OnForegroundActivityChanged(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();
@@ -345,6 +361,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