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/views/app_list_main_view.h" | 5 #include "ui/app_list/views/app_list_main_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query); | 219 TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query); |
220 bool should_show_search = !query.empty(); | 220 bool should_show_search = !query.empty(); |
221 contents_view_->ShowSearchResults(should_show_search); | 221 contents_view_->ShowSearchResults(should_show_search); |
222 | 222 |
223 if (should_show_search) | 223 if (should_show_search) |
224 delegate_->StartSearch(); | 224 delegate_->StartSearch(); |
225 else | 225 else |
226 delegate_->StopSearch(); | 226 delegate_->StopSearch(); |
227 } | 227 } |
228 | 228 |
229 void AppListMainView::OpenResult(SearchResult* result, int event_flags) { | 229 void AppListMainView::OpenResult(SearchResult* result, |
230 delegate_->OpenSearchResult(result, event_flags); | 230 bool auto_launch, |
| 231 int event_flags) { |
| 232 delegate_->OpenSearchResult(result, auto_launch, event_flags); |
231 } | 233 } |
232 | 234 |
233 void AppListMainView::InvokeResultAction(SearchResult* result, | 235 void AppListMainView::InvokeResultAction(SearchResult* result, |
234 int action_index, | 236 int action_index, |
235 int event_flags) { | 237 int event_flags) { |
236 delegate_->InvokeSearchResultAction(result, action_index, event_flags); | 238 delegate_->InvokeSearchResultAction(result, action_index, event_flags); |
237 } | 239 } |
238 | 240 |
239 void AppListMainView::OnResultInstalled(SearchResult* result) { | 241 void AppListMainView::OnResultInstalled(SearchResult* result) { |
240 // Clears the search to show the apps grid. The last installed app | 242 // Clears the search to show the apps grid. The last installed app |
241 // should be highlighted and made visible already. | 243 // should be highlighted and made visible already. |
242 search_box_view_->ClearSearch(); | 244 search_box_view_->ClearSearch(); |
243 } | 245 } |
244 | 246 |
245 void AppListMainView::OnResultUninstalled(SearchResult* result) { | 247 void AppListMainView::OnResultUninstalled(SearchResult* result) { |
246 // Resubmit the query via a posted task so that all observers for the | 248 // Resubmit the query via a posted task so that all observers for the |
247 // uninstall notification are notified. | 249 // uninstall notification are notified. |
248 base::MessageLoop::current()->PostTask( | 250 base::MessageLoop::current()->PostTask( |
249 FROM_HERE, | 251 FROM_HERE, |
250 base::Bind(&AppListMainView::QueryChanged, | 252 base::Bind(&AppListMainView::QueryChanged, |
251 weak_ptr_factory_.GetWeakPtr(), | 253 weak_ptr_factory_.GetWeakPtr(), |
252 search_box_view_)); | 254 search_box_view_)); |
253 } | 255 } |
254 | 256 |
255 } // namespace app_list | 257 } // namespace app_list |
OLD | NEW |