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_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_H_ |
6 #define ASH_LAUNCHER_LAUNCHER_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/launcher/background_animator.h" | 9 #include "ash/launcher/background_animator.h" |
10 #include "ash/launcher/launcher_types.h" | 10 #include "ash/launcher/launcher_types.h" |
11 #include "ash/shelf_types.h" | 11 #include "ash/shelf_types.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
15 #include "ui/views/widget/widget_observer.h" | |
16 | 15 |
17 namespace aura { | 16 namespace aura { |
18 class Window; | 17 class Window; |
19 } | 18 } |
20 | 19 |
21 namespace gfx { | 20 namespace gfx { |
22 class Rect; | 21 class Rect; |
23 } | 22 } |
24 | 23 |
25 namespace views { | 24 namespace views { |
26 class View; | 25 class View; |
27 class Widget; | 26 class Widget; |
28 } | 27 } |
29 | 28 |
30 namespace ash { | 29 namespace ash { |
31 | 30 |
32 namespace internal { | 31 namespace internal { |
33 class FocusCycler; | 32 class FocusCycler; |
34 class LauncherView; | 33 class LauncherView; |
35 class ShelfLayoutManager; | 34 class ShelfLayoutManager; |
36 } | 35 } |
37 | 36 |
38 class LauncherIconObserver; | 37 class LauncherIconObserver; |
39 class LauncherDelegate; | 38 class LauncherDelegate; |
40 class LauncherModel; | 39 class LauncherModel; |
41 | 40 |
42 class ASH_EXPORT Launcher: public views::WidgetObserver { | 41 class ASH_EXPORT Launcher { |
43 public: | 42 public: |
44 Launcher(LauncherModel* launcher_model, | 43 Launcher(LauncherModel* launcher_model, |
45 LauncherDelegate* launcher_delegate, | 44 LauncherDelegate* launcher_delegate, |
46 aura::Window* window_container, | 45 aura::Window* window_container, |
47 internal::ShelfLayoutManager* shelf_layout_manager); | 46 internal::ShelfLayoutManager* shelf_layout_manager); |
48 virtual ~Launcher(); | 47 virtual ~Launcher(); |
49 | 48 |
50 // Return the launcher for the primary display. NULL if no user is | 49 // Return the launcher for the primary display. NULL if no user is |
51 // logged in yet. | 50 // logged in yet. |
52 static Launcher* ForPrimaryDisplay(); | 51 static Launcher* ForPrimaryDisplay(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 internal::LauncherView* GetLauncherViewForTest(); | 117 internal::LauncherView* GetLauncherViewForTest(); |
119 | 118 |
120 LauncherDelegate* delegate() { return delegate_; } | 119 LauncherDelegate* delegate() { return delegate_; } |
121 | 120 |
122 views::Widget* widget() { return widget_.get(); } | 121 views::Widget* widget() { return widget_.get(); } |
123 | 122 |
124 views::Widget* GetDimmerWidgetForTest() { return dimmer_.get(); } | 123 views::Widget* GetDimmerWidgetForTest() { return dimmer_.get(); } |
125 | 124 |
126 aura::Window* window_container() { return window_container_; } | 125 aura::Window* window_container() { return window_container_; } |
127 | 126 |
128 // Called by the activation delegate, before the launcher is activated | |
129 // when no other windows are visible. | |
130 void WillActivateAsFallback() { activating_as_fallback_ = true; } | |
131 | |
132 // Overridden from views::WidgetObserver: | |
133 void OnWidgetActivationChanged(views::Widget* widget, bool active) OVERRIDE; | |
134 | |
135 private: | 127 private: |
136 class DelegateView; | 128 class DelegateView; |
137 | 129 |
138 // Widget hosting the view. | 130 // Widget hosting the view. |
139 scoped_ptr<views::Widget> widget_; | 131 scoped_ptr<views::Widget> widget_; |
140 scoped_ptr<views::Widget> dimmer_; | 132 scoped_ptr<views::Widget> dimmer_; |
141 | 133 |
142 aura::Window* window_container_; | 134 aura::Window* window_container_; |
143 | 135 |
144 // Contents view of the widget. Houses the LauncherView. | 136 // Contents view of the widget. Houses the LauncherView. |
145 DelegateView* delegate_view_; | 137 DelegateView* delegate_view_; |
146 | 138 |
147 // LauncherView used to display icons. | 139 // LauncherView used to display icons. |
148 internal::LauncherView* launcher_view_; | 140 internal::LauncherView* launcher_view_; |
149 | 141 |
150 ShelfAlignment alignment_; | 142 ShelfAlignment alignment_; |
151 | 143 |
152 LauncherDelegate* delegate_; | 144 LauncherDelegate* delegate_; |
153 | 145 |
154 // Size reserved for the status area. | 146 // Size reserved for the status area. |
155 gfx::Size status_size_; | 147 gfx::Size status_size_; |
156 | 148 |
157 // Used to animate the background. | 149 // Used to animate the background. |
158 internal::BackgroundAnimator background_animator_; | 150 internal::BackgroundAnimator background_animator_; |
159 | 151 |
160 // Used then activation is forced from the activation delegate. | |
161 bool activating_as_fallback_; | |
162 | |
163 DISALLOW_COPY_AND_ASSIGN(Launcher); | 152 DISALLOW_COPY_AND_ASSIGN(Launcher); |
164 }; | 153 }; |
165 | 154 |
166 } // namespace ash | 155 } // namespace ash |
167 | 156 |
168 #endif // ASH_LAUNCHER_LAUNCHER_H_ | 157 #endif // ASH_LAUNCHER_LAUNCHER_H_ |
OLD | NEW |