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" | |
23 #include "ui/base/ui_base_types.h" | 22 #include "ui/base/ui_base_types.h" |
24 #include "ui/events/event_target.h" | 23 #include "ui/events/event_target.h" |
25 #include "ui/gfx/insets.h" | 24 #include "ui/gfx/insets.h" |
26 #include "ui/gfx/screen.h" | 25 #include "ui/gfx/screen.h" |
27 #include "ui/gfx/size.h" | 26 #include "ui/gfx/size.h" |
28 #include "ui/views/corewm/cursor_manager.h" | 27 #include "ui/views/corewm/cursor_manager.h" |
29 | 28 |
30 class CommandLine; | 29 class CommandLine; |
31 | 30 |
32 namespace app_list { | 31 namespace app_list { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // 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 |
160 // RootWindow's delegate interface. | 159 // RootWindow's delegate interface. |
161 // | 160 // |
162 // 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 |
163 // takes ownership of the Shell. | 162 // takes ownership of the Shell. |
164 class ASH_EXPORT Shell | 163 class ASH_EXPORT Shell |
165 : public internal::SystemModalContainerEventFilterDelegate, | 164 : public internal::SystemModalContainerEventFilterDelegate, |
166 public ui::EventTarget, | 165 public ui::EventTarget, |
167 public aura::client::ActivationChangeObserver { | 166 public aura::client::ActivationChangeObserver { |
168 public: | 167 public: |
| 168 typedef std::vector<aura::RootWindow*> RootWindowList; |
169 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; | 169 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; |
170 | 170 |
171 enum Direction { | 171 enum Direction { |
172 FORWARD, | 172 FORWARD, |
173 BACKWARD | 173 BACKWARD |
174 }; | 174 }; |
175 | 175 |
176 // A shell must be explicitly created so that it can call |Init()| with the | 176 // A shell must be explicitly created so that it can call |Init()| with the |
177 // delegate set. |delegate| can be NULL (if not required for initialization). | 177 // delegate set. |delegate| can be NULL (if not required for initialization). |
178 // Takes ownership of |delegate|. | 178 // Takes ownership of |delegate|. |
(...skipping 23 matching lines...) Expand all Loading... |
202 // The root window of the active window is used in most cases, but can | 202 // The root window of the active window is used in most cases, but can |
203 // be overridden by using ScopedTargetRootWindow(). | 203 // be overridden by using ScopedTargetRootWindow(). |
204 // If you want to get the root Window of the active window, just use | 204 // If you want to get the root Window of the active window, just use |
205 // |wm::GetActiveWindow()->GetRootWindow()|. | 205 // |wm::GetActiveWindow()->GetRootWindow()|. |
206 static aura::Window* GetTargetRootWindow(); | 206 static aura::Window* GetTargetRootWindow(); |
207 | 207 |
208 // Returns the global Screen object that's always active in ash. | 208 // Returns the global Screen object that's always active in ash. |
209 static gfx::Screen* GetScreen(); | 209 static gfx::Screen* GetScreen(); |
210 | 210 |
211 // Returns all root windows. | 211 // Returns all root windows. |
212 static aura::Window::Windows GetAllRootWindows(); | 212 static RootWindowList GetAllRootWindows(); |
213 | 213 |
214 static aura::Window* GetContainer(aura::Window* root_window, | 214 static aura::Window* GetContainer(aura::Window* root_window, |
215 int container_id); | 215 int container_id); |
216 static const aura::Window* GetContainer(const aura::Window* root_window, | 216 static const aura::Window* GetContainer(const aura::Window* root_window, |
217 int container_id); | 217 int container_id); |
218 | 218 |
219 // Returns the list of containers that match |container_id| in | 219 // Returns the list of containers that match |container_id| in |
220 // all root windows. If |priority_root| is given, the container | 220 // all root windows. If |priority_root| is given, the container |
221 // in the |priority_root| will be inserted at the top of the list. | 221 // in the |priority_root| will be inserted at the top of the list. |
222 static std::vector<aura::Window*> GetContainersFromAllRootWindows( | 222 static std::vector<aura::Window*> GetContainersFromAllRootWindows( |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 bool simulate_modal_window_open_for_testing_; | 697 bool simulate_modal_window_open_for_testing_; |
698 | 698 |
699 bool is_touch_hud_projection_enabled_; | 699 bool is_touch_hud_projection_enabled_; |
700 | 700 |
701 DISALLOW_COPY_AND_ASSIGN(Shell); | 701 DISALLOW_COPY_AND_ASSIGN(Shell); |
702 }; | 702 }; |
703 | 703 |
704 } // namespace ash | 704 } // namespace ash |
705 | 705 |
706 #endif // ASH_SHELL_H_ | 706 #endif // ASH_SHELL_H_ |
OLD | NEW |