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

Unified Diff: content/public/common/cursor_info.h

Issue 2808763009: Allow content embedder to set a cursor for RenderWidgetHost (Closed)
Patch Set: comment 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
« no previous file with comments | « content/public/common/BUILD.gn ('k') | content/renderer/cursor_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/cursor_info.h
diff --git a/content/public/common/cursor_info.h b/content/public/common/cursor_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac56545bfcb6d85e5c4e28a1022bef2d137f043a
--- /dev/null
+++ b/content/public/common/cursor_info.h
@@ -0,0 +1,40 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_COMMON_CURSOR_INFO_H_
+#define CONTENT_PUBLIC_COMMON_CURSOR_INFO_H_
+
+#include "build/build_config.h"
+#include "content/common/content_export.h"
+#include "third_party/WebKit/public/platform/WebCursorInfo.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+namespace content {
+
+// This struct represents the data sufficient to create a cross-platform cursor:
+// either a predefined cursor type (from WebCursorInfo) or custom image.
+struct CONTENT_EXPORT CursorInfo {
+ explicit CursorInfo(blink::WebCursorInfo::Type cursor_type)
+ : type(cursor_type), image_scale_factor(1) {}
+
+ CursorInfo()
+ : type(blink::WebCursorInfo::kTypePointer), image_scale_factor(1) {}
+
+ // One of the predefined cursors.
+ blink::WebCursorInfo::Type type;
+
+ // Custom cursor image.
+ SkBitmap custom_image;
+
+ // Hotspot in custom image in pixels.
+ gfx::Point hotspot;
+
+ // The scale factor of custom image, used to possibly re-scale the image
+ // for a different density display.
+ float image_scale_factor;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_CURSOR_INFO_H_
« no previous file with comments | « content/public/common/BUILD.gn ('k') | content/renderer/cursor_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698