OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "ui/base/cursor/image_cursors.h" | 5 #include "ui/base/cursor/image_cursors.h" |
6 | 6 |
7 #include <float.h> | 7 #include <float.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "ui/base/cursor/cursor.h" | 13 #include "ui/base/cursor/cursor.h" |
14 #include "ui/base/cursor/cursor_loader.h" | 14 #include "ui/base/cursor/cursor_loader.h" |
15 #include "ui/base/cursor/cursors_aura.h" | 15 #include "ui/base/cursor/cursors_aura.h" |
16 #include "ui/display/display.h" | 16 #include "ui/display/display.h" |
17 #include "ui/gfx/geometry/point.h" | 17 #include "ui/gfx/geometry/point.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 const int kImageCursorIds[] = { | 23 const CursorType kImageCursorIds[] = { |
24 kCursorNull, | 24 CursorType::kNull, |
25 kCursorPointer, | 25 CursorType::kPointer, |
26 kCursorNoDrop, | 26 CursorType::kNoDrop, |
27 kCursorNotAllowed, | 27 CursorType::kNotAllowed, |
28 kCursorCopy, | 28 CursorType::kCopy, |
29 kCursorHand, | 29 CursorType::kHand, |
30 kCursorMove, | 30 CursorType::kMove, |
31 kCursorNorthEastResize, | 31 CursorType::kNorthEastResize, |
32 kCursorSouthWestResize, | 32 CursorType::kSouthWestResize, |
33 kCursorSouthEastResize, | 33 CursorType::kSouthEastResize, |
34 kCursorNorthWestResize, | 34 CursorType::kNorthWestResize, |
35 kCursorNorthResize, | 35 CursorType::kNorthResize, |
36 kCursorSouthResize, | 36 CursorType::kSouthResize, |
37 kCursorEastResize, | 37 CursorType::kEastResize, |
38 kCursorWestResize, | 38 CursorType::kWestResize, |
39 kCursorIBeam, | 39 CursorType::kIBeam, |
40 kCursorAlias, | 40 CursorType::kAlias, |
41 kCursorCell, | 41 CursorType::kCell, |
42 kCursorContextMenu, | 42 CursorType::kContextMenu, |
43 kCursorCross, | 43 CursorType::kCross, |
44 kCursorHelp, | 44 CursorType::kHelp, |
45 kCursorVerticalText, | 45 CursorType::kVerticalText, |
46 kCursorZoomIn, | 46 CursorType::kZoomIn, |
47 kCursorZoomOut, | 47 CursorType::kZoomOut, |
48 kCursorRowResize, | 48 CursorType::kRowResize, |
49 kCursorColumnResize, | 49 CursorType::kColumnResize, |
50 kCursorEastWestResize, | 50 CursorType::kEastWestResize, |
51 kCursorNorthSouthResize, | 51 CursorType::kNorthSouthResize, |
52 kCursorNorthEastSouthWestResize, | 52 CursorType::kNorthEastSouthWestResize, |
53 kCursorNorthWestSouthEastResize, | 53 CursorType::kNorthWestSouthEastResize, |
54 kCursorGrab, | 54 CursorType::kGrab, |
55 kCursorGrabbing, | 55 CursorType::kGrabbing, |
56 }; | 56 }; |
57 | 57 |
58 const int kAnimatedCursorIds[] = { | 58 const CursorType kAnimatedCursorIds[] = {CursorType::kWait, |
59 kCursorWait, | 59 CursorType::kProgress}; |
60 kCursorProgress | |
61 }; | |
62 | 60 |
63 } // namespace | 61 } // namespace |
64 | 62 |
65 ImageCursors::ImageCursors() : cursor_set_(CURSOR_SET_NORMAL) { | 63 ImageCursors::ImageCursors() : cursor_set_(CURSOR_SET_NORMAL) { |
66 } | 64 } |
67 | 65 |
68 ImageCursors::~ImageCursors() { | 66 ImageCursors::~ImageCursors() { |
69 } | 67 } |
70 | 68 |
71 float ImageCursors::GetScale() const { | 69 float ImageCursors::GetScale() const { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 141 |
144 if (cursor_loader_.get()) | 142 if (cursor_loader_.get()) |
145 ReloadCursors(); | 143 ReloadCursors(); |
146 } | 144 } |
147 | 145 |
148 void ImageCursors::SetPlatformCursor(gfx::NativeCursor* cursor) { | 146 void ImageCursors::SetPlatformCursor(gfx::NativeCursor* cursor) { |
149 cursor_loader_->SetPlatformCursor(cursor); | 147 cursor_loader_->SetPlatformCursor(cursor); |
150 } | 148 } |
151 | 149 |
152 } // namespace ui | 150 } // namespace ui |
OLD | NEW |