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

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

Issue 1136363003: Remove AppListMixer field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-mixer-priority-finch-test
Patch Set: Rebase. Created 4 years, 5 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
« ui/app_list/search/mixer.cc ('K') | « ui/app_list/search_controller.h ('k') | no next file » | 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 <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 } 106 }
107 107
108 void SearchController::InvokeResultAction(SearchResult* result, 108 void SearchController::InvokeResultAction(SearchResult* result,
109 int action_index, 109 int action_index,
110 int event_flags) { 110 int event_flags) {
111 // TODO(xiyuan): Hook up with user learning. 111 // TODO(xiyuan): Hook up with user learning.
112 result->InvokeAction(action_index, event_flags); 112 result->InvokeAction(action_index, event_flags);
113 } 113 }
114 114
115 size_t SearchController::AddGroup(size_t max_results, 115 size_t SearchController::AddGroup(size_t max_results, double multiplier) {
116 double boost, 116 return mixer_->AddGroup(max_results, multiplier);
117 double multiplier) {
118 return mixer_->AddGroup(max_results, boost, multiplier);
119 }
120
121 size_t SearchController::AddOmniboxGroup(size_t max_results,
122 double boost,
123 double multiplier) {
124 return mixer_->AddOmniboxGroup(max_results, boost, multiplier);
125 } 117 }
126 118
127 void SearchController::AddProvider(size_t group_id, 119 void SearchController::AddProvider(size_t group_id,
128 std::unique_ptr<SearchProvider> provider) { 120 std::unique_ptr<SearchProvider> provider) {
129 provider->set_result_changed_callback(base::Bind( 121 provider->set_result_changed_callback(base::Bind(
130 &SearchController::OnResultsChanged, 122 &SearchController::OnResultsChanged,
131 base::Unretained(this))); 123 base::Unretained(this)));
132 mixer_->AddProviderToGroup(group_id, provider.get()); 124 mixer_->AddProviderToGroup(group_id, provider.get());
133 providers_.push_back(std::move(provider)); 125 providers_.push_back(std::move(provider));
134 } 126 }
135 127
136 void SearchController::OnResultsChanged() { 128 void SearchController::OnResultsChanged() {
137 if (dispatching_query_) 129 if (dispatching_query_)
138 return; 130 return;
139 131
140 KnownResults known_results; 132 KnownResults known_results;
141 if (history_ && history_->IsReady()) { 133 if (history_ && history_->IsReady()) {
142 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) 134 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
143 ->swap(known_results); 135 ->swap(known_results);
144 } 136 }
145 137
146 mixer_->MixAndPublish(is_voice_query_, known_results); 138 mixer_->MixAndPublish(is_voice_query_, known_results);
147 } 139 }
148 140
149 } // namespace app_list 141 } // namespace app_list
OLDNEW
« ui/app_list/search/mixer.cc ('K') | « ui/app_list/search_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698