summaryrefslogtreecommitdiffstats
path: root/ash/shelf/shelf_model.h
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-18 06:16:12 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-18 06:16:12 +0000
commitb7b4decb301fd18016a983cd881bc8ce7a61d5b8 (patch)
tree321403da052052cb52e425bf485684804403983e /ash/shelf/shelf_model.h
parenta3f1159b93835be0f25d0dd3efc9a05b3cd6559a (diff)
downloadchromium_src-b7b4decb301fd18016a983cd881bc8ce7a61d5b8.zip
chromium_src-b7b4decb301fd18016a983cd881bc8ce7a61d5b8.tar.gz
chromium_src-b7b4decb301fd18016a983cd881bc8ce7a61d5b8.tar.bz2
ash: Add GetItemIndexForType() function to ShelfModel.
Now that this function is generic enough, there is no reason to not provide it directly from ShelfModel. See previous CLs: https://codereview.chromium.org/27369004 https://codereview.chromium.org/53513003 https://codereview.chromium.org/71653003 BUG=None TEST=None, no functional changes R=jamescook@chromium.org Review URL: https://codereview.chromium.org/68523017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf/shelf_model.h')
-rw-r--r--ash/shelf/shelf_model.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ash/shelf/shelf_model.h b/ash/shelf/shelf_model.h
index 58e931a..cf51a01 100644
--- a/ash/shelf/shelf_model.h
+++ b/ash/shelf/shelf_model.h
@@ -47,6 +47,11 @@ class ASH_EXPORT ShelfModel {
// Returns the index of the item by id.
int ItemIndexByID(LauncherID id) const;
+ // Returns the |index| of the item matching |type| in |items_|.
+ // Returns -1 if the matching item is not found.
+ // Note: Requires a linear search.
+ int GetItemIndexForType(LauncherItemType type);
+
// Returns the index of the first panel or the index where the first panel
// would go if there are no panels.
int FirstPanelIndex() const;