Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: ash/display/cursor_window_controller.h

Issue 145313003: Implement cursor compositing mode on Ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_aura build. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698