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

Unified Diff: ui/base/models/list_model.h

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove junk from list_model.h Created 7 years, 5 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
Index: ui/base/models/list_model.h
diff --git a/ui/base/models/list_model.h b/ui/base/models/list_model.h
index 9b4440d9a020d2db41d8bfb7adade37fe2ec173e..847cf78b31115a594dcb0c516bde6d3e1726c585 100644
--- a/ui/base/models/list_model.h
+++ b/ui/base/models/list_model.h
@@ -34,6 +34,18 @@ class ListModel {
AddAt(item_count(), item);
}
+ // Add a vector of items to the end of the model. This triggers one
+ // notification after adding all items.
+ void AddAll(ScopedVector<ItemType> new_items) {
+ size_t count = item_count();
tapted 2013/08/05 03:01:39 I think this needs either a DCHECK(!new_items.empt
+ std::vector<ItemType*> new_items_released;
+ new_items.release(&new_items_released);
+ items_.insert(items_.end(),
+ new_items_released.begin(),
+ new_items_released.end());
+ NotifyItemsAdded(count, items_.size());
tapted 2013/08/05 03:01:39 items_.size() isn't right -- it should be new_item
+ }
+
// Removes an item at given |index| from the model. Note the removed item
// is NOT deleted and it's up to the caller to delete it.
ItemType* RemoveAt(size_t index) {

Powered by Google App Engine
This is Rietveld 408576698