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

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

Issue 1113483002: App launcher: Added Finch experiment for the search ranking algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-mixer-debug-framework
Patch Set: Split variable. 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/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 <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 } 93 }
94 94
95 void SearchController::InvokeResultAction(SearchResult* result, 95 void SearchController::InvokeResultAction(SearchResult* result,
96 int action_index, 96 int action_index,
97 int event_flags) { 97 int event_flags) {
98 // TODO(xiyuan): Hook up with user learning. 98 // TODO(xiyuan): Hook up with user learning.
99 result->InvokeAction(action_index, event_flags); 99 result->InvokeAction(action_index, event_flags);
100 } 100 }
101 101
102 size_t SearchController::AddGroup(size_t max_results, double boost) { 102 size_t SearchController::AddGroup(size_t max_results,
103 return mixer_->AddGroup(max_results, boost); 103 double boost,
104 double multiplier) {
105 return mixer_->AddGroup(max_results, boost, multiplier);
104 } 106 }
105 107
106 size_t SearchController::AddOmniboxGroup(size_t max_results, double boost) { 108 size_t SearchController::AddOmniboxGroup(size_t max_results,
107 return mixer_->AddOmniboxGroup(max_results, boost); 109 double boost,
110 double multiplier) {
111 return mixer_->AddOmniboxGroup(max_results, boost, multiplier);
108 } 112 }
109 113
110 void SearchController::AddProvider(size_t group_id, 114 void SearchController::AddProvider(size_t group_id,
111 scoped_ptr<SearchProvider> provider) { 115 scoped_ptr<SearchProvider> provider) {
112 provider->set_result_changed_callback(base::Bind( 116 provider->set_result_changed_callback(base::Bind(
113 &SearchController::OnResultsChanged, 117 &SearchController::OnResultsChanged,
114 base::Unretained(this))); 118 base::Unretained(this)));
115 mixer_->AddProviderToGroup(group_id, provider.get()); 119 mixer_->AddProviderToGroup(group_id, provider.get());
116 providers_.push_back(provider.release()); // Takes ownership. 120 providers_.push_back(provider.release()); // Takes ownership.
117 } 121 }
118 122
119 void SearchController::OnResultsChanged() { 123 void SearchController::OnResultsChanged() {
120 if (dispatching_query_) 124 if (dispatching_query_)
121 return; 125 return;
122 126
123 KnownResults known_results; 127 KnownResults known_results;
124 if (history_ && history_->IsReady()) { 128 if (history_ && history_->IsReady()) {
125 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) 129 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
126 ->swap(known_results); 130 ->swap(known_results);
127 } 131 }
128 132
129 mixer_->MixAndPublish(is_voice_query_, known_results); 133 mixer_->MixAndPublish(is_voice_query_, known_results);
130 } 134 }
131 135
132 } // namespace app_list 136 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698