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

Unified Diff: ash/shelf/shelf_util.cc

Issue 27369004: Change GetBrowserItemIndex() to GetLauncherItemIndexForType() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 | « ash/shelf/shelf_util.h ('k') | ash/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ash/shelf/shelf_util.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698