Chromium Code Reviews| 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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // Shows the root window host. | 76 // Shows the root window host. |
| 77 void ShowRootWindow(); | 77 void ShowRootWindow(); |
| 78 | 78 |
| 79 // Sets the size of the root window. | 79 // Sets the size of the root window. |
| 80 void SetHostSize(const gfx::Size& size); | 80 void SetHostSize(const gfx::Size& size); |
| 81 gfx::Size GetHostSize() const; | 81 gfx::Size GetHostSize() const; |
| 82 | 82 |
| 83 // Sets the currently-displayed cursor. If the cursor was previously hidden | 83 // Sets the currently-displayed cursor. If the cursor was previously hidden |
| 84 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is | 84 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is |
| 85 // called, at which point the cursor that was last set via SetCursor() will be | 85 // called, at which point the cursor that was last set via SetCursor() will be |
| 86 // used. | 86 // used. If the cursor type is kCursorCustom, then the caller has to call |
| 87 // SetCustomCursor instead to have the custom cursor displayed. | |
| 87 void SetCursor(gfx::NativeCursor cursor); | 88 void SetCursor(gfx::NativeCursor cursor); |
| 88 | 89 |
| 90 // Sets a custom cursor for the display. If the cursor was previously hidden | |
| 91 // via ShowCursor(false), it will remain hidden. However, once | |
| 92 // ShowCursor(true) is called, this custom cursor will not be used until an | |
| 93 // explicit call to SetCustomCursor is made. | |
|
Daniel Erat
2012/02/24 17:17:12
these semantics seem odd to me. what about making
sadrul
2012/02/24 17:38:19
My concern is that by the time ShowCursor gets cal
Daniel Erat
2012/02/24 18:05:47
At least the X case, I think that the underlying c
sadrul
2012/02/24 18:30:53
I considered doing that at one point, but that see
sadrul
2012/02/24 19:46:30
Went ahead and did the caching (not too much work!
| |
| 94 void SetCustomCursor(const gfx::PlatformCursor& cursor); | |
| 95 | |
| 89 // Shows or hides the cursor. | 96 // Shows or hides the cursor. |
| 90 void ShowCursor(bool show); | 97 void ShowCursor(bool show); |
| 91 | 98 |
| 92 // Moves the cursor to the specified location relative to the root window. | 99 // Moves the cursor to the specified location relative to the root window. |
| 93 void MoveCursorTo(const gfx::Point& location); | 100 void MoveCursorTo(const gfx::Point& location); |
| 94 | 101 |
| 95 // Clips the cursor movement to |capture_window_|. Should be invoked only | 102 // Clips the cursor movement to |capture_window_|. Should be invoked only |
| 96 // after SetCapture(). ReleaseCapture() implicitly removes any confines set | 103 // after SetCapture(). ReleaseCapture() implicitly removes any confines set |
| 97 // using this function. Returns true if successful. | 104 // using this function. Returns true if successful. |
| 98 bool ConfineCursorToWindow(); | 105 bool ConfineCursorToWindow(); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 scoped_ptr<GestureRecognizer> gesture_recognizer_; | 318 scoped_ptr<GestureRecognizer> gesture_recognizer_; |
| 312 | 319 |
| 313 bool synthesize_mouse_move_; | 320 bool synthesize_mouse_move_; |
| 314 | 321 |
| 315 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 322 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
| 316 }; | 323 }; |
| 317 | 324 |
| 318 } // namespace aura | 325 } // namespace aura |
| 319 | 326 |
| 320 #endif // UI_AURA_ROOT_WINDOW_H_ | 327 #endif // UI_AURA_ROOT_WINDOW_H_ |
| OLD | NEW |