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 ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/launcher/launcher_button_host.h" | 12 #include "ash/launcher/launcher_button_host.h" |
13 #include "ash/launcher/launcher_model_observer.h" | 13 #include "ash/launcher/launcher_model_observer.h" |
| 14 #include "base/observer_list.h" |
14 #include "ui/views/context_menu_controller.h" | 15 #include "ui/views/context_menu_controller.h" |
15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
16 #include "ui/views/focus/focus_manager.h" | 17 #include "ui/views/focus/focus_manager.h" |
17 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
18 | 19 |
19 namespace views { | 20 namespace views { |
20 class BoundsAnimator; | 21 class BoundsAnimator; |
21 class ImageButton; | 22 class ImageButton; |
22 class MenuRunner; | 23 class MenuRunner; |
23 class ViewModel; | 24 class ViewModel; |
24 } | 25 } |
25 | 26 |
26 namespace ash { | 27 namespace ash { |
27 | 28 |
28 class LauncherDelegate; | 29 class LauncherDelegate; |
29 struct LauncherItem; | 30 struct LauncherItem; |
| 31 class LauncherIconObserver; |
30 class LauncherModel; | 32 class LauncherModel; |
31 | 33 |
32 namespace internal { | 34 namespace internal { |
33 | 35 |
34 class LauncherButton; | 36 class LauncherButton; |
35 | 37 |
36 class ASH_EXPORT LauncherView : public views::View, | 38 class ASH_EXPORT LauncherView : public views::View, |
37 public LauncherModelObserver, | 39 public LauncherModelObserver, |
38 public views::ButtonListener, | 40 public views::ButtonListener, |
39 public LauncherButtonHost, | 41 public LauncherButtonHost, |
(...skipping 19 matching lines...) Expand all Loading... |
59 | 61 |
60 LauncherView(LauncherModel* model, LauncherDelegate* delegate); | 62 LauncherView(LauncherModel* model, LauncherDelegate* delegate); |
61 virtual ~LauncherView(); | 63 virtual ~LauncherView(); |
62 | 64 |
63 void Init(); | 65 void Init(); |
64 | 66 |
65 // Returns the ideal bounds of the specified item, or an empty rect if id | 67 // Returns the ideal bounds of the specified item, or an empty rect if id |
66 // isn't know. | 68 // isn't know. |
67 gfx::Rect GetIdealBoundsOfItemIcon(LauncherID id); | 69 gfx::Rect GetIdealBoundsOfItemIcon(LauncherID id); |
68 | 70 |
| 71 void AddIconObserver(LauncherIconObserver* observer); |
| 72 void RemoveIconObserver(LauncherIconObserver* observer); |
| 73 |
69 // Returns true if we're showing a menu. | 74 // Returns true if we're showing a menu. |
70 bool IsShowingMenu() const; | 75 bool IsShowingMenu() const; |
71 | 76 |
72 // Overridden from FocusTraversable: | 77 // Overridden from FocusTraversable: |
73 virtual views::FocusSearch* GetFocusSearch() OVERRIDE; | 78 virtual views::FocusSearch* GetFocusSearch() OVERRIDE; |
74 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; | 79 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; |
75 virtual View* GetFocusTraversableParentView() OVERRIDE; | 80 virtual View* GetFocusTraversableParentView() OVERRIDE; |
76 | 81 |
77 private: | 82 private: |
78 class FadeOutAnimationDelegate; | 83 class FadeOutAnimationDelegate; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 LauncherID context_menu_id_; | 196 LauncherID context_menu_id_; |
192 | 197 |
193 scoped_ptr<views::FocusSearch> focus_search_; | 198 scoped_ptr<views::FocusSearch> focus_search_; |
194 | 199 |
195 #if !defined(OS_MACOSX) | 200 #if !defined(OS_MACOSX) |
196 scoped_ptr<views::MenuRunner> overflow_menu_runner_; | 201 scoped_ptr<views::MenuRunner> overflow_menu_runner_; |
197 | 202 |
198 scoped_ptr<views::MenuRunner> launcher_menu_runner_; | 203 scoped_ptr<views::MenuRunner> launcher_menu_runner_; |
199 #endif | 204 #endif |
200 | 205 |
| 206 ObserverList<LauncherIconObserver> observers_; |
| 207 |
201 DISALLOW_COPY_AND_ASSIGN(LauncherView); | 208 DISALLOW_COPY_AND_ASSIGN(LauncherView); |
202 }; | 209 }; |
203 | 210 |
204 } // namespace internal | 211 } // namespace internal |
205 } // namespace ash | 212 } // namespace ash |
206 | 213 |
207 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 214 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
OLD | NEW |