Index: ui/base/x/x11_util.h |
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h |
index 869ef7c527c3946f59b14333a47745f2b4d7e450..d6dc0c3172d6461b550552b99d41da180b2aba17 100644 |
--- a/ui/base/x/x11_util.h |
+++ b/ui/base/x/x11_util.h |
@@ -97,6 +97,12 @@ UI_EXPORT XcursorImage* SkBitmapToXcursorImage(const SkBitmap* bitmap, |
const gfx::Point& hotspot); |
#endif |
+// Hides the host cursor. |
+UI_EXPORT void HideHostCursor(); |
+ |
+// Returns an invisible cursor. |
+UI_EXPORT ::Cursor CreateInvisibleCursor(); |
+ |
// These functions do not cache their results -------------------------- |
// Get the X window id for the default root window |
@@ -319,6 +325,24 @@ class UI_EXPORT XScopedString { |
DISALLOW_COPY_AND_ASSIGN(XScopedString); |
}; |
+// Keeps track of a cursor returned by an X function and makes sure it's |
+// XFreeCursor'd. |
+class UI_EXPORT XScopedCursor { |
+ public: |
+ // Keeps track of |cursor| created with |display|. |
+ XScopedCursor(::Cursor cursor, Display* display); |
+ ~XScopedCursor(); |
+ |
+ ::Cursor get() const; |
+ void reset(::Cursor cursor); |
+ |
+ private: |
+ ::Cursor cursor_; |
+ Display* display_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(XScopedCursor); |
+}; |
+ |
} // namespace ui |
#endif // UI_BASE_X_X11_UTIL_H_ |