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

Side by Side Diff: ui/app_list/search_controller.cc

Issue 1132943004: Add Apps.AppListSearchResultDistanceFromOrigin UMA stat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_query_length_stat
Patch Set: Created 5 years, 7 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
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/app_list/search_controller.h" 5 #include "ui/app_list/search_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void SearchController::OpenResult(SearchResult* result, int event_flags) { 77 void SearchController::OpenResult(SearchResult* result, int event_flags) {
78 // Count AppList.Search here because it is composed of search + action. 78 // Count AppList.Search here because it is composed of search + action.
79 base::RecordAction(base::UserMetricsAction("AppList_Search")); 79 base::RecordAction(base::UserMetricsAction("AppList_Search"));
80 80
81 UMA_HISTOGRAM_ENUMERATION(kSearchResultOpenDisplayTypeHistogram, 81 UMA_HISTOGRAM_ENUMERATION(kSearchResultOpenDisplayTypeHistogram,
82 result->display_type(), 82 result->display_type(),
83 SearchResult::DISPLAY_TYPE_LAST); 83 SearchResult::DISPLAY_TYPE_LAST);
84 84
85 UMA_HISTOGRAM_COUNTS_100(kSearchQueryLength, search_box_->text().size()); 85 UMA_HISTOGRAM_COUNTS_100(kSearchQueryLength, search_box_->text().size());
86 86
87 if (result->distance_from_origin() >= 0) {
88 UMA_HISTOGRAM_COUNTS_100(kSearchResultDistanceFromOrigin,
89 result->distance_from_origin());
90 }
91
87 result->Open(event_flags); 92 result->Open(event_flags);
88 93
89 if (history_ && history_->IsReady()) { 94 if (history_ && history_->IsReady()) {
90 history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()), 95 history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()),
91 result->id()); 96 result->id());
92 } 97 }
93 } 98 }
94 99
95 void SearchController::InvokeResultAction(SearchResult* result, 100 void SearchController::InvokeResultAction(SearchResult* result,
96 int action_index, 101 int action_index,
(...skipping 26 matching lines...) Expand all
123 KnownResults known_results; 128 KnownResults known_results;
124 if (history_ && history_->IsReady()) { 129 if (history_ && history_->IsReady()) {
125 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) 130 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
126 ->swap(known_results); 131 ->swap(known_results);
127 } 132 }
128 133
129 mixer_->MixAndPublish(is_voice_query_, known_results); 134 mixer_->MixAndPublish(is_voice_query_, known_results);
130 } 135 }
131 136
132 } // namespace app_list 137 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698