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

Unified Diff: components/exo/surface.cc

Issue 2028443002: exo: Implement lazy cursor changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « components/exo/surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index b8080fe1c40fa4a086a7516f55bea19e027afe90..ee5c7e10122a7b80ee173bd91864fcc97ae40cdd 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -78,7 +78,10 @@ class CustomWindowDelegate : public aura::WindowDelegate {
void OnBoundsChanged(const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override {}
gfx::NativeCursor GetCursor(const gfx::Point& point) override {
- return ui::kCursorNone;
+ // If surface has a cursor provider then return 'none' as cursor providers
+ // are responsible for drawing cursors. Use default cursor if no cursor
+ // provider is registered.
+ return surface_->HasCursorProvider() ? ui::kCursorNone : ui::kCursorNull;
Daniele Castagna 2016/05/31 19:32:03 I understand that when kCursorNull is returns the
}
int GetNonClientComponent(const gfx::Point& point) const override {
return HTNOWHERE;
@@ -740,6 +743,18 @@ gfx::Rect Surface::GetNonTransparentBounds() const {
return non_transparent_bounds;
}
+void Surface::RegisterCursorProvider(Pointer* provider) {
+ cursor_providers_.insert(provider);
+}
+
+void Surface::UnregisterCursorProvider(Pointer* provider) {
+ cursor_providers_.erase(provider);
+}
+
+bool Surface::HasCursorProvider() const {
+ return !cursor_providers_.empty();
+}
+
void Surface::SetSurfaceDelegate(SurfaceDelegate* delegate) {
DCHECK(!delegate_ || !delegate);
delegate_ = delegate;
« no previous file with comments | « components/exo/surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698