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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_page_handler.cc

Issue 8895016: ntp: track number of times a user switches pages in a single session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 9 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
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_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/new_tab_page_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc b/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc
index 5bf05f65373575b4da280336dbe2612e0f1006b4..78543b6f9b81cd5bbb2efb3270563763b786cf87 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc
@@ -28,6 +28,14 @@ static const int kIntroDisplayMax = 10;
static const char kNTP4IntroURL[] =
"http://www.google.com/support/chrome/bin/answer.py?answer=95451";
+NewTabPageHandler::NewTabPageHandler() : page_switch_count_(0) {
+}
+
+NewTabPageHandler::~NewTabPageHandler() {
+ HISTOGRAM_COUNTS_100("NewTabPage.SingleSessionPageSwitches",
+ page_switch_count_);
+}
+
WebUIMessageHandler* NewTabPageHandler::Attach(WebUI* web_ui) {
// Record an open of the NTP with its default page type.
PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs();
@@ -81,6 +89,8 @@ void NewTabPageHandler::HandleNotificationPromoViewed(const ListValue* args) {
}
void NewTabPageHandler::HandlePageSelected(const ListValue* args) {
+ page_switch_count_++;
+
double page_id_double;
CHECK(args->GetDouble(0, &page_id_double));
int page_id = static_cast<int>(page_id_double);
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698