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

Unified Diff: ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
diff --git a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
index ab052ca630112a91e0472a88f3946ecfe0dcf810..5ed4c7bdefb74b6023c2bf01a048911ab71c583c 100644
--- a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
+++ b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
@@ -20,7 +20,7 @@ PlatformCursor ToPlatformCursor(BitmapCursorOzone* cursor) {
return static_cast<PlatformCursor>(cursor);
}
-scoped_refptr<BitmapCursorOzone> CreateDefaultBitmapCursor(int type) {
+scoped_refptr<BitmapCursorOzone> CreateDefaultBitmapCursor(CursorType type) {
SkBitmap bitmap;
gfx::Point hotspot;
if (GetCursorBitmap(type, &bitmap, &hotspot))
@@ -73,7 +73,7 @@ scoped_refptr<BitmapCursorOzone> BitmapCursorFactoryOzone::GetBitmapCursor(
return make_scoped_refptr(ToBitmapCursorOzone(platform_cursor));
}
-PlatformCursor BitmapCursorFactoryOzone::GetDefaultCursor(int type) {
+PlatformCursor BitmapCursorFactoryOzone::GetDefaultCursor(CursorType type) {
return GetDefaultCursorInternal(type).get();
}
@@ -107,16 +107,16 @@ void BitmapCursorFactoryOzone::UnrefImageCursor(PlatformCursor cursor) {
}
scoped_refptr<BitmapCursorOzone>
-BitmapCursorFactoryOzone::GetDefaultCursorInternal(int type) {
- if (type == kCursorNone)
+BitmapCursorFactoryOzone::GetDefaultCursorInternal(CursorType type) {
+ if (type == CursorType::kNone)
return NULL; // NULL is used for hidden cursor.
if (!default_cursors_.count(type)) {
// Create new image cursor from default aura bitmap for this type. We hold a
// ref forever because clients do not do refcounting for default cursors.
scoped_refptr<BitmapCursorOzone> cursor = CreateDefaultBitmapCursor(type);
- if (!cursor.get() && type != kCursorPointer)
- cursor = GetDefaultCursorInternal(kCursorPointer);
+ if (!cursor.get() && type != CursorType::kPointer)
+ cursor = GetDefaultCursorInternal(CursorType::kPointer);
DCHECK(cursor.get()) << "Failed to load default cursor bitmap";
default_cursors_[type] = cursor;
}
« no previous file with comments | « ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h ('k') | ui/base/cursor/ozone/cursor_data_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698