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

Unified Diff: ui/aura_shell/launcher/launcher_model.cc

Issue 8289022: Wires keeping the launcher up to date with the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 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 | « ui/aura_shell/launcher/launcher_model.h ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/launcher/launcher_model.cc
diff --git a/ui/aura_shell/launcher/launcher_model.cc b/ui/aura_shell/launcher/launcher_model.cc
index 43a6d00ac923500ad375018ffeb3ceee00c7012f..5f4502e896c73d575a8667f9e89014303c75ac31 100644
--- a/ui/aura_shell/launcher/launcher_model.cc
+++ b/ui/aura_shell/launcher/launcher_model.cc
@@ -4,6 +4,7 @@
#include "ui/aura_shell/launcher/launcher_model.h"
+#include "ui/aura/window.h"
#include "ui/aura_shell/launcher/launcher_model_observer.h"
namespace aura_shell {
@@ -45,6 +46,21 @@ void LauncherModel::SetAppImage(int index, const SkBitmap& image) {
LauncherItemImagesChanged(index));
}
+int LauncherModel::ItemIndexByWindow(aura::Window* window) {
+ LauncherItems::const_iterator i = ItemByWindow(window);
+ return i == items_.end() ? -1 : static_cast<int>((i - items_.begin()));
+}
+
+LauncherItems::const_iterator LauncherModel::ItemByWindow(
+ aura::Window* window) const {
+ for (LauncherItems::const_iterator i = items_.begin();
+ i != items_.end(); ++i) {
+ if (i->window == window)
+ return i;
+ }
+ return items_.end();
+}
+
void LauncherModel::AddObserver(LauncherModelObserver* observer) {
observers_.AddObserver(observer);
}
« no previous file with comments | « ui/aura_shell/launcher/launcher_model.h ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698