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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 213 } |
214 | 214 |
215 void AppListMainView::GetShortcutPathForApp( | 215 void AppListMainView::GetShortcutPathForApp( |
216 const std::string& app_id, | 216 const std::string& app_id, |
217 const base::Callback<void(const base::FilePath&)>& callback) { | 217 const base::Callback<void(const base::FilePath&)>& callback) { |
218 delegate_->GetShortcutPathForApp(app_id, callback); | 218 delegate_->GetShortcutPathForApp(app_id, callback); |
219 } | 219 } |
220 | 220 |
221 void AppListMainView::QueryChanged(SearchBoxView* sender) { | 221 void AppListMainView::QueryChanged(SearchBoxView* sender) { |
222 base::string16 query; | 222 base::string16 query; |
223 TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query); | 223 base::TrimWhitespace(model_->search_box()->text(), base::TRIM_ALL, &query); |
224 bool should_show_search = !query.empty(); | 224 bool should_show_search = !query.empty(); |
225 contents_view_->ShowSearchResults(should_show_search); | 225 contents_view_->ShowSearchResults(should_show_search); |
226 | 226 |
227 if (should_show_search) | 227 if (should_show_search) |
228 delegate_->StartSearch(); | 228 delegate_->StartSearch(); |
229 else | 229 else |
230 delegate_->StopSearch(); | 230 delegate_->StopSearch(); |
231 } | 231 } |
232 | 232 |
233 void AppListMainView::OpenResult(SearchResult* result, | 233 void AppListMainView::OpenResult(SearchResult* result, |
(...skipping 18 matching lines...) Expand all Loading... |
252 // Resubmit the query via a posted task so that all observers for the | 252 // Resubmit the query via a posted task so that all observers for the |
253 // uninstall notification are notified. | 253 // uninstall notification are notified. |
254 base::MessageLoop::current()->PostTask( | 254 base::MessageLoop::current()->PostTask( |
255 FROM_HERE, | 255 FROM_HERE, |
256 base::Bind(&AppListMainView::QueryChanged, | 256 base::Bind(&AppListMainView::QueryChanged, |
257 weak_ptr_factory_.GetWeakPtr(), | 257 weak_ptr_factory_.GetWeakPtr(), |
258 search_box_view_)); | 258 search_box_view_)); |
259 } | 259 } |
260 | 260 |
261 } // namespace app_list | 261 } // namespace app_list |
OLD | NEW |