OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_OZONE_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
10 #include "ui/events/event_source.h" | 10 #include "ui/events/event_source.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
12 #include "ui/platform_window/platform_window_delegate.h" | 12 #include "ui/platform_window/platform_window_delegate.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class PlatformWindow; | 15 class PlatformWindow; |
16 } | 16 } |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 | 19 |
20 class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, | 20 class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, |
21 public ui::EventSource, | 21 public ui::EventSource, |
22 public ui::PlatformWindowDelegate { | 22 public ui::PlatformWindowDelegate { |
23 public: | 23 public: |
24 explicit WindowTreeHostOzone(const gfx::Rect& bounds); | 24 explicit WindowTreeHostOzone(const gfx::Rect& bounds); |
25 virtual ~WindowTreeHostOzone(); | 25 virtual ~WindowTreeHostOzone(); |
26 | 26 |
27 protected: | |
28 // Translates the native mouse location into screen coordinates. | |
29 virtual void TranslateLocatedEvent(ui::LocatedEvent* event); | |
30 | |
31 const gfx::Rect bounds() const { return bounds_; } | |
spang
2014/11/04 23:27:23
Please use the existing function GetBounds().
| |
32 | |
27 private: | 33 private: |
28 // ui::PlatformWindowDelegate: | 34 // ui::PlatformWindowDelegate: |
29 virtual void OnBoundsChanged(const gfx::Rect&) OVERRIDE; | 35 virtual void OnBoundsChanged(const gfx::Rect&) OVERRIDE; |
30 virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE; | 36 virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE; |
31 virtual void DispatchEvent(ui::Event* event) OVERRIDE; | 37 virtual void DispatchEvent(ui::Event* event) OVERRIDE; |
32 virtual void OnCloseRequest() OVERRIDE; | 38 virtual void OnCloseRequest() OVERRIDE; |
33 virtual void OnClosed() OVERRIDE; | 39 virtual void OnClosed() OVERRIDE; |
34 virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE; | 40 virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE; |
35 virtual void OnLostCapture() OVERRIDE; | 41 virtual void OnLostCapture() OVERRIDE; |
36 virtual void OnAcceleratedWidgetAvailable( | 42 virtual void OnAcceleratedWidgetAvailable( |
(...skipping 17 matching lines...) Expand all Loading... | |
54 | 60 |
55 // ui::EventSource overrides. | 61 // ui::EventSource overrides. |
56 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 62 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
57 | 63 |
58 // Platform-specific part of this WindowTreeHost. | 64 // Platform-specific part of this WindowTreeHost. |
59 scoped_ptr<ui::PlatformWindow> platform_window_; | 65 scoped_ptr<ui::PlatformWindow> platform_window_; |
60 | 66 |
61 // The identifier used to create a compositing surface. | 67 // The identifier used to create a compositing surface. |
62 gfx::AcceleratedWidget widget_; | 68 gfx::AcceleratedWidget widget_; |
63 | 69 |
70 // The bounds of |platform_window_|. | |
71 gfx::Rect bounds_; | |
72 | |
64 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); | 73 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); |
65 }; | 74 }; |
66 | 75 |
67 } // namespace aura | 76 } // namespace aura |
68 | 77 |
69 #endif // UI_AURA_WINDOW_TREE_HOST_OZONE_H_ | 78 #endif // UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
OLD | NEW |