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 UI_AURA_WINDOW_TREE_HOST_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "ui/aura/aura_export.h" | 12 #include "ui/aura/aura_export.h" |
13 #include "ui/base/cursor/cursor.h" | 13 #include "ui/base/cursor/cursor.h" |
14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Insets; | 17 class Insets; |
18 class Point; | 18 class Point; |
19 class Rect; | 19 class Rect; |
20 class Size; | 20 class Size; |
21 class Transform; | 21 class Transform; |
22 } | 22 } |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 class Compositor; | 25 class Compositor; |
| 26 class EventProcessor; |
26 class ViewProp; | 27 class ViewProp; |
27 } | 28 } |
28 | 29 |
29 namespace aura { | 30 namespace aura { |
30 class RootWindowTransformer; | 31 class RootWindowTransformer; |
31 class WindowEventDispatcher; | 32 class WindowEventDispatcher; |
32 class WindowTreeHostObserver; | 33 class WindowTreeHostObserver; |
33 | 34 |
34 // WindowTreeHost bridges between a native window and the embedded RootWindow. | 35 // WindowTreeHost bridges between a native window and the embedded RootWindow. |
35 // It provides the accelerated widget and maps events from the native os to | 36 // It provides the accelerated widget and maps events from the native os to |
36 // aura. | 37 // aura. |
37 class AURA_EXPORT WindowTreeHost { | 38 class AURA_EXPORT WindowTreeHost { |
38 public: | 39 public: |
39 virtual ~WindowTreeHost(); | 40 virtual ~WindowTreeHost(); |
40 | 41 |
41 // Creates a new WindowTreeHost. The caller owns the returned value. | 42 // Creates a new WindowTreeHost. The caller owns the returned value. |
42 static WindowTreeHost* Create(const gfx::Rect& bounds); | 43 static WindowTreeHost* Create(const gfx::Rect& bounds); |
43 | 44 |
44 // Returns the WindowTreeHost for the specified accelerated widget, or NULL | 45 // Returns the WindowTreeHost for the specified accelerated widget, or NULL |
45 // if there is none associated. | 46 // if there is none associated. |
46 static WindowTreeHost* GetForAcceleratedWidget(gfx::AcceleratedWidget widget); | 47 static WindowTreeHost* GetForAcceleratedWidget(gfx::AcceleratedWidget widget); |
47 | 48 |
48 void InitHost(); | 49 void InitHost(); |
49 | 50 |
50 void InitCompositor(); | 51 void InitCompositor(); |
51 | 52 |
| 53 void AddObserver(WindowTreeHostObserver* observer); |
| 54 void RemoveObserver(WindowTreeHostObserver* observer); |
| 55 |
52 Window* window() { return window_; } | 56 Window* window() { return window_; } |
53 const Window* window() const { return window_; } | 57 const Window* window() const { return window_; } |
54 | 58 |
55 void AddObserver(WindowTreeHostObserver* observer); | 59 ui::EventProcessor* event_processor(); |
56 void RemoveObserver(WindowTreeHostObserver* observer); | |
57 | 60 |
58 WindowEventDispatcher* dispatcher() { | 61 WindowEventDispatcher* dispatcher() { |
59 return const_cast<WindowEventDispatcher*>( | 62 return const_cast<WindowEventDispatcher*>( |
60 const_cast<const WindowTreeHost*>(this)->dispatcher()); | 63 const_cast<const WindowTreeHost*>(this)->dispatcher()); |
61 } | 64 } |
62 const WindowEventDispatcher* dispatcher() const { return dispatcher_.get(); } | 65 const WindowEventDispatcher* dispatcher() const { return dispatcher_.get(); } |
63 | 66 |
64 ui::Compositor* compositor() { return compositor_.get(); } | 67 ui::Compositor* compositor() { return compositor_.get(); } |
65 | 68 |
66 void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer); | 69 void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 gfx::NativeCursor last_cursor_; | 217 gfx::NativeCursor last_cursor_; |
215 | 218 |
216 scoped_ptr<ui::ViewProp> prop_; | 219 scoped_ptr<ui::ViewProp> prop_; |
217 | 220 |
218 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); | 221 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); |
219 }; | 222 }; |
220 | 223 |
221 } // namespace aura | 224 } // namespace aura |
222 | 225 |
223 #endif // UI_AURA_WINDOW_TREE_HOST_H_ | 226 #endif // UI_AURA_WINDOW_TREE_HOST_H_ |
OLD | NEW |