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/aura/aura_export.h" | 11 #include "ui/aura/aura_export.h" |
12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 | 14 |
| 15 class SkCanvas; |
| 16 |
15 namespace gfx { | 17 namespace gfx { |
16 class Point; | 18 class Point; |
17 class Rect; | 19 class Rect; |
18 class Size; | 20 class Size; |
19 } | 21 } |
20 | 22 |
21 namespace aura { | 23 namespace aura { |
22 | 24 |
23 class RootWindow; | 25 class RootWindow; |
24 class RootWindowHostDelegate; | 26 class RootWindowHostDelegate; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Clips the cursor to the bounds of the root window until UnConfineCursor(). | 82 // Clips the cursor to the bounds of the root window until UnConfineCursor(). |
81 virtual bool ConfineCursorToRootWindow() = 0; | 83 virtual bool ConfineCursorToRootWindow() = 0; |
82 virtual void UnConfineCursor() = 0; | 84 virtual void UnConfineCursor() = 0; |
83 | 85 |
84 // Moves the cursor to the specified location relative to the root window. | 86 // Moves the cursor to the specified location relative to the root window. |
85 virtual void MoveCursorTo(const gfx::Point& location) = 0; | 87 virtual void MoveCursorTo(const gfx::Point& location) = 0; |
86 | 88 |
87 // Sets if the window should be focused when shown. | 89 // Sets if the window should be focused when shown. |
88 virtual void SetFocusWhenShown(bool focus_when_shown) = 0; | 90 virtual void SetFocusWhenShown(bool focus_when_shown) = 0; |
89 | 91 |
| 92 // Copies |source_bounds| from the root window (as displayed on the host |
| 93 // machine) to |canvas| at offset |dest_offset|. The bounds need to be in |
| 94 // physical pixels. |
| 95 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
| 96 const gfx::Point& dest_offset, |
| 97 SkCanvas* canvas) = 0; |
| 98 |
90 // Grabs the snapshot of the root window by using the platform-dependent APIs. | 99 // Grabs the snapshot of the root window by using the platform-dependent APIs. |
91 // The bounds need to be in physical pixels. | 100 // The bounds need to be in physical pixels. |
92 virtual bool GrabSnapshot( | 101 virtual bool GrabSnapshot( |
93 const gfx::Rect& snapshot_bounds, | 102 const gfx::Rect& snapshot_bounds, |
94 std::vector<unsigned char>* png_representation) = 0; | 103 std::vector<unsigned char>* png_representation) = 0; |
95 | 104 |
96 // Posts |native_event| to the platform's event queue. | 105 // Posts |native_event| to the platform's event queue. |
97 #if !defined(OS_MACOSX) | 106 #if !defined(OS_MACOSX) |
98 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; | 107 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; |
99 #endif | 108 #endif |
100 | 109 |
101 // Called when the device scale factor of the root window has chagned. | 110 // Called when the device scale factor of the root window has chagned. |
102 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; | 111 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
103 | 112 |
104 // Stop listening events in preparation for shutdown. | 113 // Stop listening events in preparation for shutdown. |
105 virtual void PrepareForShutdown() = 0; | 114 virtual void PrepareForShutdown() = 0; |
106 }; | 115 }; |
107 | 116 |
108 } // namespace aura | 117 } // namespace aura |
109 | 118 |
110 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ | 119 #endif // UI_AURA_ROOT_WINDOW_HOST_H_ |
OLD | NEW |