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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
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()); |
| 86 |
85 result->Open(event_flags); | 87 result->Open(event_flags); |
86 | 88 |
87 if (history_ && history_->IsReady()) { | 89 if (history_ && history_->IsReady()) { |
88 history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()), | 90 history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()), |
89 result->id()); | 91 result->id()); |
90 } | 92 } |
91 } | 93 } |
92 | 94 |
93 void SearchController::InvokeResultAction(SearchResult* result, | 95 void SearchController::InvokeResultAction(SearchResult* result, |
94 int action_index, | 96 int action_index, |
(...skipping 26 matching lines...) Expand all Loading... |
121 KnownResults known_results; | 123 KnownResults known_results; |
122 if (history_ && history_->IsReady()) { | 124 if (history_ && history_->IsReady()) { |
123 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) | 125 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) |
124 ->swap(known_results); | 126 ->swap(known_results); |
125 } | 127 } |
126 | 128 |
127 mixer_->MixAndPublish(is_voice_query_, known_results); | 129 mixer_->MixAndPublish(is_voice_query_, known_results); |
128 } | 130 } |
129 | 131 |
130 } // namespace app_list | 132 } // namespace app_list |
OLD | NEW |