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

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

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 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
« no previous file with comments | « ui/base/cursor/cursor_data.cc ('k') | ui/base/cursor/cursor_loader_ozone.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ 6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 19 matching lines...) Expand all
30 float scale() const { 30 float scale() const {
31 return scale_; 31 return scale_;
32 } 32 }
33 33
34 // Sets the scale of the mouse cursor icon. 34 // Sets the scale of the mouse cursor icon.
35 void set_scale(const float scale) { 35 void set_scale(const float scale) {
36 scale_ = scale; 36 scale_ = scale;
37 } 37 }
38 38
39 // Creates a cursor from an image resource and puts it in the cursor map. 39 // Creates a cursor from an image resource and puts it in the cursor map.
40 virtual void LoadImageCursor(int id, 40 virtual void LoadImageCursor(CursorType id,
41 int resource_id, 41 int resource_id,
42 const gfx::Point& hot) = 0; 42 const gfx::Point& hot) = 0;
43 43
44 // Creates an animated cursor from an image resource and puts it in the 44 // Creates an animated cursor from an image resource and puts it in the
45 // cursor map. The image is assumed to be a concatenation of animation frames 45 // cursor map. The image is assumed to be a concatenation of animation frames
46 // from left to right. Also, each frame is assumed to be square 46 // from left to right. Also, each frame is assumed to be square
47 // (width == height). 47 // (width == height).
48 // |frame_delay_ms| is the delay between frames in millisecond. 48 // |frame_delay_ms| is the delay between frames in millisecond.
49 virtual void LoadAnimatedCursor(int id, 49 virtual void LoadAnimatedCursor(CursorType id,
50 int resource_id, 50 int resource_id,
51 const gfx::Point& hot, 51 const gfx::Point& hot,
52 int frame_delay_ms) = 0; 52 int frame_delay_ms) = 0;
53 53
54 // Unloads all the cursors. 54 // Unloads all the cursors.
55 virtual void UnloadAll() = 0; 55 virtual void UnloadAll() = 0;
56 56
57 // Sets the platform cursor based on the native type of |cursor|. 57 // Sets the platform cursor based on the native type of |cursor|.
58 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; 58 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0;
59 59
60 // Creates a CursorLoader. 60 // Creates a CursorLoader.
61 static CursorLoader* Create(); 61 static CursorLoader* Create();
62 62
63 private: 63 private:
64 // The current scale of the mouse cursor icon. 64 // The current scale of the mouse cursor icon.
65 float scale_; 65 float scale_;
66 66
67 // The current rotation of the mouse cursor icon. 67 // The current rotation of the mouse cursor icon.
68 display::Display::Rotation rotation_; 68 display::Display::Rotation rotation_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(CursorLoader); 70 DISALLOW_COPY_AND_ASSIGN(CursorLoader);
71 }; 71 };
72 72
73 } // namespace ui 73 } // namespace ui
74 74
75 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ 75 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor_data.cc ('k') | ui/base/cursor/cursor_loader_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698