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_DESKTOP_H_ | 5 #ifndef UI_AURA_DESKTOP_H_ |
6 #define UI_AURA_DESKTOP_H_ | 6 #define UI_AURA_DESKTOP_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 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 class LayerAnimationSequence; | 29 class LayerAnimationSequence; |
30 class Transform; | 30 class Transform; |
31 } | 31 } |
32 | 32 |
33 namespace aura { | 33 namespace aura { |
34 | 34 |
35 class DesktopHost; | 35 class DesktopHost; |
36 class DesktopObserver; | 36 class DesktopObserver; |
37 class DragDropClient; | |
37 class KeyEvent; | 38 class KeyEvent; |
38 class MouseEvent; | 39 class MouseEvent; |
39 class ScreenAura; | 40 class ScreenAura; |
40 class StackingClient; | 41 class StackingClient; |
41 class TouchEvent; | 42 class TouchEvent; |
42 | 43 |
43 // Desktop is responsible for hosting a set of windows. | 44 // Desktop is responsible for hosting a set of windows. |
44 class AURA_EXPORT Desktop : public ui::CompositorDelegate, | 45 class AURA_EXPORT Desktop : public ui::CompositorDelegate, |
45 public Window, | 46 public Window, |
46 public internal::FocusManager, | 47 public internal::FocusManager, |
47 public ui::LayerAnimationObserver { | 48 public ui::LayerAnimationObserver { |
48 public: | 49 public: |
49 Desktop(); | 50 Desktop(); |
50 virtual ~Desktop(); | 51 virtual ~Desktop(); |
51 | 52 |
52 static Desktop* GetInstance(); | 53 static Desktop* GetInstance(); |
53 static void DeleteInstanceForTesting(); | 54 static void DeleteInstanceForTesting(); |
54 | 55 |
55 static void set_use_fullscreen_host_window(bool use_fullscreen) { | 56 static void set_use_fullscreen_host_window(bool use_fullscreen) { |
56 use_fullscreen_host_window_ = use_fullscreen; | 57 use_fullscreen_host_window_ = use_fullscreen; |
57 } | 58 } |
58 | 59 |
59 ui::Compositor* compositor() { return compositor_.get(); } | 60 ui::Compositor* compositor() { return compositor_.get(); } |
60 gfx::Point last_mouse_location() const { return last_mouse_location_; } | 61 gfx::Point last_mouse_location() const { return last_mouse_location_; } |
61 gfx::NativeCursor last_cursor() const { return last_cursor_; } | 62 gfx::NativeCursor last_cursor() const { return last_cursor_; } |
62 StackingClient* stacking_client() { return stacking_client_.get(); } | 63 StackingClient* stacking_client() { return stacking_client_.get(); } |
64 DragDropClient* drag_drop_client() { return drag_drop_client_.get(); } | |
Ben Goodger (Google)
2011/11/11 17:26:53
Since it looks like Desktop isn't actually using t
varunjain
2011/11/15 19:39:33
Done.
| |
63 Window* active_window() { return active_window_; } | 65 Window* active_window() { return active_window_; } |
64 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 66 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
65 Window* capture_window() { return capture_window_; } | 67 Window* capture_window() { return capture_window_; } |
66 ScreenAura* screen() { return screen_; } | 68 ScreenAura* screen() { return screen_; } |
67 | 69 |
68 void SetStackingClient(StackingClient* stacking_client); | 70 void SetStackingClient(StackingClient* stacking_client); |
69 | 71 |
72 void SetDragDropClient(DragDropClient* stacking_client); | |
73 | |
70 // Shows the desktop host. | 74 // Shows the desktop host. |
71 void ShowDesktop(); | 75 void ShowDesktop(); |
72 | 76 |
73 // Sets the size of the desktop. | 77 // Sets the size of the desktop. |
74 void SetHostSize(const gfx::Size& size); | 78 void SetHostSize(const gfx::Size& size); |
75 gfx::Size GetHostSize() const; | 79 gfx::Size GetHostSize() const; |
76 | 80 |
77 // Shows the specified cursor. | 81 // Shows the specified cursor. |
78 void SetCursor(gfx::NativeCursor cursor); | 82 void SetCursor(gfx::NativeCursor cursor); |
79 | 83 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 // Parses the switch describing the initial size for the host window and | 174 // Parses the switch describing the initial size for the host window and |
171 // returns bounds for the window. | 175 // returns bounds for the window. |
172 gfx::Rect GetInitialHostWindowBounds() const; | 176 gfx::Rect GetInitialHostWindowBounds() const; |
173 | 177 |
174 scoped_refptr<ui::Compositor> compositor_; | 178 scoped_refptr<ui::Compositor> compositor_; |
175 | 179 |
176 scoped_ptr<DesktopHost> host_; | 180 scoped_ptr<DesktopHost> host_; |
177 | 181 |
178 scoped_ptr<StackingClient> stacking_client_; | 182 scoped_ptr<StackingClient> stacking_client_; |
179 | 183 |
184 scoped_ptr<DragDropClient> drag_drop_client_; | |
185 | |
180 static Desktop* instance_; | 186 static Desktop* instance_; |
181 | 187 |
182 // If set before the Desktop is created, the host window will cover the entire | 188 // If set before the Desktop is created, the host window will cover the entire |
183 // screen. Note that this can still be overridden via the | 189 // screen. Note that this can still be overridden via the |
184 // switches::kAuraHostWindowSize flag. | 190 // switches::kAuraHostWindowSize flag. |
185 static bool use_fullscreen_host_window_; | 191 static bool use_fullscreen_host_window_; |
186 | 192 |
187 // Used to schedule painting. | 193 // Used to schedule painting. |
188 base::WeakPtrFactory<Desktop> schedule_paint_factory_; | 194 base::WeakPtrFactory<Desktop> schedule_paint_factory_; |
189 | 195 |
(...skipping 21 matching lines...) Expand all Loading... | |
211 Window* mouse_moved_handler_; | 217 Window* mouse_moved_handler_; |
212 Window* focused_window_; | 218 Window* focused_window_; |
213 Window* touch_event_handler_; | 219 Window* touch_event_handler_; |
214 | 220 |
215 DISALLOW_COPY_AND_ASSIGN(Desktop); | 221 DISALLOW_COPY_AND_ASSIGN(Desktop); |
216 }; | 222 }; |
217 | 223 |
218 } // namespace aura | 224 } // namespace aura |
219 | 225 |
220 #endif // UI_AURA_DESKTOP_H_ | 226 #endif // UI_AURA_DESKTOP_H_ |
OLD | NEW |