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