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..5e4d141d60c6f501604a708bf7d1ea7cf890b0fe |
--- /dev/null |
+++ b/ash/display/cursor_window_controller.h |
@@ -0,0 +1,61 @@ |
+// 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(bool for_mirroring); |
+ virtual ~CursorWindowController(); |
+ |
+ // Initializes cursor window for a given container window. |
+ void InitCursorWindow(aura::Window* container); |
+ |
+ // Closes cursor window. |
+ void CloseCursorWindow(); |
+ |
+ // Sets cursor location, shape, set and visibility. |
+ void UpdateCursorLocation(); |
+ void SetCursor(gfx::NativeCursor cursor); |
+ void SetCursorSet(ui::CursorSetType); |
+ void SetCursorVisibility(bool visible); |
+ |
+ private: |
+ friend class test::MirrorWindowTestApi; |
+ |
+ bool for_mirroring_; |
+ int current_cursor_type_; |
+ ui::CursorSetType current_cursor_set_; |
+ ui::CursorSetType requested_cursor_set_; |
+ gfx::Display::Rotation current_cursor_rotation_; |
+ gfx::Point hot_point_; |
+ |
+ aura::Window* cursor_window_; // owned by container window. |
+ scoped_ptr<CursorWindowDelegate> cursor_window_delegate_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CursorWindowController); |
+}; |
+ |
+} // namespace internal |
+} // namespace ash |
+ |
+#endif // ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_ |