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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 double multiplier) { | 115 double multiplier) { |
116 return mixer_->AddOmniboxGroup(max_results, boost, multiplier); | 116 return mixer_->AddOmniboxGroup(max_results, boost, multiplier); |
117 } | 117 } |
118 | 118 |
119 void SearchController::AddProvider(size_t group_id, | 119 void SearchController::AddProvider(size_t group_id, |
120 scoped_ptr<SearchProvider> provider) { | 120 scoped_ptr<SearchProvider> provider) { |
121 provider->set_result_changed_callback(base::Bind( | 121 provider->set_result_changed_callback(base::Bind( |
122 &SearchController::OnResultsChanged, | 122 &SearchController::OnResultsChanged, |
123 base::Unretained(this))); | 123 base::Unretained(this))); |
124 mixer_->AddProviderToGroup(group_id, provider.get()); | 124 mixer_->AddProviderToGroup(group_id, provider.get()); |
125 providers_.push_back(provider.release()); // Takes ownership. | 125 providers_.push_back(provider.Pass()); // Takes ownership. |
sadrul
2015/05/21 14:44:53
Remove the comment at the end. The new code is fai
d.samantaray
2015/05/22 03:37:02
Done.
| |
126 } | 126 } |
127 | 127 |
128 void SearchController::OnResultsChanged() { | 128 void SearchController::OnResultsChanged() { |
129 if (dispatching_query_) | 129 if (dispatching_query_) |
130 return; | 130 return; |
131 | 131 |
132 KnownResults known_results; | 132 KnownResults known_results; |
133 if (history_ && history_->IsReady()) { | 133 if (history_ && history_->IsReady()) { |
134 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) | 134 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) |
135 ->swap(known_results); | 135 ->swap(known_results); |
136 } | 136 } |
137 | 137 |
138 mixer_->MixAndPublish(is_voice_query_, known_results); | 138 mixer_->MixAndPublish(is_voice_query_, known_results); |
139 } | 139 } |
140 | 140 |
141 } // namespace app_list | 141 } // namespace app_list |
OLD | NEW |