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_SHELL_H_ | 5 #ifndef ASH_SHELL_H_ |
6 #define ASH_SHELL_H_ | 6 #define ASH_SHELL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 class PowerButtonController; | 39 class PowerButtonController; |
40 class ShellDelegate; | 40 class ShellDelegate; |
41 class VideoDetector; | 41 class VideoDetector; |
42 class WindowCycleController; | 42 class WindowCycleController; |
43 | 43 |
44 namespace internal { | 44 namespace internal { |
45 class ActivationController; | 45 class ActivationController; |
46 class AcceleratorFilter; | 46 class AcceleratorFilter; |
47 class AppList; | 47 class AppList; |
48 class DragDropController; | 48 class DragDropController; |
| 49 class FocusCycler; |
49 class InputMethodEventFilter; | 50 class InputMethodEventFilter; |
50 class RootWindowLayoutManager; | 51 class RootWindowLayoutManager; |
51 class ShadowController; | 52 class ShadowController; |
52 class StackingController; | 53 class StackingController; |
53 class TooltipController; | 54 class TooltipController; |
54 class VisibilityController; | 55 class VisibilityController; |
55 class WindowModalityController; | 56 class WindowModalityController; |
56 class WorkspaceController; | 57 class WorkspaceController; |
57 } | 58 } |
58 | 59 |
59 // Shell is a singleton object that presents the Shell API and implements the | 60 // Shell is a singleton object that presents the Shell API and implements the |
60 // RootWindow's delegate interface. | 61 // RootWindow's delegate interface. |
61 // | 62 // |
62 // Upon creation, the Shell sets itself as the RootWindow's delegate, which | 63 // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
63 // takes ownership of the Shell. | 64 // takes ownership of the Shell. |
64 class ASH_EXPORT Shell { | 65 class ASH_EXPORT Shell { |
65 public: | 66 public: |
66 // In compact window mode we fill the screen with a single maximized window, | 67 // In compact window mode we fill the screen with a single maximized window, |
67 // similar to ChromeOS R17 and earlier. In normal mode we have draggable | 68 // similar to ChromeOS R17 and earlier. In normal mode we have draggable |
68 // windows. | 69 // windows. |
69 enum WindowMode { | 70 enum WindowMode { |
70 NORMAL_MODE, | 71 NORMAL_MODE, |
71 COMPACT_MODE | 72 COMPACT_MODE |
72 }; | 73 }; |
73 | 74 |
| 75 enum Direction { |
| 76 FORWARD, |
| 77 BACKWARD |
| 78 }; |
| 79 |
74 // A shell must be explicitly created so that it can call |Init()| with the | 80 // A shell must be explicitly created so that it can call |Init()| with the |
75 // delegate set. |delegate| can be NULL (if not required for initialization). | 81 // delegate set. |delegate| can be NULL (if not required for initialization). |
76 static Shell* CreateInstance(ShellDelegate* delegate); | 82 static Shell* CreateInstance(ShellDelegate* delegate); |
77 | 83 |
78 // Should never be called before |CreateInstance()|. | 84 // Should never be called before |CreateInstance()|. |
79 static Shell* GetInstance(); | 85 static Shell* GetInstance(); |
80 | 86 |
81 static void DeleteInstance(); | 87 static void DeleteInstance(); |
82 | 88 |
83 aura::Window* GetContainer(int container_id); | 89 aura::Window* GetContainer(int container_id); |
(...skipping 22 matching lines...) Expand all Loading... |
106 bool IsModalWindowOpen() const; | 112 bool IsModalWindowOpen() const; |
107 | 113 |
108 // See enum WindowMode for details. | 114 // See enum WindowMode for details. |
109 bool IsWindowModeCompact() const { return window_mode_ == COMPACT_MODE; } | 115 bool IsWindowModeCompact() const { return window_mode_ == COMPACT_MODE; } |
110 | 116 |
111 // Creates a default views::NonClientFrameView for use by windows in the | 117 // Creates a default views::NonClientFrameView for use by windows in the |
112 // Ash environment. | 118 // Ash environment. |
113 views::NonClientFrameView* CreateDefaultNonClientFrameView( | 119 views::NonClientFrameView* CreateDefaultNonClientFrameView( |
114 views::Widget* widget); | 120 views::Widget* widget); |
115 | 121 |
| 122 // Rotate focus through containers that can recieve focus. |
| 123 void RotateFocus(Direction direction); |
| 124 |
116 AcceleratorController* accelerator_controller() { | 125 AcceleratorController* accelerator_controller() { |
117 return accelerator_controller_.get(); | 126 return accelerator_controller_.get(); |
118 } | 127 } |
119 internal::TooltipController* tooltip_controller() { | 128 internal::TooltipController* tooltip_controller() { |
120 return tooltip_controller_.get(); | 129 return tooltip_controller_.get(); |
121 } | 130 } |
122 PowerButtonController* power_button_controller() { | 131 PowerButtonController* power_button_controller() { |
123 return power_button_controller_.get(); | 132 return power_button_controller_.get(); |
124 } | 133 } |
125 VideoDetector* video_detector() { | 134 VideoDetector* video_detector() { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 scoped_ptr<internal::ActivationController> activation_controller_; | 190 scoped_ptr<internal::ActivationController> activation_controller_; |
182 scoped_ptr<internal::WindowModalityController> window_modality_controller_; | 191 scoped_ptr<internal::WindowModalityController> window_modality_controller_; |
183 scoped_ptr<internal::DragDropController> drag_drop_controller_; | 192 scoped_ptr<internal::DragDropController> drag_drop_controller_; |
184 scoped_ptr<internal::WorkspaceController> workspace_controller_; | 193 scoped_ptr<internal::WorkspaceController> workspace_controller_; |
185 scoped_ptr<internal::ShadowController> shadow_controller_; | 194 scoped_ptr<internal::ShadowController> shadow_controller_; |
186 scoped_ptr<internal::TooltipController> tooltip_controller_; | 195 scoped_ptr<internal::TooltipController> tooltip_controller_; |
187 scoped_ptr<internal::VisibilityController> visibility_controller_; | 196 scoped_ptr<internal::VisibilityController> visibility_controller_; |
188 scoped_ptr<PowerButtonController> power_button_controller_; | 197 scoped_ptr<PowerButtonController> power_button_controller_; |
189 scoped_ptr<VideoDetector> video_detector_; | 198 scoped_ptr<VideoDetector> video_detector_; |
190 scoped_ptr<WindowCycleController> window_cycle_controller_; | 199 scoped_ptr<WindowCycleController> window_cycle_controller_; |
| 200 scoped_ptr<internal::FocusCycler> focus_cycler_; |
191 | 201 |
192 // An event filter that pre-handles all key events to send them to an IME. | 202 // An event filter that pre-handles all key events to send them to an IME. |
193 scoped_ptr<internal::InputMethodEventFilter> input_method_filter_; | 203 scoped_ptr<internal::InputMethodEventFilter> input_method_filter_; |
194 // An event filter that pre-handles global accelerators. | 204 // An event filter that pre-handles global accelerators. |
195 scoped_ptr<internal::AcceleratorFilter> accelerator_filter_; | 205 scoped_ptr<internal::AcceleratorFilter> accelerator_filter_; |
196 | 206 |
197 // Can change at runtime. | 207 // Can change at runtime. |
198 WindowMode window_mode_; | 208 WindowMode window_mode_; |
199 | 209 |
200 // Owned by aura::RootWindow, cached here for type safety. | 210 // Owned by aura::RootWindow, cached here for type safety. |
201 internal::RootWindowLayoutManager* root_window_layout_; | 211 internal::RootWindowLayoutManager* root_window_layout_; |
202 | 212 |
203 // Status area with clock, Wi-Fi signal, etc. | 213 // Status area with clock, Wi-Fi signal, etc. |
204 views::Widget* status_widget_; | 214 views::Widget* status_widget_; |
205 | 215 |
206 DISALLOW_COPY_AND_ASSIGN(Shell); | 216 DISALLOW_COPY_AND_ASSIGN(Shell); |
207 }; | 217 }; |
208 | 218 |
209 } // namespace ash | 219 } // namespace ash |
210 | 220 |
211 #endif // ASH_SHELL_H_ | 221 #endif // ASH_SHELL_H_ |
OLD | NEW |