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_WIN_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_WIN_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_WIN_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_WIN_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
12 #include "ui/events/event_source.h" | |
13 #include "ui/platform_window/platform_window.h" | 12 #include "ui/platform_window/platform_window.h" |
14 #include "ui/platform_window/platform_window_delegate.h" | 13 #include "ui/platform_window/platform_window_delegate.h" |
15 | 14 |
16 namespace aura { | 15 namespace aura { |
17 | 16 |
18 class AURA_EXPORT WindowTreeHostWin | 17 class AURA_EXPORT WindowTreeHostWin |
19 : public WindowTreeHost, | 18 : public WindowTreeHost, |
20 public ui::EventSource, | |
21 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { | 19 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { |
22 public: | 20 public: |
23 explicit WindowTreeHostWin(const gfx::Rect& bounds); | 21 explicit WindowTreeHostWin(const gfx::Rect& bounds); |
24 ~WindowTreeHostWin() override; | 22 ~WindowTreeHostWin() override; |
25 | 23 |
26 // WindowTreeHost: | 24 // WindowTreeHost: |
27 ui::EventSource* GetEventSource() override; | 25 ui::EventSource* GetEventSource() override; |
28 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 26 gfx::AcceleratedWidget GetAcceleratedWidget() override; |
29 void ShowImpl() override; | 27 void ShowImpl() override; |
30 void HideImpl() override; | 28 void HideImpl() override; |
31 gfx::Rect GetBounds() const override; | 29 gfx::Rect GetBounds() const override; |
32 void SetBounds(const gfx::Rect& bounds) override; | 30 void SetBounds(const gfx::Rect& bounds) override; |
33 gfx::Point GetLocationOnNativeScreen() const override; | 31 gfx::Point GetLocationOnNativeScreen() const override; |
34 void SetCapture() override; | 32 void SetCapture() override; |
35 void ReleaseCapture() override; | 33 void ReleaseCapture() override; |
36 void SetCursorNative(gfx::NativeCursor cursor) override; | 34 void SetCursorNative(gfx::NativeCursor cursor) override; |
37 void MoveCursorToNative(const gfx::Point& location) override; | 35 void MoveCursorToNative(const gfx::Point& location) override; |
38 void OnCursorVisibilityChangedNative(bool show) override; | 36 void OnCursorVisibilityChangedNative(bool show) override; |
39 | 37 |
40 // ui::EventSource: | |
41 ui::EventProcessor* GetEventProcessor() override; | |
42 | |
43 protected: | 38 protected: |
44 gfx::AcceleratedWidget hwnd() const { return widget_; } | 39 gfx::AcceleratedWidget hwnd() const { return widget_; } |
45 | 40 |
46 private: | 41 private: |
47 // ui::PlatformWindowDelegate: | 42 // ui::PlatformWindowDelegate: |
48 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 43 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
49 void OnDamageRect(const gfx::Rect& damaged_region) override; | 44 void OnDamageRect(const gfx::Rect& damaged_region) override; |
50 void DispatchEvent(ui::Event* event) override; | 45 void DispatchEvent(ui::Event* event) override; |
51 void OnCloseRequest() override; | 46 void OnCloseRequest() override; |
52 void OnClosed() override; | 47 void OnClosed() override; |
53 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 48 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
54 void OnLostCapture() override; | 49 void OnLostCapture() override; |
55 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; | 50 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; |
56 void OnActivationChanged(bool active) override; | 51 void OnActivationChanged(bool active) override; |
57 | 52 |
58 bool has_capture_; | 53 bool has_capture_; |
59 gfx::Rect bounds_; | 54 gfx::Rect bounds_; |
60 gfx::AcceleratedWidget widget_; | 55 gfx::AcceleratedWidget widget_; |
61 scoped_ptr<ui::PlatformWindow> window_; | 56 scoped_ptr<ui::PlatformWindow> window_; |
62 | 57 |
63 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin); | 58 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin); |
64 }; | 59 }; |
65 | 60 |
66 } // namespace aura | 61 } // namespace aura |
67 | 62 |
68 #endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_ | 63 #endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_ |
OLD | NEW |