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

Unified Diff: content/common/cursors/webcursor.cc

Issue 1975033002: Minor cleanup to webcursors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete another function Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/cursors/webcursor.h ('k') | content/common/cursors/webcursor_aurawin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/cursors/webcursor.cc
diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc
index 51db2eac72969d60bd8cc61684510bf4ac3b46ca..98addd7a4c18728e7f61db7106a9ccbc7d249fa1 100644
--- a/content/common/cursors/webcursor.cc
+++ b/content/common/cursors/webcursor.cc
@@ -18,12 +18,6 @@ namespace content {
WebCursor::WebCursor()
: type_(WebCursorInfo::TypePointer),
custom_scale_(1) {
-#if defined(OS_WIN)
- external_cursor_ = NULL;
-#endif
-#if defined(USE_AURA)
- device_scale_factor_ = 1.0f;
-#endif
InitPlatformData();
}
@@ -48,13 +42,6 @@ const WebCursor& WebCursor::operator=(const WebCursor& other) {
void WebCursor::InitFromCursorInfo(const CursorInfo& cursor_info) {
Clear();
-#if defined(OS_WIN)
- if (cursor_info.external_handle) {
- InitFromExternalCursor(cursor_info.external_handle);
- return;
- }
-#endif
-
type_ = cursor_info.type;
hotspot_ = cursor_info.hotspot;
if (IsCustom())
@@ -69,10 +56,6 @@ void WebCursor::GetCursorInfo(CursorInfo* cursor_info) const {
cursor_info->hotspot = hotspot_;
ImageFromCustomData(&cursor_info->custom_image);
cursor_info->image_scale_factor = custom_scale_;
-
-#if defined(OS_WIN)
- cursor_info->external_handle = external_cursor_;
-#endif
}
bool WebCursor::Deserialize(base::PickleIterator* iter) {
@@ -166,45 +149,6 @@ bool WebCursor::IsEqual(const WebCursor& other) const {
custom_data_ == other.custom_data_;
}
-#if defined(OS_WIN)
-
-static WebCursorInfo::Type ToCursorType(HCURSOR cursor) {
- static struct {
- HCURSOR cursor;
- WebCursorInfo::Type type;
- } kStandardCursors[] = {
- { LoadCursor(NULL, IDC_ARROW), WebCursorInfo::TypePointer },
- { LoadCursor(NULL, IDC_CROSS), WebCursorInfo::TypeCross },
- { LoadCursor(NULL, IDC_HAND), WebCursorInfo::TypeHand },
- { LoadCursor(NULL, IDC_IBEAM), WebCursorInfo::TypeIBeam },
- { LoadCursor(NULL, IDC_WAIT), WebCursorInfo::TypeWait },
- { LoadCursor(NULL, IDC_HELP), WebCursorInfo::TypeHelp },
- { LoadCursor(NULL, IDC_SIZENESW), WebCursorInfo::TypeNorthEastResize },
- { LoadCursor(NULL, IDC_SIZENWSE), WebCursorInfo::TypeNorthWestResize },
- { LoadCursor(NULL, IDC_SIZENS), WebCursorInfo::TypeNorthSouthResize },
- { LoadCursor(NULL, IDC_SIZEWE), WebCursorInfo::TypeEastWestResize },
- { LoadCursor(NULL, IDC_SIZEALL), WebCursorInfo::TypeMove },
- { LoadCursor(NULL, IDC_APPSTARTING), WebCursorInfo::TypeProgress },
- { LoadCursor(NULL, IDC_NO), WebCursorInfo::TypeNotAllowed },
- };
- for (const auto& kStandardCursor : kStandardCursors) {
- if (cursor == kStandardCursor.cursor)
- return kStandardCursor.type;
- }
- return WebCursorInfo::TypeCustom;
-}
-
-void WebCursor::InitFromExternalCursor(HCURSOR cursor) {
- WebCursorInfo::Type cursor_type = ToCursorType(cursor);
-
- InitFromCursorInfo(CursorInfo(cursor_type));
-
- if (cursor_type == WebCursorInfo::TypeCustom)
- external_cursor_ = cursor;
-}
-
-#endif // defined(OS_WIN)
-
void WebCursor::Clear() {
type_ = WebCursorInfo::TypePointer;
hotspot_.set_x(0);
« no previous file with comments | « content/common/cursors/webcursor.h ('k') | content/common/cursors/webcursor_aurawin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698