Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ | |
| 6 #define ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ | |
| 7 | |
| 8 #include "ui/aura/window.h" | |
| 9 #include "ui/base/cursor/cursor.h" | |
| 10 #include "ui/gfx/display.h" | |
| 11 | |
| 12 namespace ash { | |
| 13 namespace test{ | |
| 14 class MirrorWindowTestApi; | |
| 15 } | |
| 16 | |
| 17 namespace internal { | |
| 18 | |
| 19 class CursorWindowDelegate; | |
| 20 | |
| 21 // Draws a mouse cursor on a given container window. | |
| 22 // In the non-mirroring mode, the CursorWindowController draws the cursor as-is. | |
| 23 // In the mirroring mode, the CursorWindowController is responsible to scale and | |
| 24 // rotate the mouse cursor bitmap to match settings of the primary display. | |
| 25 class CursorWindowController { | |
| 26 public: | |
| 27 CursorWindowController(); | |
| 28 virtual ~CursorWindowController(); | |
|
Daniel Erat
2014/02/05 22:01:32
nit: doesn't look like you need 'virtual' here
hshi1
2014/02/05 22:55:58
Done.
| |
| 29 | |
| 30 // Sets mirroring mode on/off. | |
| 31 void SetMirroring(bool is_mirroring); | |
| 32 | |
| 33 // Sets the container window for the cursor window controller. | |
| 34 // Closes the cursor window if |container| is NULL. | |
| 35 void SetContainer(aura::Window* container); | |
| 36 | |
| 37 // Sets the display bounds of the container window. | |
|
oshima
2014/02/05 21:49:59
document the coordinates of the bounds, or just re
hshi1
2014/02/05 22:55:58
Done.
| |
| 38 void SetDisplayBounds(const gfx::Rect& display_bounds); | |
| 39 | |
| 40 // Sets cursor location, shape, set and visibility. | |
| 41 void UpdateLocation(); | |
| 42 void SetCursor(gfx::NativeCursor cursor); | |
| 43 void SetCursorSet(ui::CursorSetType); | |
| 44 void SetVisibility(bool visible); | |
| 45 | |
| 46 private: | |
| 47 friend class test::MirrorWindowTestApi; | |
| 48 | |
| 49 bool is_mirroring_; | |
| 50 aura::Window* current_container_; | |
|
Daniel Erat
2014/02/05 22:01:32
nit: do you need to have 'current_' on the beginni
hshi1
2014/02/05 22:55:58
Done.
| |
| 51 gfx::Rect current_display_bounds_; | |
| 52 int current_cursor_type_; | |
|
Daniel Erat
2014/02/05 22:01:32
nit: add a comment documenting what this int value
hshi1
2014/02/05 22:55:58
Done.
| |
| 53 ui::CursorSetType current_cursor_set_; | |
| 54 ui::CursorSetType requested_cursor_set_; | |
| 55 gfx::Display::Rotation current_cursor_rotation_; | |
| 56 gfx::Point hot_point_; | |
| 57 | |
| 58 scoped_ptr<aura::Window> cursor_window_; | |
| 59 scoped_ptr<CursorWindowDelegate> delegate_; | |
| 60 | |
| 61 DISALLOW_COPY_AND_ASSIGN(CursorWindowController); | |
| 62 }; | |
| 63 | |
| 64 } // namespace internal | |
| 65 } // namespace ash | |
| 66 | |
| 67 #endif // ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ | |
| OLD | NEW |