Index: ash/shelf/shelf_util.cc |
diff --git a/ash/shelf/shelf_util.cc b/ash/shelf/shelf_util.cc |
index 07dfbbe34e81d25af4faf2a4ea2854d7185bbc68..8190b425629ae7f7a2adf58f62efd24ec18f7311 100644 |
--- a/ash/shelf/shelf_util.cc |
+++ b/ash/shelf/shelf_util.cc |
@@ -5,13 +5,14 @@ |
#include "ash/shelf/shelf_util.h" |
#include "ash/launcher/launcher_model.h" |
-#include "ash/launcher/launcher_types.h" |
namespace ash { |
-int GetBrowserItemIndex(const LauncherModel& launcher_model) { |
+int GetLauncherItemIndexForType(LauncherItemType type, |
+ const LauncherModel& launcher_model) { |
+ DCHECK(type == TYPE_BROWSER_SHORTCUT || type == TYPE_APP_LIST); |
sky
2013/10/22 20:05:17
Why does the type need to be one of these?
simonhong_
2013/10/22 20:22:35
Because other types can have many items.
Do we nee
|
for (size_t i = 0; i < launcher_model.items().size(); i++) { |
- if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT) |
+ if (launcher_model.items()[i].type == type) |
return i; |
} |
return -1; |