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

Side by Side Diff: ash/wm/image_cursors.h

Issue 258893002: app_shell: Add support for mouse cursors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update build to exclude ImageCursors on android Created 6 years, 7 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
« no previous file with comments | « ash/wm/ash_native_cursor_manager_unittest.cc ('k') | ash/wm/image_cursors.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_WM_IMAGE_CURSORS_H_
6 #define ASH_WM_IMAGE_CURSORS_H_
7
8 #include "ash/ash_export.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h"
11 #include "ui/base/cursor/cursor.h"
12 #include "ui/gfx/display.h"
13 #include "ui/gfx/native_widget_types.h"
14
15 namespace ui {
16 class CursorLoader;
17 }
18
19 namespace ash {
20
21 // A utility class that provides cursors for NativeCursors for which we have
22 // image resources.
23 class ASH_EXPORT ImageCursors {
24 public:
25 ImageCursors();
26 ~ImageCursors();
27
28 // Returns the scale and rotation of the currently loaded cursor.
29 float GetScale() const;
30 gfx::Display::Rotation GetRotation() const;
31
32 // Sets the display the cursors are loaded for. The device scale factor
33 // determines the size of the image to load, and the rotation of the display
34 // determines if the image and its host point has to be retated.
35 // Returns true if the cursor image is reloaded.
36 bool SetDisplay(const gfx::Display& display);
37
38 // Sets the type of the mouse cursor icon.
39 void SetCursorSet(ui::CursorSetType cursor_set);
40
41 // Sets the platform cursor based on the native type of |cursor|.
42 void SetPlatformCursor(gfx::NativeCursor* cursor);
43
44 private:
45 // Reloads the all loaded cursors in the cursor loader.
46 void ReloadCursors();
47
48 scoped_ptr<ui::CursorLoader> cursor_loader_;
49 ui::CursorSetType cursor_set_;
50
51 DISALLOW_COPY_AND_ASSIGN(ImageCursors);
52 };
53
54 } // namespace ash
55
56 #endif // ASH_WM_IMAGE_CURSORS_H_
OLDNEW
« no previous file with comments | « ash/wm/ash_native_cursor_manager_unittest.cc ('k') | ash/wm/image_cursors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698