OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 double duration; | 148 double duration; |
149 if (!args->GetString(0, &histogram_name) || !args->GetDouble(1, &duration)) { | 149 if (!args->GetString(0, &histogram_name) || !args->GetDouble(1, &duration)) { |
150 NOTREACHED(); | 150 NOTREACHED(); |
151 return; | 151 return; |
152 } | 152 } |
153 | 153 |
154 base::TimeDelta delta = base::TimeDelta::FromMilliseconds(duration); | 154 base::TimeDelta delta = base::TimeDelta::FromMilliseconds(duration); |
155 | 155 |
156 if (histogram_name == "NewTabPage.TimeToClickMostVisited") { | 156 if (histogram_name == "NewTabPage.TimeToClickMostVisited") { |
157 UMA_HISTOGRAM_LONG_TIMES("NewTabPage.TimeToClickMostVisited", delta); | 157 UMA_HISTOGRAM_LONG_TIMES("NewTabPage.TimeToClickMostVisited", delta); |
158 } else if (histogram_name == "NewTabPage.TimeToClickRecentlyClosed") { | |
159 UMA_HISTOGRAM_LONG_TIMES("NewTabPage.TimeToClickRecentlyClosed", delta); | |
160 } else if (histogram_name == "ExtendedNewTabPage.TimeToClickMostVisited") { | 158 } else if (histogram_name == "ExtendedNewTabPage.TimeToClickMostVisited") { |
Evan Stade
2015/05/14 19:04:55
then this one can probably be deleted as well
Dan Beam
2015/05/14 19:56:46
there's a lot more code to go. this CL is targete
| |
161 UMA_HISTOGRAM_LONG_TIMES( | 159 UMA_HISTOGRAM_LONG_TIMES( |
162 "ExtendedNewTabPage.TimeToClickMostVisited", delta); | 160 "ExtendedNewTabPage.TimeToClickMostVisited", delta); |
163 } else if (histogram_name == "ExtendedNewTabPage.TimeToClickRecentlyClosed") { | |
164 UMA_HISTOGRAM_LONG_TIMES( | |
165 "ExtendedNewTabPage.TimeToClickRecentlyClosed", delta); | |
Evan Stade
2015/05/14 00:09:44
ah! this is one way to verify the code isn't used
Dan Beam
2015/05/14 01:09:34
can't find it in UMA nor is it in histograms.xml
| |
166 } else { | 161 } else { |
167 NOTREACHED(); | 162 NOTREACHED(); |
168 } | 163 } |
169 } | 164 } |
170 | 165 |
171 // static | 166 // static |
172 void NewTabPageHandler::RegisterProfilePrefs( | 167 void NewTabPageHandler::RegisterProfilePrefs( |
173 user_prefs::PrefRegistrySyncable* registry) { | 168 user_prefs::PrefRegistrySyncable* registry) { |
174 // TODO(estade): should be syncable. | 169 // TODO(estade): should be syncable. |
175 registry->RegisterIntegerPref(prefs::kNtpShownPage, APPS_PAGE_ID); | 170 registry->RegisterIntegerPref(prefs::kNtpShownPage, APPS_PAGE_ID); |
(...skipping 12 matching lines...) Expand all Loading... | |
188 values->SetInteger("shown_page_index", shown_page & INDEX_MASK); | 183 values->SetInteger("shown_page_index", shown_page & INDEX_MASK); |
189 } | 184 } |
190 | 185 |
191 void NewTabPageHandler::Notify(chrome::NotificationType notification_type) { | 186 void NewTabPageHandler::Notify(chrome::NotificationType notification_type) { |
192 content::NotificationService* service = | 187 content::NotificationService* service = |
193 content::NotificationService::current(); | 188 content::NotificationService::current(); |
194 service->Notify(notification_type, | 189 service->Notify(notification_type, |
195 content::Source<NewTabPageHandler>(this), | 190 content::Source<NewTabPageHandler>(this), |
196 content::NotificationService::NoDetails()); | 191 content::NotificationService::NoDetails()); |
197 } | 192 } |
OLD | NEW |