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_ROOT_WINDOW_HOST_OZONE_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_OZONE_H_ |
6 #define UI_AURA_ROOT_WINDOW_HOST_OZONE_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_OZONE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
13 #include "ui/events/ozone/event_factory_ozone.h" | 13 #include "ui/events/ozone/event_factory_ozone.h" |
14 #include "ui/gfx/insets.h" | 14 #include "ui/gfx/insets.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 | 16 |
17 namespace aura { | 17 namespace aura { |
18 | 18 |
19 class RootWindowHostOzone : public RootWindowHost, | 19 class RootWindowHostOzone : public RootWindowHost, |
20 public base::MessageLoop::Dispatcher { | 20 public base::MessageLoop::Dispatcher { |
21 public: | 21 public: |
22 explicit RootWindowHostOzone(const gfx::Rect& bounds); | 22 explicit RootWindowHostOzone(const gfx::Rect& bounds); |
23 virtual ~RootWindowHostOzone(); | 23 virtual ~RootWindowHostOzone(); |
24 | 24 |
25 private: | 25 private: |
26 // Overridden from Dispatcher overrides: | 26 // Overridden from Dispatcher overrides: |
27 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 27 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
28 | 28 |
29 // RootWindowHost Overrides. | 29 // RootWindowHost Overrides. |
30 virtual void SetDelegate(RootWindowHostDelegate* delegate) OVERRIDE; | |
31 virtual RootWindow* GetRootWindow() OVERRIDE; | 30 virtual RootWindow* GetRootWindow() OVERRIDE; |
32 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 31 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
33 virtual void Show() OVERRIDE; | 32 virtual void Show() OVERRIDE; |
34 virtual void Hide() OVERRIDE; | 33 virtual void Hide() OVERRIDE; |
35 virtual void ToggleFullScreen() OVERRIDE; | 34 virtual void ToggleFullScreen() OVERRIDE; |
36 virtual gfx::Rect GetBounds() const OVERRIDE; | 35 virtual gfx::Rect GetBounds() const OVERRIDE; |
37 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 36 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
38 virtual gfx::Insets GetInsets() const OVERRIDE; | 37 virtual gfx::Insets GetInsets() const OVERRIDE; |
39 virtual void SetInsets(const gfx::Insets& bounds) OVERRIDE; | 38 virtual void SetInsets(const gfx::Insets& bounds) OVERRIDE; |
40 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 39 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; |
41 virtual void SetCapture() OVERRIDE; | 40 virtual void SetCapture() OVERRIDE; |
42 virtual void ReleaseCapture() OVERRIDE; | 41 virtual void ReleaseCapture() OVERRIDE; |
43 virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE; | 42 virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE; |
44 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 43 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
45 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 44 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
46 virtual void UnConfineCursor() OVERRIDE; | 45 virtual void UnConfineCursor() OVERRIDE; |
47 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 46 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
48 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 47 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
49 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; | |
50 virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; | 48 virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; |
51 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 49 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
52 virtual void PrepareForShutdown() OVERRIDE; | 50 virtual void PrepareForShutdown() OVERRIDE; |
53 | 51 |
54 RootWindowHostDelegate* delegate_; | |
55 gfx::AcceleratedWidget widget_; | 52 gfx::AcceleratedWidget widget_; |
56 gfx::Rect bounds_; | 53 gfx::Rect bounds_; |
57 | 54 |
58 // EventFactoryOzone creates converters that obtain input events from the | 55 // EventFactoryOzone creates converters that obtain input events from the |
59 // underlying input system and dispatch them as |ui::Event| instances into | 56 // underlying input system and dispatch them as |ui::Event| instances into |
60 // Aura. | 57 // Aura. |
61 scoped_ptr<ui::EventFactoryOzone> factory_; | 58 scoped_ptr<ui::EventFactoryOzone> factory_; |
62 | 59 |
63 DISALLOW_COPY_AND_ASSIGN(RootWindowHostOzone); | 60 DISALLOW_COPY_AND_ASSIGN(RootWindowHostOzone); |
64 }; | 61 }; |
65 | 62 |
66 } // namespace aura | 63 } // namespace aura |
67 | 64 |
68 #endif // UI_AURA_ROOT_WINDOW_HOST_OZONE_H_ | 65 #endif // UI_AURA_ROOT_WINDOW_HOST_OZONE_H_ |
OLD | NEW |