Chromium Code Reviews| 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; |