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_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_H_ |
6 #define UI_AURA_ROOT_WINDOW_H_ | 6 #define UI_AURA_ROOT_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 | 93 |
94 ui::Compositor* compositor() { return compositor_.get(); } | 94 ui::Compositor* compositor() { return compositor_.get(); } |
95 gfx::Point last_mouse_location() const { return last_mouse_location_; } | 95 gfx::Point last_mouse_location() const { return last_mouse_location_; } |
96 gfx::NativeCursor last_cursor() const { return last_cursor_; } | 96 gfx::NativeCursor last_cursor() const { return last_cursor_; } |
97 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 97 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
98 | 98 |
99 void set_focus_manager(FocusManager* focus_manager) { | 99 void set_focus_manager(FocusManager* focus_manager) { |
100 focus_manager_ = focus_manager; | 100 focus_manager_ = focus_manager; |
101 } | 101 } |
102 | 102 |
103 #ifdef UNIT_TEST | |
104 RootWindowHost* host() { return host_.get(); } | |
Ben Goodger (Google)
2012/06/18 16:50:21
can we expose QueryMouseLocation() on RootWindow r
yoshiki
2012/06/18 18:49:39
Done.
| |
105 #endif | |
106 | |
103 // Initializes the root window. | 107 // Initializes the root window. |
104 void Init(); | 108 void Init(); |
105 | 109 |
106 // Shows the root window host. | 110 // Shows the root window host. |
107 void ShowRootWindow(); | 111 void ShowRootWindow(); |
108 | 112 |
109 // Sets the size of the root window. | 113 // Sets the size of the root window. |
110 void SetHostSize(const gfx::Size& size_in_pixel); | 114 void SetHostSize(const gfx::Size& size_in_pixel); |
111 gfx::Size GetHostSize() const; | 115 gfx::Size GetHostSize() const; |
112 | 116 |
113 // Sets the bounds of the host window. | 117 // Sets the bounds of the host window. |
114 void SetHostBounds(const gfx::Rect& size_in_pixel); | 118 void SetHostBounds(const gfx::Rect& size_in_pixel); |
115 | 119 |
116 // Returns where the RootWindow is on screen. | 120 // Returns where the RootWindow is on screen. |
117 gfx::Point GetHostOrigin() const; | 121 gfx::Point GetHostOrigin() const; |
118 | 122 |
119 // Sets the currently-displayed cursor. If the cursor was previously hidden | 123 // Sets the currently-displayed cursor. If the cursor was previously hidden |
120 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is | 124 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is |
121 // called, at which point the cursor that was last set via SetCursor() will be | 125 // called, at which point the cursor that was last set via SetCursor() will be |
122 // used. | 126 // used. |
123 void SetCursor(gfx::NativeCursor cursor); | 127 void SetCursor(gfx::NativeCursor cursor); |
124 | 128 |
125 // Shows or hides the cursor. | 129 // Shows or hides the cursor. |
126 void ShowCursor(bool show); | 130 void ShowCursor(bool show); |
127 | 131 |
128 // Moves the cursor to the specified location relative to the root window. | 132 // Moves the cursor to the specified location relative to the root window. |
129 void MoveCursorTo(const gfx::Point& location); | 133 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
130 | 134 |
131 // Clips the cursor movement to the root_window. | 135 // Clips the cursor movement to the root_window. |
132 bool ConfineCursorToWindow(); | 136 bool ConfineCursorToWindow(); |
133 | 137 |
134 // Draws the necessary set of windows. | 138 // Draws the necessary set of windows. |
135 void Draw(); | 139 void Draw(); |
136 | 140 |
137 // Draw the whole screen. | 141 // Draw the whole screen. |
138 void ScheduleFullDraw(); | 142 void ScheduleFullDraw(); |
139 | 143 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
394 | 398 |
395 CompositorLock* compositor_lock_; | 399 CompositorLock* compositor_lock_; |
396 bool draw_on_compositor_unlock_; | 400 bool draw_on_compositor_unlock_; |
397 | 401 |
398 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 402 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
399 }; | 403 }; |
400 | 404 |
401 } // namespace aura | 405 } // namespace aura |
402 | 406 |
403 #endif // UI_AURA_ROOT_WINDOW_H_ | 407 #endif // UI_AURA_ROOT_WINDOW_H_ |
OLD | NEW |