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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/launcher/background_animator.h" | 10 #include "ash/launcher/background_animator.h" |
| 11 #include "ash/wm/shelf_auto_hide_behavior.h" |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/gfx/size.h" |
13 | 15 |
14 namespace aura { | 16 namespace aura { |
15 class Window; | 17 class Window; |
16 } | 18 } |
17 | 19 |
18 namespace gfx { | 20 namespace gfx { |
19 class Rect; | 21 class Rect; |
20 } | 22 } |
21 | 23 |
22 namespace views { | 24 namespace views { |
(...skipping 14 matching lines...) Expand all Loading... |
37 | 39 |
38 class ASH_EXPORT Launcher : public internal::BackgroundAnimatorDelegate { | 40 class ASH_EXPORT Launcher : public internal::BackgroundAnimatorDelegate { |
39 public: | 41 public: |
40 explicit Launcher(aura::Window* window_container); | 42 explicit Launcher(aura::Window* window_container); |
41 virtual ~Launcher(); | 43 virtual ~Launcher(); |
42 | 44 |
43 // Sets the focus cycler. Also adds the launcher to the cycle. | 45 // Sets the focus cycler. Also adds the launcher to the cycle. |
44 void SetFocusCycler(internal::FocusCycler* focus_cycler); | 46 void SetFocusCycler(internal::FocusCycler* focus_cycler); |
45 internal::FocusCycler* GetFocusCycler(); | 47 internal::FocusCycler* GetFocusCycler(); |
46 | 48 |
| 49 void SetAlignment(ShelfAlignment alignment); |
| 50 ShelfAlignment alignment() const { return alignment_; } |
| 51 |
47 // Sets whether the launcher paints a background. Default is false, but is set | 52 // Sets whether the launcher paints a background. Default is false, but is set |
48 // to true if a window overlaps the shelf. | 53 // to true if a window overlaps the shelf. |
49 void SetPaintsBackground( | 54 void SetPaintsBackground( |
50 bool value, | 55 bool value, |
51 internal::BackgroundAnimator::ChangeType change_type); | 56 internal::BackgroundAnimator::ChangeType change_type); |
52 | 57 |
53 // Sets the width of the status area. | 58 // Sets the size of the status area. |
54 void SetStatusWidth(int width); | 59 void SetStatusSize(const gfx::Size& size); |
55 int GetStatusWidth(); | 60 const gfx::Size& status_size() const { return status_size_; } |
56 | 61 |
57 // Returns the screen bounds of the item for the specified window. If there is | 62 // Returns the screen bounds of the item for the specified window. If there is |
58 // no item for the specified window an empty rect is returned. | 63 // no item for the specified window an empty rect is returned. |
59 gfx::Rect GetScreenBoundsOfItemIconForWindow(aura::Window* window); | 64 gfx::Rect GetScreenBoundsOfItemIconForWindow(aura::Window* window); |
60 | 65 |
61 void AddIconObserver(LauncherIconObserver* observer); | 66 void AddIconObserver(LauncherIconObserver* observer); |
62 void RemoveIconObserver(LauncherIconObserver* observer); | 67 void RemoveIconObserver(LauncherIconObserver* observer); |
63 | 68 |
64 // Returns true if the Launcher is showing a context menu. | 69 // Returns true if the Launcher is showing a context menu. |
65 bool IsShowingMenu() const; | 70 bool IsShowingMenu() const; |
(...skipping 23 matching lines...) Expand all Loading... |
89 scoped_ptr<views::Widget> widget_; | 94 scoped_ptr<views::Widget> widget_; |
90 | 95 |
91 aura::Window* window_container_; | 96 aura::Window* window_container_; |
92 | 97 |
93 // Contents view of the widget. Houses the LauncherView. | 98 // Contents view of the widget. Houses the LauncherView. |
94 DelegateView* delegate_view_; | 99 DelegateView* delegate_view_; |
95 | 100 |
96 // LauncherView used to display icons. | 101 // LauncherView used to display icons. |
97 internal::LauncherView* launcher_view_; | 102 internal::LauncherView* launcher_view_; |
98 | 103 |
| 104 ShelfAlignment alignment_; |
| 105 |
99 scoped_ptr<LauncherDelegate> delegate_; | 106 scoped_ptr<LauncherDelegate> delegate_; |
100 | 107 |
| 108 // Size reserved for the status area. |
| 109 gfx::Size status_size_; |
| 110 |
101 // Used to animate the background. | 111 // Used to animate the background. |
102 internal::BackgroundAnimator background_animator_; | 112 internal::BackgroundAnimator background_animator_; |
103 | 113 |
104 DISALLOW_COPY_AND_ASSIGN(Launcher); | 114 DISALLOW_COPY_AND_ASSIGN(Launcher); |
105 }; | 115 }; |
106 | 116 |
107 } // namespace ash | 117 } // namespace ash |
108 | 118 |
109 #endif // ASH_LAUNCHER_LAUNCHER_H_ | 119 #endif // ASH_LAUNCHER_LAUNCHER_H_ |
OLD | NEW |