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

Unified Diff: ash/launcher/launcher_util.cc

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for LauncherTest and observing LauncherModel in DelegateManager Created 7 years, 3 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: ash/launcher/launcher_util.cc
diff --git a/ash/launcher/launcher_util.cc b/ash/launcher/launcher_util.cc
index f7ba77f0bfc2f54263a3c9d571358d5e9de95528..fa33f6fa607921b72fcfbdd856a07ffd4a553154 100644
--- a/ash/launcher/launcher_util.cc
+++ b/ash/launcher/launcher_util.cc
@@ -5,7 +5,6 @@
#include "ash/launcher/launcher_util.h"
#include "ash/launcher/launcher_model.h"
-#include "ash/launcher/launcher_types.h"
namespace ash {
namespace launcher {
@@ -18,5 +17,21 @@ int GetBrowserItemIndex(const LauncherModel& launcher_model) {
return -1;
}
+ash::LauncherID GetBrowserItemID(const LauncherModel& launcher_model) {
+ for (size_t i = 0; i < launcher_model.items().size(); i++) {
+ if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT)
+ return launcher_model.items()[i].id;
+ }
+ return 0;
+}
+
+ash::LauncherID GetAppListItemID(const LauncherModel& launcher_model) {
+ for (size_t i = 0; i < launcher_model.items().size(); i++) {
+ if (launcher_model.items()[i].type == ash::TYPE_APP_LIST)
+ return launcher_model.items()[i].id;
+ }
+ return 0;
+}
+
} // namespace launcher
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698