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_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 21 matching lines...) Expand all Loading... |
32 namespace aura { | 32 namespace aura { |
33 | 33 |
34 class RootWindowHost; | 34 class RootWindowHost; |
35 class RootWindowObserver; | 35 class RootWindowObserver; |
36 class KeyEvent; | 36 class KeyEvent; |
37 class MouseEvent; | 37 class MouseEvent; |
38 class ScreenAura; | 38 class ScreenAura; |
39 class StackingClient; | 39 class StackingClient; |
40 class ScrollEvent; | 40 class ScrollEvent; |
41 class TouchEvent; | 41 class TouchEvent; |
| 42 class GestureEvent; |
42 | 43 |
43 // RootWindow is responsible for hosting a set of windows. | 44 // RootWindow is responsible for hosting a set of windows. |
44 class AURA_EXPORT RootWindow : public ui::CompositorDelegate, | 45 class AURA_EXPORT RootWindow : 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 static RootWindow* GetInstance(); | 50 static RootWindow* GetInstance(); |
50 static void DeleteInstance(); | 51 static void DeleteInstance(); |
51 | 52 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 88 |
88 // Handles a key event. Returns true if handled. | 89 // Handles a key event. Returns true if handled. |
89 bool DispatchKeyEvent(KeyEvent* event); | 90 bool DispatchKeyEvent(KeyEvent* event); |
90 | 91 |
91 // Handles a scroll event. Returns true if handled. | 92 // Handles a scroll event. Returns true if handled. |
92 bool DispatchScrollEvent(ScrollEvent* event); | 93 bool DispatchScrollEvent(ScrollEvent* event); |
93 | 94 |
94 // Handles a touch event. Returns true if handled. | 95 // Handles a touch event. Returns true if handled. |
95 bool DispatchTouchEvent(TouchEvent* event); | 96 bool DispatchTouchEvent(TouchEvent* event); |
96 | 97 |
| 98 // Handles a gesture event. Returns true if handled. Unlike the other |
| 99 // event-dispatching function (e.g. for touch/mouse/keyboard events), gesture |
| 100 // events are dispatched from GestureRecognizer instead of RootWindowHost. |
| 101 bool DispatchGestureEvent(GestureEvent* event); |
| 102 |
97 // Called when the host changes size. | 103 // Called when the host changes size. |
98 void OnHostResized(const gfx::Size& size); | 104 void OnHostResized(const gfx::Size& size); |
99 | 105 |
100 // Called when the native screen's resolution changes. | 106 // Called when the native screen's resolution changes. |
101 void OnNativeScreenResized(const gfx::Size& size); | 107 void OnNativeScreenResized(const gfx::Size& size); |
102 | 108 |
103 // Invoked when |window| is initialized. | 109 // Invoked when |window| is initialized. |
104 void WindowInitialized(Window* window); | 110 void WindowInitialized(Window* window); |
105 | 111 |
106 // Invoked when |window| is being destroyed. | 112 // Invoked when |window| is being destroyed. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 RootWindow(); | 155 RootWindow(); |
150 virtual ~RootWindow(); | 156 virtual ~RootWindow(); |
151 | 157 |
152 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, | 158 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, |
153 // sending exited and entered events as its value changes. | 159 // sending exited and entered events as its value changes. |
154 void HandleMouseMoved(const MouseEvent& event, Window* target); | 160 void HandleMouseMoved(const MouseEvent& event, Window* target); |
155 | 161 |
156 bool ProcessMouseEvent(Window* target, MouseEvent* event); | 162 bool ProcessMouseEvent(Window* target, MouseEvent* event); |
157 bool ProcessKeyEvent(Window* target, KeyEvent* event); | 163 bool ProcessKeyEvent(Window* target, KeyEvent* event); |
158 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); | 164 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); |
| 165 ui::GestureStatus ProcessGestureEvent(Window* target, GestureEvent* event); |
159 | 166 |
160 // Overridden from Window: | 167 // Overridden from Window: |
161 virtual bool CanFocus() const OVERRIDE; | 168 virtual bool CanFocus() const OVERRIDE; |
162 virtual bool CanReceiveEvents() const OVERRIDE; | 169 virtual bool CanReceiveEvents() const OVERRIDE; |
163 virtual internal::FocusManager* GetFocusManager() OVERRIDE; | 170 virtual internal::FocusManager* GetFocusManager() OVERRIDE; |
164 virtual RootWindow* GetRootWindow() OVERRIDE; | 171 virtual RootWindow* GetRootWindow() OVERRIDE; |
165 virtual void WindowDetachedFromRootWindow(Window* window) OVERRIDE; | 172 virtual void WindowDetachedFromRootWindow(Window* window) OVERRIDE; |
166 | 173 |
167 // Overridden from ui::LayerAnimationObserver: | 174 // Overridden from ui::LayerAnimationObserver: |
168 virtual void OnLayerAnimationEnded( | 175 virtual void OnLayerAnimationEnded( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 Window* mouse_moved_handler_; | 226 Window* mouse_moved_handler_; |
220 Window* focused_window_; | 227 Window* focused_window_; |
221 Window* touch_event_handler_; | 228 Window* touch_event_handler_; |
222 | 229 |
223 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 230 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
224 }; | 231 }; |
225 | 232 |
226 } // namespace aura | 233 } // namespace aura |
227 | 234 |
228 #endif // UI_AURA_ROOT_WINDOW_H_ | 235 #endif // UI_AURA_ROOT_WINDOW_H_ |
OLD | NEW |