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

Unified Diff: chrome/browser/ui/webui/ntp/android/navigation_handler.cc

Issue 23537017: Update UMA stat code for Android NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/ui/webui/ntp/android/navigation_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/android/navigation_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/android/navigation_handler.cc b/chrome/browser/ui/webui/ntp/android/navigation_handler.cc
index d5c9a2e1693f74bc8e2aeb594833d0b1d453f18e..45dd01b4c74e4e95fe992ff0837e3113dd54810e 100644
--- a/chrome/browser/ui/webui/ntp/android/navigation_handler.cc
+++ b/chrome/browser/ui/webui/ntp/android/navigation_handler.cc
@@ -35,16 +35,7 @@ NavigationHandler::~NavigationHandler() {
return;
}
- Action action;
- if ((entry->GetTransitionType() & content::PAGE_TRANSITION_CORE_MASK) ==
- content::PAGE_TRANSITION_GENERATED) {
- action = ACTION_SEARCHED_USING_OMNIBOX;
- } else if (google_util::IsGoogleHomePageUrl(entry->GetURL())) {
- action = ACTION_NAVIGATED_TO_GOOGLE_HOMEPAGE;
- } else {
- action = ACTION_NAVIGATED_USING_OMNIBOX;
- }
- RecordAction(action);
+ RecordActionForNavigation(*entry);
}
void NavigationHandler::RegisterMessages() {
@@ -84,6 +75,22 @@ void NavigationHandler::HandleOpenedForeignSession(
RecordAction(ACTION_OPENED_FOREIGN_SESSION);
}
+// static
+void NavigationHandler::RecordActionForNavigation(
+ const content::NavigationEntry& entry) {
+ Action action;
+ if ((entry.GetTransitionType() & content::PAGE_TRANSITION_CORE_MASK) ==
+ content::PAGE_TRANSITION_GENERATED) {
+ action = ACTION_SEARCHED_USING_OMNIBOX;
+ } else if (google_util::IsGoogleHomePageUrl(entry.GetURL())) {
+ action = ACTION_NAVIGATED_TO_GOOGLE_HOMEPAGE;
+ } else {
+ action = ACTION_NAVIGATED_USING_OMNIBOX;
+ }
+ RecordAction(action);
+}
+
+// static
void NavigationHandler::RecordAction(Action action) {
UMA_HISTOGRAM_ENUMERATION("NewTabPage.ActionAndroid", action, NUM_ACTIONS);
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/navigation_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698