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

Unified Diff: athena/home/app_list_view_delegate.cc

Issue 438023002: Add search suggestions fetched from the server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | athena/main/url_search_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/app_list_view_delegate.cc
diff --git a/athena/home/app_list_view_delegate.cc b/athena/home/app_list_view_delegate.cc
index 2938bf70af9ba344c6228fd2eb806092e3f8822b..bd85ecaaead5cb48ea36e5881e2457751d4e2fa8 100644
--- a/athena/home/app_list_view_delegate.cc
+++ b/athena/home/app_list_view_delegate.cc
@@ -51,9 +51,12 @@ void AppListViewDelegate::SearchResultChanged() {
app_list::SearchProvider* search_provider = search_providers_[0];
std::vector<app_list::SearchResult*> results;
search_provider->ReleaseResult(&results);
- model_->results()->DeleteAll();
- for (size_t i = 0; i < results.size(); ++i)
- model_->results()->Add(results[i]);
+ if (results.empty()) {
hashimoto 2014/08/04 11:28:54 This code assumes that |results| is empty iff Sear
Jun Mukai 2014/08/04 16:43:10 This is not enough. You should clear model_->resul
hashimoto 2014/08/05 01:03:35 Isn't calling model_->results()->DeleteAll() when
Jun Mukai 2014/08/05 07:33:22 You made the point.
+ model_->results()->DeleteAll();
+ } else {
+ for (size_t i = 0; i < results.size(); ++i)
+ model_->results()->Add(results[i]);
+ }
}
bool AppListViewDelegate::ForceNativeDesktop() const {
« no previous file with comments | « no previous file | athena/main/url_search_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698