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

Side by Side Diff: ui/base/cursor/image_cursors.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/base/cursor/cursors_aura.cc ('k') | ui/base/cursor/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 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 UI_BASE_CURSOR_IMAGE_CURSORS_H_
6 #define UI_BASE_CURSOR_IMAGE_CURSORS_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
10 #include "ui/base/cursor/cursor.h"
11 #include "ui/base/ui_base_export.h"
12 #include "ui/gfx/display.h"
13 #include "ui/gfx/native_widget_types.h"
14
15 namespace ui {
16
17 class CursorLoader;
18
19 // A utility class that provides cursors for NativeCursors for which we have
20 // image resources.
21 class UI_BASE_EXPORT ImageCursors {
22 public:
23 ImageCursors();
24 ~ImageCursors();
25
26 // Returns the scale and rotation of the currently loaded cursor.
27 float GetScale() const;
28 gfx::Display::Rotation GetRotation() const;
29
30 // Sets the display the cursors are loaded for. |scale_factor| determines the
31 // size of the image to load. Returns true if the cursor image is reloaded.
32 bool SetDisplay(const gfx::Display& display, float scale_factor);
33
34 // Sets the type of the mouse cursor icon.
35 void SetCursorSet(CursorSetType cursor_set);
36
37 // Sets the platform cursor based on the native type of |cursor|.
38 void SetPlatformCursor(gfx::NativeCursor* cursor);
39
40 private:
41 // Reloads the all loaded cursors in the cursor loader.
42 void ReloadCursors();
43
44 scoped_ptr<CursorLoader> cursor_loader_;
45 CursorSetType cursor_set_;
46
47 DISALLOW_COPY_AND_ASSIGN(ImageCursors);
48 };
49
50 } // namespace ui
51
52 #endif // UI_BASE_CURSOR_IMAGE_CURSORS_H_
OLDNEW
« no previous file with comments | « ui/base/cursor/cursors_aura.cc ('k') | ui/base/cursor/image_cursors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698