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

Unified Diff: chrome/browser/ui/app_list/apps_model_builder.cc

Issue 22339004: Make an AddAll in ListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework, add early return Created 7 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 | ui/base/models/list_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/apps_model_builder.cc
diff --git a/chrome/browser/ui/app_list/apps_model_builder.cc b/chrome/browser/ui/app_list/apps_model_builder.cc
index b662b4537f18f1e81c044f4cd06ae4d4126915d1..6daf274792b50f4a943d1ca1a5a67040bc99afae 100644
--- a/chrome/browser/ui/app_list/apps_model_builder.cc
+++ b/chrome/browser/ui/app_list/apps_model_builder.cc
@@ -189,8 +189,11 @@ void AppsModelBuilder::PopulateApps() {
service->extension_prefs()->extension_sorting()->FixNTPOrdinalCollisions();
std::sort(apps.begin(), apps.end(), &AppPrecedes);
- for (size_t i = 0; i < apps.size(); ++i)
- model_->Add(apps[i]);
+ ScopedVector<app_list::AppListItemModel> items;
+ items.assign(apps.begin(), apps.end());
+
+ model_->AddAll(items.Pass());
+
}
void AppsModelBuilder::ResortApps() {
« no previous file with comments | « no previous file | ui/base/models/list_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698