| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_ROOT_WINDOW_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_H_ |
| 6 #define UI_AURA_ROOT_WINDOW_H_ | 6 #define UI_AURA_ROOT_WINDOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class Transform; | 30 class Transform; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace aura { | 33 namespace aura { |
| 34 | 34 |
| 35 class RootWindowHost; | 35 class RootWindowHost; |
| 36 class RootWindowObserver; | 36 class RootWindowObserver; |
| 37 class KeyEvent; | 37 class KeyEvent; |
| 38 class MouseEvent; | 38 class MouseEvent; |
| 39 class ScreenAura; | 39 class ScreenAura; |
| 40 class StackingClient; | |
| 41 class TouchEvent; | 40 class TouchEvent; |
| 42 | 41 |
| 43 // RootWindow is responsible for hosting a set of windows. | 42 // RootWindow is responsible for hosting a set of windows. |
| 44 class AURA_EXPORT RootWindow : public ui::CompositorDelegate, | 43 class AURA_EXPORT RootWindow : public ui::CompositorDelegate, |
| 45 public Window, | 44 public Window, |
| 46 public internal::FocusManager, | 45 public internal::FocusManager, |
| 47 public ui::LayerAnimationObserver { | 46 public ui::LayerAnimationObserver { |
| 48 public: | 47 public: |
| 49 static RootWindow* GetInstance(); | 48 static RootWindow* GetInstance(); |
| 50 static void DeleteInstance(); | 49 static void DeleteInstance(); |
| 51 | 50 |
| 52 static void set_use_fullscreen_host_window(bool use_fullscreen) { | 51 static void set_use_fullscreen_host_window(bool use_fullscreen) { |
| 53 use_fullscreen_host_window_ = use_fullscreen; | 52 use_fullscreen_host_window_ = use_fullscreen; |
| 54 } | 53 } |
| 55 | 54 |
| 56 ui::Compositor* compositor() { return compositor_.get(); } | 55 ui::Compositor* compositor() { return compositor_.get(); } |
| 57 gfx::Point last_mouse_location() const { return last_mouse_location_; } | 56 gfx::Point last_mouse_location() const { return last_mouse_location_; } |
| 58 gfx::NativeCursor last_cursor() const { return last_cursor_; } | 57 gfx::NativeCursor last_cursor() const { return last_cursor_; } |
| 59 StackingClient* stacking_client() { return stacking_client_.get(); } | |
| 60 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 58 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
| 61 Window* capture_window() { return capture_window_; } | 59 Window* capture_window() { return capture_window_; } |
| 62 ScreenAura* screen() { return screen_; } | 60 ScreenAura* screen() { return screen_; } |
| 63 | 61 |
| 64 void SetStackingClient(StackingClient* stacking_client); | |
| 65 | |
| 66 // Shows the root window host. | 62 // Shows the root window host. |
| 67 void ShowRootWindow(); | 63 void ShowRootWindow(); |
| 68 | 64 |
| 69 // Sets the size of the root window. | 65 // Sets the size of the root window. |
| 70 void SetHostSize(const gfx::Size& size); | 66 void SetHostSize(const gfx::Size& size); |
| 71 gfx::Size GetHostSize() const; | 67 gfx::Size GetHostSize() const; |
| 72 | 68 |
| 73 // Shows the specified cursor. | 69 // Shows the specified cursor. |
| 74 void SetCursor(gfx::NativeCursor cursor); | 70 void SetCursor(gfx::NativeCursor cursor); |
| 75 | 71 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 void Init(); | 170 void Init(); |
| 175 | 171 |
| 176 // Parses the switch describing the initial size for the host window and | 172 // Parses the switch describing the initial size for the host window and |
| 177 // returns bounds for the window. | 173 // returns bounds for the window. |
| 178 gfx::Rect GetInitialHostWindowBounds() const; | 174 gfx::Rect GetInitialHostWindowBounds() const; |
| 179 | 175 |
| 180 scoped_refptr<ui::Compositor> compositor_; | 176 scoped_refptr<ui::Compositor> compositor_; |
| 181 | 177 |
| 182 scoped_ptr<RootWindowHost> host_; | 178 scoped_ptr<RootWindowHost> host_; |
| 183 | 179 |
| 184 scoped_ptr<StackingClient> stacking_client_; | |
| 185 | |
| 186 static RootWindow* instance_; | 180 static RootWindow* instance_; |
| 187 | 181 |
| 188 // If set before the RootWindow is created, the host window will cover the | 182 // If set before the RootWindow is created, the host window will cover the |
| 189 // entire screen. Note that this can still be overridden via the | 183 // entire screen. Note that this can still be overridden via the |
| 190 // switches::kAuraHostWindowSize flag. | 184 // switches::kAuraHostWindowSize flag. |
| 191 static bool use_fullscreen_host_window_; | 185 static bool use_fullscreen_host_window_; |
| 192 | 186 |
| 193 // Used to schedule painting. | 187 // Used to schedule painting. |
| 194 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; | 188 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; |
| 195 | 189 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 214 Window* mouse_moved_handler_; | 208 Window* mouse_moved_handler_; |
| 215 Window* focused_window_; | 209 Window* focused_window_; |
| 216 Window* touch_event_handler_; | 210 Window* touch_event_handler_; |
| 217 | 211 |
| 218 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 212 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
| 219 }; | 213 }; |
| 220 | 214 |
| 221 } // namespace aura | 215 } // namespace aura |
| 222 | 216 |
| 223 #endif // UI_AURA_ROOT_WINDOW_H_ | 217 #endif // UI_AURA_ROOT_WINDOW_H_ |
| OLD | NEW |