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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 void AppListMainView::GetShortcutPathForApp( | 211 void AppListMainView::GetShortcutPathForApp( |
212 const std::string& app_id, | 212 const std::string& app_id, |
213 const base::Callback<void(const base::FilePath&)>& callback) { | 213 const base::Callback<void(const base::FilePath&)>& callback) { |
214 delegate_->GetShortcutPathForApp(app_id, callback); | 214 delegate_->GetShortcutPathForApp(app_id, callback); |
215 } | 215 } |
216 | 216 |
217 void AppListMainView::QueryChanged(SearchBoxView* sender) { | 217 void AppListMainView::QueryChanged(SearchBoxView* sender) { |
218 base::string16 query; | 218 base::string16 query; |
219 TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query); | 219 base::TrimWhitespace(model_->search_box()->text(), base::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, | 229 void AppListMainView::OpenResult(SearchResult* result, |
(...skipping 18 matching lines...) Expand all Loading... |
248 // 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 |
249 // uninstall notification are notified. | 249 // uninstall notification are notified. |
250 base::MessageLoop::current()->PostTask( | 250 base::MessageLoop::current()->PostTask( |
251 FROM_HERE, | 251 FROM_HERE, |
252 base::Bind(&AppListMainView::QueryChanged, | 252 base::Bind(&AppListMainView::QueryChanged, |
253 weak_ptr_factory_.GetWeakPtr(), | 253 weak_ptr_factory_.GetWeakPtr(), |
254 search_box_view_)); | 254 search_box_view_)); |
255 } | 255 } |
256 | 256 |
257 } // namespace app_list | 257 } // namespace app_list |
OLD | NEW |