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