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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class RootWindowHostDelegate; | 24 class RootWindowHostDelegate; |
25 | 25 |
26 // RootWindowHost bridges between a native window and the embedded RootWindow. | 26 // RootWindowHost bridges between a native window and the embedded RootWindow. |
27 // It provides the accelerated widget and maps events from the native os to | 27 // It provides the accelerated widget and maps events from the native os to |
28 // aura. | 28 // aura. |
29 class AURA_EXPORT RootWindowHost { | 29 class AURA_EXPORT RootWindowHost { |
30 public: | 30 public: |
31 virtual ~RootWindowHost() {} | 31 virtual ~RootWindowHost() {} |
32 | 32 |
33 // Creates a new RootWindowHost. The caller owns the returned value. | 33 // Creates a new RootWindowHost. The caller owns the returned value. |
34 static RootWindowHost* Create(RootWindowHostDelegate* delegate, | 34 static RootWindowHost* Create(const gfx::Rect& bounds); |
35 const gfx::Rect& bounds); | |
36 | 35 |
37 // Returns the actual size of the screen. | 36 // Returns the actual size of the screen. |
38 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) | 37 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) |
39 static gfx::Size GetNativeScreenSize(); | 38 static gfx::Size GetNativeScreenSize(); |
40 | 39 |
| 40 // Sets the delegate, which is normally done by the root window. |
| 41 virtual void SetDelegate(RootWindowHostDelegate* delegate) = 0; |
| 42 |
41 virtual RootWindow* GetRootWindow() = 0; | 43 virtual RootWindow* GetRootWindow() = 0; |
42 | 44 |
43 // Returns the RootWindowHost for the specified accelerated widget, or NULL if | 45 // Returns the RootWindowHost for the specified accelerated widget, or NULL if |
44 // there is none associated. | 46 // there is none associated. |
45 static RootWindowHost* GetForAcceleratedWidget( | 47 static RootWindowHost* GetForAcceleratedWidget( |
46 gfx::AcceleratedWidget accelerated_widget); | 48 gfx::AcceleratedWidget accelerated_widget); |
47 | 49 |
48 // Returns the accelerated widget. | 50 // Returns the accelerated widget. |
49 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | 51 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; |
50 | 52 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Called when the device scale factor of the root window has chagned. | 109 // Called when the device scale factor of the root window has chagned. |
108 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; | 110 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
109 | 111 |
110 // Stop listening events in preparation for shutdown. | 112 // Stop listening events in preparation for shutdown. |
111 virtual void PrepareForShutdown() = 0; | 113 virtual void PrepareForShutdown() = 0; |
112 }; | 114 }; |
113 | 115 |
114 } // namespace aura | 116 } // namespace aura |
115 | 117 |
116 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ | 118 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ |
OLD | NEW |