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 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/shelf/shelf_types.h" | 12 #include "ash/shelf/shelf_types.h" |
13 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
14 #include "ash/wm/system_modal_container_event_filter_delegate.h" | 14 #include "ash/wm/system_modal_container_event_filter_delegate.h" |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
21 #include "ui/aura/client/activation_change_observer.h" | 21 #include "ui/aura/client/activation_change_observer.h" |
| 22 #include "ui/aura/window.h" |
22 #include "ui/base/ui_base_types.h" | 23 #include "ui/base/ui_base_types.h" |
23 #include "ui/events/event_target.h" | 24 #include "ui/events/event_target.h" |
24 #include "ui/gfx/insets.h" | 25 #include "ui/gfx/insets.h" |
25 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
26 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
27 #include "ui/views/corewm/cursor_manager.h" | 28 #include "ui/views/corewm/cursor_manager.h" |
28 | 29 |
29 class CommandLine; | 30 class CommandLine; |
30 | 31 |
31 namespace app_list { | 32 namespace app_list { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Shell is a singleton object that presents the Shell API and implements the | 158 // Shell is a singleton object that presents the Shell API and implements the |
158 // RootWindow's delegate interface. | 159 // RootWindow's delegate interface. |
159 // | 160 // |
160 // Upon creation, the Shell sets itself as the RootWindow's delegate, which | 161 // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
161 // takes ownership of the Shell. | 162 // takes ownership of the Shell. |
162 class ASH_EXPORT Shell | 163 class ASH_EXPORT Shell |
163 : public internal::SystemModalContainerEventFilterDelegate, | 164 : public internal::SystemModalContainerEventFilterDelegate, |
164 public ui::EventTarget, | 165 public ui::EventTarget, |
165 public aura::client::ActivationChangeObserver { | 166 public aura::client::ActivationChangeObserver { |
166 public: | 167 public: |
167 typedef std::vector<aura::RootWindow*> RootWindowList; | |
168 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; | 168 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; |
169 | 169 |
170 enum Direction { | 170 enum Direction { |
171 FORWARD, | 171 FORWARD, |
172 BACKWARD | 172 BACKWARD |
173 }; | 173 }; |
174 | 174 |
175 // A shell must be explicitly created so that it can call |Init()| with the | 175 // A shell must be explicitly created so that it can call |Init()| with the |
176 // delegate set. |delegate| can be NULL (if not required for initialization). | 176 // delegate set. |delegate| can be NULL (if not required for initialization). |
177 // Takes ownership of |delegate|. | 177 // Takes ownership of |delegate|. |
(...skipping 23 matching lines...) Expand all Loading... |
201 // The root window of the active window is used in most cases, but can | 201 // The root window of the active window is used in most cases, but can |
202 // be overridden by using ScopedTargetRootWindow(). | 202 // be overridden by using ScopedTargetRootWindow(). |
203 // If you want to get the root Window of the active window, just use | 203 // If you want to get the root Window of the active window, just use |
204 // |wm::GetActiveWindow()->GetRootWindow()|. | 204 // |wm::GetActiveWindow()->GetRootWindow()|. |
205 static aura::Window* GetTargetRootWindow(); | 205 static aura::Window* GetTargetRootWindow(); |
206 | 206 |
207 // Returns the global Screen object that's always active in ash. | 207 // Returns the global Screen object that's always active in ash. |
208 static gfx::Screen* GetScreen(); | 208 static gfx::Screen* GetScreen(); |
209 | 209 |
210 // Returns all root windows. | 210 // Returns all root windows. |
211 static RootWindowList GetAllRootWindows(); | 211 static aura::Window::Windows GetAllRootWindows(); |
212 | 212 |
213 static aura::Window* GetContainer(aura::Window* root_window, | 213 static aura::Window* GetContainer(aura::Window* root_window, |
214 int container_id); | 214 int container_id); |
215 static const aura::Window* GetContainer(const aura::Window* root_window, | 215 static const aura::Window* GetContainer(const aura::Window* root_window, |
216 int container_id); | 216 int container_id); |
217 | 217 |
218 // Returns the list of containers that match |container_id| in | 218 // Returns the list of containers that match |container_id| in |
219 // all root windows. If |priority_root| is given, the container | 219 // all root windows. If |priority_root| is given, the container |
220 // in the |priority_root| will be inserted at the top of the list. | 220 // in the |priority_root| will be inserted at the top of the list. |
221 static std::vector<aura::Window*> GetContainersFromAllRootWindows( | 221 static std::vector<aura::Window*> GetContainersFromAllRootWindows( |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 bool simulate_modal_window_open_for_testing_; | 691 bool simulate_modal_window_open_for_testing_; |
692 | 692 |
693 bool is_touch_hud_projection_enabled_; | 693 bool is_touch_hud_projection_enabled_; |
694 | 694 |
695 DISALLOW_COPY_AND_ASSIGN(Shell); | 695 DISALLOW_COPY_AND_ASSIGN(Shell); |
696 }; | 696 }; |
697 | 697 |
698 } // namespace ash | 698 } // namespace ash |
699 | 699 |
700 #endif // ASH_SHELL_H_ | 700 #endif // ASH_SHELL_H_ |
OLD | NEW |