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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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(bool for_mirroring);
28 virtual ~CursorWindowController();
29
30 // Initializes cursor window for a given container window.
31 void InitCursorWindow(aura::Window* container);
32
33 // Closes cursor window.
34 void CloseCursorWindow();
35
36 // Sets cursor location, shape, set and visibility.
37 void UpdateCursorLocation();
38 void SetCursor(gfx::NativeCursor cursor);
39 void SetCursorSet(ui::CursorSetType);
40 void SetCursorVisibility(bool visible);
41
42 private:
43 friend class test::MirrorWindowTestApi;
44
45 bool for_mirroring_;
46 int current_cursor_type_;
47 ui::CursorSetType current_cursor_set_;
48 ui::CursorSetType requested_cursor_set_;
49 gfx::Display::Rotation current_cursor_rotation_;
50 gfx::Point hot_point_;
51
52 aura::Window* cursor_window_; // owned by container window.
53 scoped_ptr<CursorWindowDelegate> cursor_window_delegate_;
54
55 DISALLOW_COPY_AND_ASSIGN(CursorWindowController);
56 };
57
58 } // namespace internal
59 } // namespace ash
60
61 #endif // ASH_DISPLAY_CURSOR_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698