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

Unified Diff: chrome/browser/ui/aura/launcher_icon_updater.h

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 | « chrome/browser/ui/aura/chrome_shell_delegate.cc ('k') | chrome/browser/ui/aura/launcher_icon_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/aura/launcher_icon_updater.h
diff --git a/chrome/browser/ui/aura/launcher_icon_updater.h b/chrome/browser/ui/aura/launcher_icon_updater.h
new file mode 100644
index 0000000000000000000000000000000000000000..ade24c352797aa420b3baf2094e2a0d78b14aa57
--- /dev/null
+++ b/chrome/browser/ui/aura/launcher_icon_updater.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_AURA_LAUNCHER_ICON_UPDATER_H_
+#define CHROME_BROWSER_UI_AURA_LAUNCHER_ICON_UPDATER_H_
+#pragma once
+
+#include <deque>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/tabs/tab_strip_model_observer.h"
+
+namespace aura {
+class Window;
+}
+namespace aura_shell {
+class LauncherModel;
+}
+
+// LauncherIconUpdater is responsible for keeping the launcher representation
+// of a window up to date with the tabs.
+class LauncherIconUpdater : public TabStripModelObserver {
+ public:
+ LauncherIconUpdater(TabStripModel* tab_model,
+ aura_shell::LauncherModel* launcher_model,
+ aura::Window* window);
+ virtual ~LauncherIconUpdater();
+
+ // TabStripModel overrides:
+ virtual void TabInsertedAt(TabContentsWrapper* contents,
+ int index,
+ bool foreground) OVERRIDE;
+ virtual void TabDetachedAt(TabContentsWrapper* contents, int index) OVERRIDE;
+ virtual void TabSelectionChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripSelectionModel& old_model) OVERRIDE;
+ virtual void TabChangedAt(
+ TabContentsWrapper* tab,
+ int index,
+ TabStripModelObserver::TabChangeType change_type) OVERRIDE;
+
+ private:
+ typedef std::deque<TabContentsWrapper*> Tabs;
+
+ // Updates the launcher from the current set of tabs.
+ void UpdateLauncher();
+
+ TabStripModel* tab_model_;
+
+ aura_shell::LauncherModel* launcher_model_;
+
+ aura::Window* window_;
+
+ // The tabs. This is an MRU cache of the tabs in the tabstrip model.
+ Tabs tabs_;
+
+ DISALLOW_COPY_AND_ASSIGN(LauncherIconUpdater);
+};
+
+#endif // CHROME_BROWSER_UI_AURA_LAUNCHER_ICON_UPDATER_H_
« no previous file with comments | « chrome/browser/ui/aura/chrome_shell_delegate.cc ('k') | chrome/browser/ui/aura/launcher_icon_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698