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

Side by Side Diff: chrome/browser/ui/webui/metrics_handler.cc

Issue 9254023: [NTP4] Track the position of each app that's launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: off by 2 error Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/metrics_handler.h" 5 #include "chrome/browser/ui/webui/metrics_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/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 int int_value = static_cast<int>(value); 57 int int_value = static_cast<int>(value);
58 int int_boundary_value = static_cast<int>(boundary_value); 58 int int_boundary_value = static_cast<int>(boundary_value);
59 if (int_boundary_value >= 4000 || 59 if (int_boundary_value >= 4000 ||
60 int_value > int_boundary_value || 60 int_value > int_boundary_value ||
61 int_value < 0) { 61 int_value < 0) {
62 NOTREACHED(); 62 NOTREACHED();
63 return; 63 return;
64 } 64 }
65 65
66 int bucket_count = int_boundary_value; 66 int bucket_count = int_boundary_value;
67 while (bucket_count >= 100) { 67 while (bucket_count > 100) {
68 bucket_count /= 10; 68 bucket_count /= 10;
69 } 69 }
70 70
71 // As |histogram_name| may change between calls, the UMA_HISTOGRAM_ENUMERATION 71 // As |histogram_name| may change between calls, the UMA_HISTOGRAM_ENUMERATION
72 // macro cannot be used here. 72 // macro cannot be used here.
73 base::Histogram* counter = 73 base::Histogram* counter =
74 base::LinearHistogram::FactoryGet( 74 base::LinearHistogram::FactoryGet(
75 histogram_name, 1, int_boundary_value, bucket_count + 1, 75 histogram_name, 1, int_boundary_value, bucket_count + 1,
76 base::Histogram::kUmaTargetedHistogramFlag); 76 base::Histogram::kUmaTargetedHistogramFlag);
77 counter->Add(int_value); 77 counter->Add(int_value);
(...skipping 21 matching lines...) Expand all
99 // The new tab page has finished loading; reset it. 99 // The new tab page has finished loading; reset it.
100 tab->SetNewTabStartTime(base::TimeTicks()); 100 tab->SetNewTabStartTime(base::TimeTicks());
101 } else { 101 } else {
102 NOTREACHED(); 102 NOTREACHED();
103 } 103 }
104 content::NotificationService::current()->Notify( 104 content::NotificationService::current()->Notify(
105 chrome::NOTIFICATION_METRIC_EVENT_DURATION, 105 chrome::NOTIFICATION_METRIC_EVENT_DURATION,
106 content::Source<WebContents>(tab), 106 content::Source<WebContents>(tab),
107 content::Details<MetricEventDurationDetails>(&details)); 107 content::Details<MetricEventDurationDetails>(&details));
108 } 108 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/tile_page.js ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698