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

Unified Diff: ash/shelf/shelf_model.cc

Issue 68523017: ash: Add GetItemIndexForType() function to ShelfModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | « ash/shelf/shelf_model.h ('k') | ash/shelf/shelf_model_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_model.cc
diff --git a/ash/shelf/shelf_model.cc b/ash/shelf/shelf_model.cc
index b108a21f12c1c32523941d6ee3dd7af86fe005d3..d5d83f12e6a1001ad4bc7ca3fc351ea965cbdf3b 100644
--- a/ash/shelf/shelf_model.cc
+++ b/ash/shelf/shelf_model.cc
@@ -131,6 +131,14 @@ int ShelfModel::ItemIndexByID(LauncherID id) const {
return i == items_.end() ? -1 : static_cast<int>(i - items_.begin());
}
+int ShelfModel::GetItemIndexForType(LauncherItemType type) {
+ for (size_t i = 0; i < items_.size(); ++i) {
+ if (items_[i].type == type)
+ return i;
+ }
+ return -1;
+}
+
LauncherItems::const_iterator ShelfModel::ItemByID(int id) const {
for (LauncherItems::const_iterator i = items_.begin();
i != items_.end(); ++i) {
« no previous file with comments | « ash/shelf/shelf_model.h ('k') | ash/shelf/shelf_model_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698