Index: ash/display/cursor_window_controller.h |
diff --git a/ash/display/cursor_window_controller.h b/ash/display/cursor_window_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fd7ac780674673f9b229718afff067729bdf4378 |
--- /dev/null |
+++ b/ash/display/cursor_window_controller.h |
@@ -0,0 +1,67 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ |
+#define ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ |
+ |
+#include "ui/aura/window.h" |
+#include "ui/base/cursor/cursor.h" |
+#include "ui/gfx/display.h" |
+ |
+namespace ash { |
+namespace test{ |
+class MirrorWindowTestApi; |
+} |
+ |
+namespace internal { |
+ |
+class CursorWindowDelegate; |
+ |
+// Draws a mouse cursor on a given container window. |
+// In the non-mirroring mode, the CursorWindowController draws the cursor as-is. |
+// In the mirroring mode, the CursorWindowController is responsible to scale and |
+// rotate the mouse cursor bitmap to match settings of the primary display. |
+class CursorWindowController { |
+ public: |
+ CursorWindowController(); |
+ 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.
|
+ |
+ // Sets mirroring mode on/off. |
+ void SetMirroring(bool is_mirroring); |
+ |
+ // Sets the container window for the cursor window controller. |
+ // Closes the cursor window if |container| is NULL. |
+ void SetContainer(aura::Window* container); |
+ |
+ // 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.
|
+ void SetDisplayBounds(const gfx::Rect& display_bounds); |
+ |
+ // Sets cursor location, shape, set and visibility. |
+ void UpdateLocation(); |
+ void SetCursor(gfx::NativeCursor cursor); |
+ void SetCursorSet(ui::CursorSetType); |
+ void SetVisibility(bool visible); |
+ |
+ private: |
+ friend class test::MirrorWindowTestApi; |
+ |
+ bool is_mirroring_; |
+ 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.
|
+ gfx::Rect current_display_bounds_; |
+ 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.
|
+ ui::CursorSetType current_cursor_set_; |
+ ui::CursorSetType requested_cursor_set_; |
+ gfx::Display::Rotation current_cursor_rotation_; |
+ gfx::Point hot_point_; |
+ |
+ scoped_ptr<aura::Window> cursor_window_; |
+ scoped_ptr<CursorWindowDelegate> delegate_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CursorWindowController); |
+}; |
+ |
+} // namespace internal |
+} // namespace ash |
+ |
+#endif // ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ |