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

Side by Side Diff: ios/chrome/browser/metrics/first_user_action_recorder.cc

Issue 2528303003: [NTP] Fixed usage of NewTabPage.ActionAndroid histogram (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ios/chrome/browser/metrics/first_user_action_recorder.h" 5 #include "ios/chrome/browser/metrics/first_user_action_recorder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // A list of actions that should be 'rethrown' because subsequent actions may 55 // A list of actions that should be 'rethrown' because subsequent actions may
56 // be more indicative of the first user action type. 'Rethrowing' an action 56 // be more indicative of the first user action type. 'Rethrowing' an action
57 // puts a call to OnUserAction in the message queue so it is processed after 57 // puts a call to OnUserAction in the message queue so it is processed after
58 // any other actions currently in the message queue. 58 // any other actions currently in the message queue.
59 const char* kRethrownActions[] = { 59 const char* kRethrownActions[] = {
60 "MobileTabSwitched", 60 "MobileTabSwitched",
61 }; 61 };
62 62
63 // A list of actions that indicate a new task has been started. 63 // A list of actions that indicate a new task has been started.
64 const char* kNewTaskActions[] = { 64 const char* kNewTaskActions[] = {
65 "MobileMenuAllBookmarks", "MobileMenuHistory", 65 "MobileMenuAllBookmarks",
66 "MobileMenuNewIncognitoTab", "MobileMenuNewTab", 66 "MobileMenuHistory",
67 "MobileMenuRecentTabs", "MobileMenuVoiceSearch", 67 "MobileMenuNewIncognitoTab",
68 "MobileNTPBookmark", "MobileNTPForeignSession", 68 "MobileMenuNewTab",
69 "MobileNTPMostVisited", "MobileNTPShowBookmarks", 69 "MobileMenuRecentTabs",
70 "MobileNTPShowMostVisited", "MobileNTPShowOpenTabs", 70 "MobileMenuVoiceSearch",
71 "MobileNTPSwitchToBookmarks", "MobileNTPSwitchToMostVisited", 71 "MobileBookmarkManagerEntryOpened",
72 "MobileNTPSwitchToOpenTabs", "MobileTabStripNewTab", 72 "MobileRecentTabManagerTabFromOtherDeviceOpened",
73 "MobileToolbarNewTab", "MobileToolbarStackViewNewTab", 73 "MobileNTPMostVisited",
74 "MobileToolbarVoiceSearch", "OmniboxInputInProgress", 74 "MobileNTPShowBookmarks",
75 "MobileNTPShowMostVisited",
76 "MobileNTPShowOpenTabs",
77 "MobileNTPSwitchToBookmarks",
78 "MobileNTPSwitchToMostVisited",
79 "MobileNTPSwitchToOpenTabs",
80 "MobileTabStripNewTab",
81 "MobileToolbarNewTab",
82 "MobileToolbarStackViewNewTab",
83 "MobileToolbarVoiceSearch",
84 "OmniboxInputInProgress",
75 }; 85 };
76 86
77 // Min and max values (in minutes) for the buckets in the duration histograms. 87 // Min and max values (in minutes) for the buckets in the duration histograms.
78 const int kDurationHistogramMin = 5; 88 const int kDurationHistogramMin = 5;
79 const int kDurationHistogramMax = 48 * 60; 89 const int kDurationHistogramMax = 48 * 60;
80 90
81 // Number of buckets in the duration histograms. 91 // Number of buckets in the duration histograms.
82 const int kDurationHistogramBucketCount = 50; 92 const int kDurationHistogramBucketCount = 50;
83 93
84 } // namespace 94 } // namespace
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 205
196 bool FirstUserActionRecorder::ArrayContainsString(const char* to_search[], 206 bool FirstUserActionRecorder::ArrayContainsString(const char* to_search[],
197 const size_t to_search_size, 207 const size_t to_search_size,
198 const char* to_find) { 208 const char* to_find) {
199 for (size_t i = 0; i < to_search_size; ++i) { 209 for (size_t i = 0; i < to_search_size; ++i) {
200 if (strcmp(to_find, to_search[i]) == 0) 210 if (strcmp(to_find, to_search[i]) == 0)
201 return true; 211 return true;
202 } 212 }
203 return false; 213 return false;
204 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698