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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/task.h" | 13 #include "base/task.h" |
14 #include "ui/aura/aura_export.h" | 14 #include "ui/aura/aura_export.h" |
15 #include "ui/aura/cursor.h" | 15 #include "ui/aura/cursor.h" |
16 #include "ui/aura/focus_manager.h" | 16 #include "ui/aura/focus_manager.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/base/events.h" | 18 #include "ui/base/events.h" |
19 #include "ui/gfx/compositor/compositor.h" | 19 #include "ui/gfx/compositor/compositor.h" |
20 #include "ui/gfx/compositor/layer_animation_observer.h" | 20 #include "ui/gfx/compositor/layer_animation_observer.h" |
21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
22 #include "ui/gfx/point.h" | 22 #include "ui/gfx/point.h" |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 class Size; | 25 class Size; |
26 } | 26 } |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 class InputMethod; | |
30 class LayerAnimationSequence; | 29 class LayerAnimationSequence; |
31 class Transform; | 30 class Transform; |
32 } | 31 } |
33 | 32 |
34 namespace aura { | 33 namespace aura { |
35 | 34 |
36 namespace test { | |
37 class DesktopHostIMETest; | |
38 } // namespace test | |
39 | |
40 class DesktopHost; | 35 class DesktopHost; |
41 class DesktopObserver; | 36 class DesktopObserver; |
42 class KeyEvent; | 37 class KeyEvent; |
43 class MouseEvent; | 38 class MouseEvent; |
44 class ScreenAura; | 39 class ScreenAura; |
45 class StackingClient; | 40 class StackingClient; |
46 class TouchEvent; | 41 class TouchEvent; |
47 | 42 |
48 // Desktop is responsible for hosting a set of windows. | 43 // Desktop is responsible for hosting a set of windows. |
49 class AURA_EXPORT Desktop : public ui::CompositorDelegate, | 44 class AURA_EXPORT Desktop : public ui::CompositorDelegate, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 138 |
144 // Sets capture to the specified window. | 139 // Sets capture to the specified window. |
145 void SetCapture(Window* window); | 140 void SetCapture(Window* window); |
146 | 141 |
147 // If |window| has mouse capture, the current capture window is set to NULL. | 142 // If |window| has mouse capture, the current capture window is set to NULL. |
148 void ReleaseCapture(Window* window); | 143 void ReleaseCapture(Window* window); |
149 | 144 |
150 // Overridden from Window: | 145 // Overridden from Window: |
151 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; | 146 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; |
152 | 147 |
153 // Gets the input method for the desktop. | |
154 ui::InputMethod* GetInputMethod(); | |
155 | |
156 #if !defined(NDEBUG) | 148 #if !defined(NDEBUG) |
157 // Toggles the host's full screen state. | 149 // Toggles the host's full screen state. |
158 void ToggleFullScreen(); | 150 void ToggleFullScreen(); |
159 #endif | 151 #endif |
160 | 152 |
161 // Overridden from ui::CompositorDelegate: | 153 // Overridden from ui::CompositorDelegate: |
162 virtual void ScheduleDraw(); | 154 virtual void ScheduleDraw(); |
163 | 155 |
164 private: | 156 private: |
165 friend class aura::test::DesktopHostIMETest; // need to access |host_|. | |
166 | |
167 Desktop(); | 157 Desktop(); |
168 virtual ~Desktop(); | 158 virtual ~Desktop(); |
169 | 159 |
170 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, | 160 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, |
171 // sending exited and entered events as its value changes. | 161 // sending exited and entered events as its value changes. |
172 void HandleMouseMoved(const MouseEvent& event, Window* target); | 162 void HandleMouseMoved(const MouseEvent& event, Window* target); |
173 | 163 |
174 bool ProcessMouseEvent(Window* target, MouseEvent* event); | 164 bool ProcessMouseEvent(Window* target, MouseEvent* event); |
175 bool ProcessKeyEvent(Window* target, KeyEvent* event); | 165 bool ProcessKeyEvent(Window* target, KeyEvent* event); |
176 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); | 166 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 Window* mouse_moved_handler_; | 234 Window* mouse_moved_handler_; |
245 Window* focused_window_; | 235 Window* focused_window_; |
246 Window* touch_event_handler_; | 236 Window* touch_event_handler_; |
247 | 237 |
248 DISALLOW_COPY_AND_ASSIGN(Desktop); | 238 DISALLOW_COPY_AND_ASSIGN(Desktop); |
249 }; | 239 }; |
250 | 240 |
251 } // namespace aura | 241 } // namespace aura |
252 | 242 |
253 #endif // UI_AURA_DESKTOP_H_ | 243 #endif // UI_AURA_DESKTOP_H_ |
OLD | NEW |