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_HOST_WIN_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_WIN_H_ |
6 #define UI_AURA_ROOT_WINDOW_HOST_WIN_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_WIN_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
| 11 #include "ui/events/event_source.h" |
11 #include "ui/gfx/win/window_impl.h" | 12 #include "ui/gfx/win/window_impl.h" |
12 | 13 |
13 namespace aura { | 14 namespace aura { |
14 | 15 |
15 class WindowTreeHostWin : public WindowTreeHost, public gfx::WindowImpl { | 16 class WindowTreeHostWin : public WindowTreeHost, |
| 17 public ui::EventSource, |
| 18 public gfx::WindowImpl { |
16 public: | 19 public: |
17 WindowTreeHostWin(const gfx::Rect& bounds); | 20 WindowTreeHostWin(const gfx::Rect& bounds); |
18 virtual ~WindowTreeHostWin(); | 21 virtual ~WindowTreeHostWin(); |
19 // WindowTreeHost: | 22 // WindowTreeHost: |
20 virtual RootWindow* GetRootWindow() OVERRIDE; | 23 virtual RootWindow* GetRootWindow() OVERRIDE; |
21 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 24 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
22 virtual void Show() OVERRIDE; | 25 virtual void Show() OVERRIDE; |
23 virtual void Hide() OVERRIDE; | 26 virtual void Hide() OVERRIDE; |
24 virtual void ToggleFullScreen() OVERRIDE; | 27 virtual void ToggleFullScreen() OVERRIDE; |
25 virtual gfx::Rect GetBounds() const OVERRIDE; | 28 virtual gfx::Rect GetBounds() const OVERRIDE; |
26 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 29 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
27 virtual gfx::Insets GetInsets() const OVERRIDE; | 30 virtual gfx::Insets GetInsets() const OVERRIDE; |
28 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; | 31 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; |
29 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 32 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; |
30 virtual void SetCapture() OVERRIDE; | 33 virtual void SetCapture() OVERRIDE; |
31 virtual void ReleaseCapture() OVERRIDE; | 34 virtual void ReleaseCapture() OVERRIDE; |
32 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 35 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
33 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 36 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
34 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 37 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
35 virtual void UnConfineCursor() OVERRIDE; | 38 virtual void UnConfineCursor() OVERRIDE; |
36 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 39 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
37 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 40 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
38 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 41 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
39 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 42 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
40 virtual void PrepareForShutdown() OVERRIDE; | 43 virtual void PrepareForShutdown() OVERRIDE; |
41 | 44 |
| 45 // ui::EventSource: |
| 46 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
| 47 |
42 private: | 48 private: |
43 CR_BEGIN_MSG_MAP_EX(WindowTreeHostWin) | 49 CR_BEGIN_MSG_MAP_EX(WindowTreeHostWin) |
44 // Range handlers must go first! | 50 // Range handlers must go first! |
45 CR_MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) | 51 CR_MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) |
46 CR_MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, | 52 CR_MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, |
47 WM_NCXBUTTONDBLCLK, | 53 WM_NCXBUTTONDBLCLK, |
48 OnMouseRange) | 54 OnMouseRange) |
49 | 55 |
50 // Mouse capture events. | 56 // Mouse capture events. |
51 CR_MESSAGE_HANDLER_EX(WM_CAPTURECHANGED, OnCaptureChanged) | 57 CR_MESSAGE_HANDLER_EX(WM_CAPTURECHANGED, OnCaptureChanged) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Set true to let WindowTreeHostWin use a popup window | 95 // Set true to let WindowTreeHostWin use a popup window |
90 // with no frame/title so that the window size and test's | 96 // with no frame/title so that the window size and test's |
91 // expectations matches. | 97 // expectations matches. |
92 AURA_EXPORT void SetUsePopupAsRootWindowForTest(bool use); | 98 AURA_EXPORT void SetUsePopupAsRootWindowForTest(bool use); |
93 | 99 |
94 } // namespace | 100 } // namespace |
95 | 101 |
96 } // namespace aura | 102 } // namespace aura |
97 | 103 |
98 #endif // UI_AURA_ROOT_WINDOW_HOST_WIN_H_ | 104 #endif // UI_AURA_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |