| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |