| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 11 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
| 12 | 12 |
| 13 class TabContentsWrapper; | 13 class TabContentsWrapper; |
| 14 | 14 |
| 15 namespace aura { | 15 namespace aura { |
| 16 class Window; | 16 class Window; |
| 17 } | 17 } |
| 18 namespace aura_shell { | 18 namespace ash { |
| 19 class LauncherModel; | 19 class LauncherModel; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // LauncherIconUpdater is responsible for keeping the launcher representation | 22 // LauncherIconUpdater is responsible for keeping the launcher representation |
| 23 // of a window up to date as the tab strip changes. | 23 // of a window up to date as the tab strip changes. |
| 24 class LauncherIconUpdater : public TabStripModelObserver { | 24 class LauncherIconUpdater : public TabStripModelObserver { |
| 25 public: | 25 public: |
| 26 LauncherIconUpdater(TabStripModel* tab_model, | 26 LauncherIconUpdater(TabStripModel* tab_model, |
| 27 aura_shell::LauncherModel* launcher_model, | 27 ash::LauncherModel* launcher_model, |
| 28 aura::Window* window); | 28 aura::Window* window); |
| 29 virtual ~LauncherIconUpdater(); | 29 virtual ~LauncherIconUpdater(); |
| 30 | 30 |
| 31 // TabStripModel overrides: | 31 // TabStripModel overrides: |
| 32 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, | 32 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, |
| 33 TabContentsWrapper* new_contents, | 33 TabContentsWrapper* new_contents, |
| 34 int index, | 34 int index, |
| 35 bool user_gesture) OVERRIDE; | 35 bool user_gesture) OVERRIDE; |
| 36 virtual void TabChangedAt( | 36 virtual void TabChangedAt( |
| 37 TabContentsWrapper* tab, | 37 TabContentsWrapper* tab, |
| 38 int index, | 38 int index, |
| 39 TabStripModelObserver::TabChangeType change_type) OVERRIDE; | 39 TabStripModelObserver::TabChangeType change_type) OVERRIDE; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Updates the launcher from |tab|. | 42 // Updates the launcher from |tab|. |
| 43 void UpdateLauncher(TabContentsWrapper* tab); | 43 void UpdateLauncher(TabContentsWrapper* tab); |
| 44 | 44 |
| 45 TabStripModel* tab_model_; | 45 TabStripModel* tab_model_; |
| 46 | 46 |
| 47 aura_shell::LauncherModel* launcher_model_; | 47 ash::LauncherModel* launcher_model_; |
| 48 | 48 |
| 49 // Used to index into the model. | 49 // Used to index into the model. |
| 50 aura::Window* window_; | 50 aura::Window* window_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(LauncherIconUpdater); | 52 DISALLOW_COPY_AND_ASSIGN(LauncherIconUpdater); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ | 55 #endif // CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_ICON_UPDATER_H_ |
| OLD | NEW |