| Index: ui/base/cursor/cursors_aura.cc
|
| diff --git a/ui/base/cursor/cursors_aura.cc b/ui/base/cursor/cursors_aura.cc
|
| index 0d8a73d074ed239b84a4ef3a0f77193f8313a9b8..1e9e246a7237ef0e7965ef55675c5b7c793273af 100644
|
| --- a/ui/base/cursor/cursors_aura.cc
|
| +++ b/ui/base/cursor/cursors_aura.cc
|
| @@ -33,8 +33,8 @@ struct CursorData {
|
| HotPoint hot_2x;
|
| };
|
|
|
| -struct CursorSet {
|
| - const CursorSetType id;
|
| +struct CursorSetData {
|
| + const CursorSet id;
|
| const CursorData* cursors;
|
| const int length;
|
| const CursorData* animated_cursors;
|
| @@ -202,21 +202,16 @@ const CursorData kAnimatedCursors[] = {
|
| {CursorType::kProgress, IDR_AURA_CURSOR_THROBBER, {7, 7}, {14, 14}},
|
| };
|
|
|
| -const CursorSet kCursorSets[] = {
|
| - {
|
| - CURSOR_SET_NORMAL,
|
| - kNormalCursors, arraysize(kNormalCursors),
|
| - kAnimatedCursors, arraysize(kAnimatedCursors)
|
| - },
|
| - {
|
| - CURSOR_SET_LARGE,
|
| - kLargeCursors, arraysize(kLargeCursors),
|
| - // TODO(yoshiki): Replace animated cursors with big assets. crbug.com/247254
|
| - kAnimatedCursors, arraysize(kAnimatedCursors)
|
| - },
|
| +const CursorSetData kCursorSets[] = {
|
| + {CursorSet::kNormal, kNormalCursors, arraysize(kNormalCursors),
|
| + kAnimatedCursors, arraysize(kAnimatedCursors)},
|
| + {CursorSet::kLarge, kLargeCursors, arraysize(kLargeCursors),
|
| + // TODO(yoshiki): Replace animated cursors with big assets.
|
| + // crbug.com/247254
|
| + kAnimatedCursors, arraysize(kAnimatedCursors)},
|
| };
|
|
|
| -const CursorSet* GetCursorSetByType(CursorSetType cursor_set_id) {
|
| +const CursorSetData* GetCursorSetByType(CursorSet cursor_set_id) {
|
| for (size_t i = 0; i < arraysize(kCursorSets); ++i) {
|
| if (kCursorSets[i].id == cursor_set_id)
|
| return &kCursorSets[i];
|
| @@ -249,12 +244,12 @@ bool SearchTable(const CursorData* table,
|
|
|
| } // namespace
|
|
|
| -bool GetCursorDataFor(CursorSetType cursor_set_id,
|
| +bool GetCursorDataFor(CursorSet cursor_set_id,
|
| CursorType id,
|
| float scale_factor,
|
| int* resource_id,
|
| gfx::Point* point) {
|
| - const CursorSet* cursor_set = GetCursorSetByType(cursor_set_id);
|
| + const CursorSetData* cursor_set = GetCursorSetByType(cursor_set_id);
|
| if (cursor_set &&
|
| SearchTable(cursor_set->cursors,
|
| cursor_set->length,
|
| @@ -263,19 +258,19 @@ bool GetCursorDataFor(CursorSetType cursor_set_id,
|
| }
|
|
|
| // Falls back to the default cursor set.
|
| - cursor_set = GetCursorSetByType(ui::CURSOR_SET_NORMAL);
|
| + cursor_set = GetCursorSetByType(ui::CursorSet::kNormal);
|
| DCHECK(cursor_set);
|
| return SearchTable(cursor_set->cursors,
|
| cursor_set->length,
|
| id, scale_factor, resource_id, point);
|
| }
|
|
|
| -bool GetAnimatedCursorDataFor(CursorSetType cursor_set_id,
|
| +bool GetAnimatedCursorDataFor(CursorSet cursor_set_id,
|
| CursorType id,
|
| float scale_factor,
|
| int* resource_id,
|
| gfx::Point* point) {
|
| - const CursorSet* cursor_set = GetCursorSetByType(cursor_set_id);
|
| + const CursorSetData* cursor_set = GetCursorSetByType(cursor_set_id);
|
| if (cursor_set &&
|
| SearchTable(cursor_set->animated_cursors,
|
| cursor_set->animated_length,
|
| @@ -284,7 +279,7 @@ bool GetAnimatedCursorDataFor(CursorSetType cursor_set_id,
|
| }
|
|
|
| // Falls back to the default cursor set.
|
| - cursor_set = GetCursorSetByType(ui::CURSOR_SET_NORMAL);
|
| + cursor_set = GetCursorSetByType(ui::CursorSet::kNormal);
|
| DCHECK(cursor_set);
|
| return SearchTable(cursor_set->animated_cursors,
|
| cursor_set->animated_length,
|
| @@ -304,11 +299,8 @@ bool GetCursorBitmap(const Cursor& cursor,
|
| *point = IconUtil::GetHotSpotFromHICON(cursor_copy.platform());
|
| #else
|
| int resource_id;
|
| - if (!GetCursorDataFor(ui::CURSOR_SET_NORMAL,
|
| - cursor.native_type(),
|
| - cursor.device_scale_factor(),
|
| - &resource_id,
|
| - point)) {
|
| + if (!GetCursorDataFor(ui::CursorSet::kNormal, cursor.native_type(),
|
| + cursor.device_scale_factor(), &resource_id, point)) {
|
| return false;
|
| }
|
|
|
|
|