OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace aura { | 27 namespace aura { |
28 class Window; | 28 class Window; |
29 } | 29 } |
30 | 30 |
31 // LauncherUpdater is responsible for keeping the launcher representation of a | 31 // LauncherUpdater is responsible for keeping the launcher representation of a |
32 // window up to date as the tab strip changes. | 32 // window up to date as the tab strip changes. |
33 class LauncherUpdater : public TabStripModelObserver { | 33 class LauncherUpdater : public TabStripModelObserver { |
34 public: | 34 public: |
35 enum Type { | 35 enum Type { |
36 TYPE_APP, | 36 TYPE_APP, |
| 37 TYPE_PANEL, |
37 TYPE_TABBED | 38 TYPE_TABBED |
38 }; | 39 }; |
39 | 40 |
40 LauncherUpdater(aura::Window* window, | 41 LauncherUpdater(aura::Window* window, |
41 TabStripModel* tab_model, | 42 TabStripModel* tab_model, |
42 ChromeLauncherDelegate* launcher_delegate, | 43 ChromeLauncherDelegate* launcher_delegate, |
43 Type type, | 44 Type type, |
44 const std::string& app_id); | 45 const std::string& app_id); |
45 virtual ~LauncherUpdater(); | 46 virtual ~LauncherUpdater(); |
46 | 47 |
47 // Sets up this LauncherUpdater. | 48 // Sets up this LauncherUpdater. |
48 void Init(); | 49 void Init(); |
49 | 50 |
50 // Creates and returns a new LauncherUpdater for |browser|. This returns | 51 // Creates and returns a new LauncherUpdater for |browser|. This returns |
51 // NULL if a LauncherUpdater is not needed for the specified browser. | 52 // NULL if a LauncherUpdater is not needed for the specified browser. |
52 static LauncherUpdater* Create(Browser* browser); | 53 static LauncherUpdater* Create(Browser* browser); |
53 | 54 |
54 aura::Window* window() { return window_; } | 55 aura::Window* window() { return window_; } |
55 | 56 |
56 TabStripModel* tab_model() { return tab_model_; } | 57 TabStripModel* tab_model() { return tab_model_; } |
57 | 58 |
| 59 Type type() const { return type_; } |
| 60 |
58 TabContentsWrapper* GetTab(ash::LauncherID id); | 61 TabContentsWrapper* GetTab(ash::LauncherID id); |
59 | 62 |
60 // TabStripModel overrides: | 63 // TabStripModel overrides: |
61 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, | 64 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, |
62 TabContentsWrapper* new_contents, | 65 TabContentsWrapper* new_contents, |
63 int index, | 66 int index, |
64 bool user_gesture) OVERRIDE; | 67 bool user_gesture) OVERRIDE; |
65 virtual void TabChangedAt( | 68 virtual void TabChangedAt( |
66 TabContentsWrapper* tab, | 69 TabContentsWrapper* tab, |
67 int index, | 70 int index, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // . Otherwise this is the id of the TYPE_TABBED item. | 140 // . Otherwise this is the id of the TYPE_TABBED item. |
138 ash::LauncherID item_id_; | 141 ash::LauncherID item_id_; |
139 | 142 |
140 // Used for any app tabs. | 143 // Used for any app tabs. |
141 AppTabMap app_map_; | 144 AppTabMap app_map_; |
142 | 145 |
143 DISALLOW_COPY_AND_ASSIGN(LauncherUpdater); | 146 DISALLOW_COPY_AND_ASSIGN(LauncherUpdater); |
144 }; | 147 }; |
145 | 148 |
146 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ | 149 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_LAUNCHER_UPDATER_H_ |
OLD | NEW |