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_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_H_ |
6 #define UI_AURA_ROOT_WINDOW_HOST_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "ui/base/cursor/cursor.h" | 11 #include "ui/base/cursor/cursor.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Point; | 15 class Point; |
16 class Rect; | 16 class Rect; |
17 class Size; | 17 class Size; |
18 } | 18 } |
19 | 19 |
20 namespace aura { | 20 namespace aura { |
21 | 21 |
22 class RootWindow; | 22 class RootWindow; |
| 23 class RootWindowHostDelegate; |
23 | 24 |
24 // RootWindowHost bridges between a native window and the embedded RootWindow. | 25 // RootWindowHost bridges between a native window and the embedded RootWindow. |
25 // It provides the accelerated widget and maps events from the native os to | 26 // It provides the accelerated widget and maps events from the native os to |
26 // aura. | 27 // aura. |
27 class RootWindowHost { | 28 class RootWindowHost { |
28 public: | 29 public: |
29 virtual ~RootWindowHost() {} | 30 virtual ~RootWindowHost() {} |
30 | 31 |
31 // Creates a new RootWindowHost. The caller owns the returned value. | 32 // Creates a new RootWindowHost. The caller owns the returned value. |
32 static RootWindowHost* Create(const gfx::Rect& bounds); | 33 static RootWindowHost* Create(RootWindowHostDelegate* delegate, |
| 34 const gfx::Rect& bounds); |
33 | 35 |
34 // Returns the actual size of the screen. | 36 // Returns the actual size of the screen. |
35 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) | 37 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) |
36 static gfx::Size GetNativeScreenSize(); | 38 static gfx::Size GetNativeScreenSize(); |
37 | 39 |
| 40 virtual RootWindow* GetRootWindow() = 0; |
| 41 |
38 // Returns the RootWindowHost for the specified accelerated widget, or NULL if | 42 // Returns the RootWindowHost for the specified accelerated widget, or NULL if |
39 // there is none associated. | 43 // there is none associated. |
40 static RootWindowHost* GetForAcceleratedWidget( | 44 static RootWindowHost* GetForAcceleratedWidget( |
41 gfx::AcceleratedWidget accelerated_widget); | 45 gfx::AcceleratedWidget accelerated_widget); |
42 | 46 |
43 // Sets the RootWindow this RootWindowHost is hosting. RootWindowHost does not | |
44 // own the RootWindow. | |
45 virtual void SetRootWindow(RootWindow* root_window) = 0; | |
46 virtual RootWindow* GetRootWindow() = 0; | |
47 | |
48 // Returns the accelerated widget. | 47 // Returns the accelerated widget. |
49 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | 48 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; |
50 | 49 |
51 // Shows the RootWindowHost. | 50 // Shows the RootWindowHost. |
52 virtual void Show() = 0; | 51 virtual void Show() = 0; |
53 | 52 |
54 // Toggles the host's full screen state. | 53 // Toggles the host's full screen state. |
55 virtual void ToggleFullScreen() = 0; | 54 virtual void ToggleFullScreen() = 0; |
56 | 55 |
57 // Gets/Sets the size of the RootWindowHost. | 56 // Gets/Sets the size of the RootWindowHost. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; | 100 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; |
102 #endif | 101 #endif |
103 | 102 |
104 // Called when the device scale factor of the root window has chagned. | 103 // Called when the device scale factor of the root window has chagned. |
105 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; | 104 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
106 }; | 105 }; |
107 | 106 |
108 } // namespace aura | 107 } // namespace aura |
109 | 108 |
110 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ | 109 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ |
OLD | NEW |