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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 static Desktop* GetInstance(); | 49 static Desktop* GetInstance(); |
50 static void DeleteInstanceForTesting(); | 50 static void DeleteInstanceForTesting(); |
51 | 51 |
52 static void set_compositor_factory_for_testing(ui::Compositor*(*factory)()) { | 52 static void set_compositor_factory_for_testing(ui::Compositor*(*factory)()) { |
53 compositor_factory_ = factory; | 53 compositor_factory_ = factory; |
54 } | 54 } |
55 static ui::Compositor* (*compositor_factory())() { | 55 static ui::Compositor* (*compositor_factory())() { |
56 return compositor_factory_; | 56 return compositor_factory_; |
57 } | 57 } |
58 | 58 |
| 59 static void set_use_fullscreen_host_window(bool use_fullscreen) { |
| 60 use_fullscreen_host_window_ = use_fullscreen; |
| 61 } |
| 62 |
59 ui::Compositor* compositor() { return compositor_.get(); } | 63 ui::Compositor* compositor() { return compositor_.get(); } |
60 gfx::Point last_mouse_location() const { return last_mouse_location_; } | 64 gfx::Point last_mouse_location() const { return last_mouse_location_; } |
61 DesktopDelegate* delegate() { return delegate_.get(); } | 65 DesktopDelegate* delegate() { return delegate_.get(); } |
62 Window* active_window() { return active_window_; } | 66 Window* active_window() { return active_window_; } |
63 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 67 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
64 Window* capture_window() { return capture_window_; } | 68 Window* capture_window() { return capture_window_; } |
65 ScreenAura* screen() { return screen_; } | 69 ScreenAura* screen() { return screen_; } |
66 | 70 |
67 void SetDelegate(DesktopDelegate* delegate); | 71 void SetDelegate(DesktopDelegate* delegate); |
68 | 72 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 gfx::Rect GetInitialHostWindowBounds() const; | 164 gfx::Rect GetInitialHostWindowBounds() const; |
161 | 165 |
162 scoped_refptr<ui::Compositor> compositor_; | 166 scoped_refptr<ui::Compositor> compositor_; |
163 | 167 |
164 scoped_ptr<DesktopHost> host_; | 168 scoped_ptr<DesktopHost> host_; |
165 | 169 |
166 scoped_ptr<DesktopDelegate> delegate_; | 170 scoped_ptr<DesktopDelegate> delegate_; |
167 | 171 |
168 static Desktop* instance_; | 172 static Desktop* instance_; |
169 | 173 |
| 174 // Factory used to create Compositors. Settable by tests. |
| 175 static ui::Compositor*(*compositor_factory_)(); |
| 176 |
| 177 // If set before the Desktop is created, the host window will cover the entire |
| 178 // screen. Note that this can still be overridden via the |
| 179 // switches::kAuraHostWindowSize flag. |
| 180 static bool use_fullscreen_host_window_; |
| 181 |
170 // Used to schedule painting. | 182 // Used to schedule painting. |
171 base::WeakPtrFactory<Desktop> schedule_paint_factory_; | 183 base::WeakPtrFactory<Desktop> schedule_paint_factory_; |
172 | 184 |
173 // Factory used to create Compositors. Settable by tests. | |
174 static ui::Compositor*(*compositor_factory_)(); | |
175 | |
176 Window* active_window_; | 185 Window* active_window_; |
177 | 186 |
178 // Last location seen in a mouse event. | 187 // Last location seen in a mouse event. |
179 gfx::Point last_mouse_location_; | 188 gfx::Point last_mouse_location_; |
180 | 189 |
181 // Are we in the process of being destroyed? Used to avoid processing during | 190 // Are we in the process of being destroyed? Used to avoid processing during |
182 // destruction. | 191 // destruction. |
183 bool in_destructor_; | 192 bool in_destructor_; |
184 | 193 |
185 ObserverList<DesktopObserver> observers_; | 194 ObserverList<DesktopObserver> observers_; |
186 | 195 |
187 ScreenAura* screen_; | 196 ScreenAura* screen_; |
188 | 197 |
189 // The capture window. When not-null, this window receives all the mouse and | 198 // The capture window. When not-null, this window receives all the mouse and |
190 // touch events. | 199 // touch events. |
191 Window* capture_window_; | 200 Window* capture_window_; |
192 | 201 |
193 Window* mouse_pressed_handler_; | 202 Window* mouse_pressed_handler_; |
194 Window* mouse_moved_handler_; | 203 Window* mouse_moved_handler_; |
195 Window* focused_window_; | 204 Window* focused_window_; |
196 Window* touch_event_handler_; | 205 Window* touch_event_handler_; |
197 | 206 |
198 DISALLOW_COPY_AND_ASSIGN(Desktop); | 207 DISALLOW_COPY_AND_ASSIGN(Desktop); |
199 }; | 208 }; |
200 | 209 |
201 } // namespace aura | 210 } // namespace aura |
202 | 211 |
203 #endif // UI_AURA_DESKTOP_H_ | 212 #endif // UI_AURA_DESKTOP_H_ |
OLD | NEW |