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

Unified Diff: chrome/browser/android/activity_type_ids.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/android/activity_type_ids.h
diff --git a/chrome/browser/android/activity_type_ids.h b/chrome/browser/android/activity_type_ids.h
new file mode 100644
index 0000000000000000000000000000000000000000..068b92be8a0c93c258d41990b0dc6cf4174dcb38
--- /dev/null
+++ b/chrome/browser/android/activity_type_ids.h
@@ -0,0 +1,43 @@
+// Copyright 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_ANDROID_ACTIVITY_TYPE_IDS_H_
+#define CHROME_BROWSER_ANDROID_ACTIVITY_TYPE_IDS_H_
+
+// This file maps Activities on Chrome to specific flags for identification.
+#ifndef DEFINE_ACTIVITY_ID
Alexei Svitkine (slow) 2014/01/09 20:20:12 This is a bit messy. I suggest splitting into two
Kibeom Kim (inactive) 2014/01/16 00:18:16 Done.
+#define DEFINE_ACTIVITY_ID(id,value) ACTIVITY_##id = (value),
+#define CREATING_CPP_HEADER
+namespace ActivityTypeIds {
+enum Type {
+#endif // DEFINE_ACTIVITY_ID
+
+
+
+// Define Activities we are interested in tracking. IDs are assigned
+// consecutively, from NONE to MAX_VALUE. Activities that are not explicitly
+// defined are all assigned the UNKNOWN value. When adding new ones, make sure
+// to append them after current Activities and to update the |AndroidActivityId|
+// enum in |histograms.xml|.
+DEFINE_ACTIVITY_ID(NONE, 0)
+DEFINE_ACTIVITY_ID(UNKNOWN, 1)
+DEFINE_ACTIVITY_ID(MAIN, 2)
+DEFINE_ACTIVITY_ID(PREFERENCES, 3)
+DEFINE_ACTIVITY_ID(WEBAPPACTIVITY, 4)
+DEFINE_ACTIVITY_ID(FULLSCREENACTIVITY, 5)
+DEFINE_ACTIVITY_ID(MAX_VALUE, 6)
+
+
+
+#ifdef CREATING_CPP_HEADER
+}; // enum Type
+
+// Takes an int corresponding to a Type and returns the corresponding Type.
+Type GetActivityType(int type_id);
+} // namespace ActivityTypeIds
+#undef CREATING_CPP_HEADER
+#undef DEFINE_ACTIVITY_ID
+#endif // CREATING_CPP_HEADER
+
+#endif // CHROME_BROWSER_ANDROID_ACTIVITY_TYPE_IDS_H_

Powered by Google App Engine
This is Rietveld 408576698