Revert of Move GetCursor() method from WindowDelegate to its own delegate interface CursorDelegate. (https://codereview.chromium.org/211733003/)

Reason for revert:
http://crbug.com/357015

Original issue's description:
> Move GetCursor() method from WindowDelegate to its own delegate interface CursorDelegate.
> 
> [email protected]
> http://crbug.com/308845
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=259631

[email protected]
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/213383007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259805 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ash/display/cursor_window_controller.cc b/ash/display/cursor_window_controller.cc
index 7206071..abc51758 100644
--- a/ash/display/cursor_window_controller.cc
+++ b/ash/display/cursor_window_controller.cc
@@ -34,6 +34,9 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE { return size_; }
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {}
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(
       const gfx::Point& point) const OVERRIDE {
     return HTNOWHERE;
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 5426ac1c..cc8d96b 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -95,6 +95,9 @@
 
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {}
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
     return HTCAPTION;
   }
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 7dcaff9..429c9c5 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -221,6 +221,9 @@
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {
   }
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(
       const gfx::Point& point) const OVERRIDE {
     return HTNOWHERE;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 3b835ec8..5321012 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2616,6 +2616,12 @@
   SetSize(new_bounds.size());
 }
 
+gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) {
+  if (mouse_locked_)
+    return ui::kCursorNone;
+  return current_cursor_.GetNativeCursor();
+}
+
 int RenderWidgetHostViewAura::GetNonClientComponent(
     const gfx::Point& point) const {
   return HTCLIENT;
@@ -3058,16 +3064,6 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// RenderWidgetHostViewAura, wm::CursorDelegate implementation:
-
-gfx::NativeCursor RenderWidgetHostViewAura::GetCursorForPoint(
-    const gfx::Point& point) {
-  if (mouse_locked_)
-    return ui::kCursorNone;
-  return current_cursor_.GetNativeCursor();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation:
 
 void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index f211064..735f724 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -42,7 +42,6 @@
 #include "ui/gfx/rect.h"
 #include "ui/wm/public/activation_change_observer.h"
 #include "ui/wm/public/activation_delegate.h"
-#include "ui/wm/public/cursor_delegate.h"
 
 namespace aura {
 class WindowTracker;
@@ -97,7 +96,6 @@
       public aura::client::ActivationChangeObserver,
       public aura::client::FocusChangeObserver,
       public aura::client::CursorClientObserver,
-      public wm::CursorDelegate,
       public ImageTransportFactoryObserver,
       public BrowserAccessibilityDelegate,
       public SoftwareFrameManagerClient,
@@ -290,6 +288,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE;
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       aura::Window* child,
@@ -321,9 +320,6 @@
   // Overridden from aura::client::CursorClientObserver:
   virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE;
 
-  // Overridden from wm::CursorDelegate:
-  virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) OVERRIDE;
-
   // Overridden from aura::client::FocusChangeObserver:
   virtual void OnWindowFocused(aura::Window* gained_focus,
                                aura::Window* lost_focus) OVERRIDE;
diff --git a/content/browser/web_contents/aura/image_window_delegate.cc b/content/browser/web_contents/aura/image_window_delegate.cc
index 1fd3567d..0b40c0f0 100644
--- a/content/browser/web_contents/aura/image_window_delegate.cc
+++ b/content/browser/web_contents/aura/image_window_delegate.cc
@@ -43,6 +43,10 @@
     size_mismatch_ = window_size_ != image_.AsImageSkia().size();
 }
 
+gfx::NativeCursor ImageWindowDelegate::GetCursor(const gfx::Point& point) {
+  return gfx::kNullCursor;
+}
+
 int ImageWindowDelegate::GetNonClientComponent(const gfx::Point& point) const {
   return HTNOWHERE;
 }
diff --git a/content/browser/web_contents/aura/image_window_delegate.h b/content/browser/web_contents/aura/image_window_delegate.h
index 4c3784f..d0f9b06 100644
--- a/content/browser/web_contents/aura/image_window_delegate.h
+++ b/content/browser/web_contents/aura/image_window_delegate.h
@@ -29,6 +29,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE;
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       aura::Window* child,
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 7ec7470..3a87d47 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -1371,6 +1371,10 @@
   }
 }
 
+gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) {
+  return gfx::kNullCursor;
+}
+
 int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const {
   return HTCLIENT;
 }
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h
index 4cca4a9..e472a36 100644
--- a/content/browser/web_contents/web_contents_view_aura.h
+++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -154,6 +154,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE;
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       aura::Window* child,
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index ee32b7d..1109f87f 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -1672,7 +1672,6 @@
       'dependencies': [
         '../ui/aura/aura.gyp:aura',
         '../ui/base/strings/ui_strings.gyp:ui_strings',
-        '../ui/wm/wm.gyp:wm_core',
       ],
       'sources/': [
         ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.cc'],
diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc
index 0f8c9a9a..be9b144 100644
--- a/mojo/examples/aura_demo/aura_demo.cc
+++ b/mojo/examples/aura_demo/aura_demo.cc
@@ -54,6 +54,9 @@
 
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {}
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
     return HTCAPTION;
   }
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index a7a21cc..548aeded 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -49,6 +49,9 @@
 
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {}
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
     return HTCAPTION;
   }
diff --git a/ui/aura/test/test_window_delegate.cc b/ui/aura/test/test_window_delegate.cc
index 127c545c..7f0ca1b 100644
--- a/ui/aura/test/test_window_delegate.cc
+++ b/ui/aura/test/test_window_delegate.cc
@@ -50,6 +50,10 @@
                                          const gfx::Rect& new_bounds) {
 }
 
+gfx::NativeCursor TestWindowDelegate::GetCursor(const gfx::Point& point) {
+  return gfx::kNullCursor;
+}
+
 int TestWindowDelegate::GetNonClientComponent(const gfx::Point& point) const {
   return window_component_;
 }
diff --git a/ui/aura/test/test_window_delegate.h b/ui/aura/test/test_window_delegate.h
index e1001162..6f36e44 100644
--- a/ui/aura/test/test_window_delegate.h
+++ b/ui/aura/test/test_window_delegate.h
@@ -46,6 +46,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE;
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       Window* child,
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index f3b8d5a2..86c9046 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -622,6 +622,10 @@
   root_window->GetHost()->MoveCursorTo(point_in_root);
 }
 
+gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
+  return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor;
+}
+
 void Window::SetEventFilter(ui::EventHandler* event_filter) {
   if (event_filter_)
     RemovePreTargetHandler(event_filter_.get());
diff --git a/ui/aura/window.h b/ui/aura/window.h
index b74e605..2324533 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -217,6 +217,9 @@
   // Moves the cursor to the specified location relative to the window.
   virtual void MoveCursorTo(const gfx::Point& point_in_window);
 
+  // Returns the cursor for the specified point, in window coordinates.
+  gfx::NativeCursor GetCursor(const gfx::Point& point) const;
+
   // Sets an 'event filter' for the window. An 'event filter' for a Window is
   // a pre-target event handler, where the window owns the handler. A window
   // can have only one such event filter. Setting a new filter removes and
diff --git a/ui/aura/window_delegate.h b/ui/aura/window_delegate.h
index ce0a457..90e978a 100644
--- a/ui/aura/window_delegate.h
+++ b/ui/aura/window_delegate.h
@@ -44,6 +44,10 @@
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) = 0;
 
+  // Returns the native cursor for the specified point, in window coordinates,
+  // or NULL for the default cursor.
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0;
+
   // Returns the non-client component (see hit_test.h) containing |point|, in
   // window coordinates.
   virtual int GetNonClientComponent(const gfx::Point& point) const = 0;
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 72f16ce..1de832c 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -84,6 +84,9 @@
                                const gfx::Rect& new_bounds) OVERRIDE {
     bounds_ = new_bounds;
   }
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+    return gfx::kNullCursor;
+  }
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
     return HTNOWHERE;
   }
diff --git a/ui/views/controls/native/native_view_host_aura.cc b/ui/views/controls/native/native_view_host_aura.cc
index edd65a61..49bf733 100644
--- a/ui/views/controls/native/native_view_host_aura.cc
+++ b/ui/views/controls/native/native_view_host_aura.cc
@@ -11,7 +11,6 @@
 #include "ui/views/controls/native/native_view_host.h"
 #include "ui/views/view_constants_aura.h"
 #include "ui/views/widget/widget.h"
-#include "ui/wm/public/cursor_delegate.h"
 
 namespace views {
 
@@ -103,11 +102,8 @@
 }
 
 gfx::NativeCursor NativeViewHostAura::GetCursor(int x, int y) {
-  if (host_->native_view()) {
-    wm::CursorDelegate* delegate = wm::GetCursorDelegate(host_->native_view());
-    if (delegate)
-      return delegate->GetCursorForPoint(gfx::Point(x, y));
-  }
+  if (host_->native_view())
+    return host_->native_view()->GetCursor(gfx::Point(x, y));
   return gfx::kNullCursor;
 }
 
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index ed46dc0..8341bce 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -259,7 +259,6 @@
       widget_type_(Widget::InitParams::TYPE_WINDOW) {
   aura::client::SetFocusChangeObserver(content_window_, this);
   aura::client::SetActivationChangeObserver(content_window_, this);
-  wm::SetCursorDelegate(content_window_, this);
 }
 
 DesktopNativeWidgetAura::~DesktopNativeWidgetAura() {
@@ -930,6 +929,10 @@
   return native_widget_delegate_->GetMaximumSize();
 }
 
+gfx::NativeCursor DesktopNativeWidgetAura::GetCursor(const gfx::Point& point) {
+  return cursor_;
+}
+
 int DesktopNativeWidgetAura::GetNonClientComponent(
     const gfx::Point& point) const {
   return native_widget_delegate_->GetNonClientComponent(point);
@@ -1157,14 +1160,6 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// DesktopNativeWidgetAura, wm::CursorDelegate implementation:
-
-gfx::NativeCursor DesktopNativeWidgetAura::GetCursorForPoint(
-    const gfx::Point& point) {
-  return cursor_;
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // DesktopNativeWidgetAura, NativeWidget implementation:
 
 ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() {
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
index 687b0b3..c2966d9 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -15,7 +15,6 @@
 #include "ui/wm/core/compound_event_filter.h"
 #include "ui/wm/public/activation_change_observer.h"
 #include "ui/wm/public/activation_delegate.h"
-#include "ui/wm/public/cursor_delegate.h"
 #include "ui/wm/public/drag_drop_delegate.h"
 
 namespace aura {
@@ -61,8 +60,7 @@
       public aura::client::FocusChangeObserver,
       public views::internal::InputMethodDelegate,
       public aura::client::DragDropDelegate,
-      public aura::WindowTreeHostObserver,
-      public wm::CursorDelegate {
+      public aura::WindowTreeHostObserver {
  public:
   explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate);
   virtual ~DesktopNativeWidgetAura();
@@ -188,6 +186,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE {}
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       aura::Window* child,
@@ -235,9 +234,6 @@
   virtual void OnHostMoved(const aura::WindowTreeHost* host,
                            const gfx::Point& new_origin) OVERRIDE;
 
-  // Overridden from wm::CursorDelegate:
-  virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) OVERRIDE;
-
  private:
   friend class FocusManagerEventHandler;
   friend class RootWindowDestructionObserver;
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 4b357440..75e78a4 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -80,7 +80,6 @@
       saved_window_state_(ui::SHOW_STATE_DEFAULT) {
   aura::client::SetFocusChangeObserver(window_, this);
   aura::client::SetActivationChangeObserver(window_, this);
-  wm::SetCursorDelegate(window_, this);
 }
 
 // static
@@ -726,6 +725,10 @@
     delegate_->OnNativeWidgetSizeChanged(new_bounds.size());
 }
 
+gfx::NativeCursor NativeWidgetAura::GetCursor(const gfx::Point& point) {
+  return cursor_;
+}
+
 int NativeWidgetAura::GetNonClientComponent(const gfx::Point& point) const {
   return delegate_->GetNonClientComponent(point);
 }
@@ -941,13 +944,6 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// NativeWidgetAura, wm::CursorDelegate implementation:
-
-gfx::NativeCursor NativeWidgetAura::GetCursorForPoint(const gfx::Point& point) {
-  return cursor_;
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // NativeWidgetAura, NativeWidget implementation:
 
 ui::EventHandler* NativeWidgetAura::GetEventHandler() {
diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h
index 387eb31..6ca1e71 100644
--- a/ui/views/widget/native_widget_aura.h
+++ b/ui/views/widget/native_widget_aura.h
@@ -16,7 +16,6 @@
 #include "ui/views/widget/native_widget_private.h"
 #include "ui/wm/public/activation_change_observer.h"
 #include "ui/wm/public/activation_delegate.h"
-#include "ui/wm/public/cursor_delegate.h"
 #include "ui/wm/public/drag_drop_delegate.h"
 
 namespace aura {
@@ -39,8 +38,7 @@
       public aura::client::ActivationDelegate,
       public aura::client::ActivationChangeObserver,
       public aura::client::FocusChangeObserver,
-      public aura::client::DragDropDelegate,
-      public wm::CursorDelegate {
+      public aura::client::DragDropDelegate {
  public:
   explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate);
 
@@ -146,6 +144,7 @@
   virtual gfx::Size GetMaximumSize() const OVERRIDE;
   virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
                                const gfx::Rect& new_bounds) OVERRIDE;
+  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
   virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
   virtual bool ShouldDescendIntoChildForEventHandling(
       aura::Window* child,
@@ -184,9 +183,6 @@
   virtual void OnDragExited() OVERRIDE;
   virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
 
-  // Overridden from wm::CursorDelegate:
-  virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) OVERRIDE;
-
   // Overridden from NativeWidget:
   virtual ui::EventHandler* GetEventHandler() OVERRIDE;
 
diff --git a/ui/wm/core/compound_event_filter.cc b/ui/wm/core/compound_event_filter.cc
index 6efafea..edb7146 100644
--- a/ui/wm/core/compound_event_filter.cc
+++ b/ui/wm/core/compound_event_filter.cc
@@ -15,7 +15,6 @@
 #include "ui/base/hit_test.h"
 #include "ui/events/event.h"
 #include "ui/wm/public/activation_client.h"
-#include "ui/wm/public/cursor_delegate.h"
 #include "ui/wm/public/drag_drop_client.h"
 
 #if defined(OS_CHROMEOS) && defined(USE_X11)
@@ -159,9 +158,7 @@
   aura::client::CursorClient* cursor_client =
       aura::client::GetCursorClient(root_window);
   if (cursor_client) {
-    CursorDelegate* delegate = GetCursorDelegate(target);
-    gfx::NativeCursor cursor = delegate ?
-        delegate->GetCursorForPoint(event->location()) : gfx::kNullCursor;
+    gfx::NativeCursor cursor = target->GetCursor(event->location());
     if ((event->flags() & ui::EF_IS_NON_CLIENT)) {
       if (target->delegate()) {
         int window_component =
diff --git a/ui/wm/public/cursor_delegate.cc b/ui/wm/public/cursor_delegate.cc
deleted file mode 100644
index bea259d..0000000
--- a/ui/wm/public/cursor_delegate.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 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.
-
-#include "ui/wm/public/cursor_delegate.h"
-
-#include "ui/aura/window.h"
-#include "ui/aura/window_property.h"
-
-DECLARE_WINDOW_PROPERTY_TYPE(wm::CursorDelegate*);
-
-namespace wm {
-
-DEFINE_LOCAL_WINDOW_PROPERTY_KEY(CursorDelegate*, kCursorDelegateKey, NULL);
-
-void SetCursorDelegate(aura::Window* window, CursorDelegate* delegate) {
-  window->SetProperty(kCursorDelegateKey, delegate);
-}
-
-CursorDelegate* GetCursorDelegate(aura::Window* window) {
-  return window ? window->GetProperty(kCursorDelegateKey) : NULL;
-}
-
-}  // namespace wm
diff --git a/ui/wm/public/cursor_delegate.h b/ui/wm/public/cursor_delegate.h
deleted file mode 100644
index 1acf4d72..0000000
--- a/ui/wm/public/cursor_delegate.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 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 UI_WM_PUBLIC_CURSOR_DELEGATE_H_
-#define UI_WM_PUBLIC_CURSOR_DELEGATE_H_
-
-#include "ui/gfx/native_widget_types.h"
-#include "ui/wm/core/wm_core_export.h"
-
-namespace aura {
-class Window;
-}
-
-namespace gfx {
-class Point;
-}
-
-namespace wm {
-
-class WM_CORE_EXPORT CursorDelegate {
- public:
-  virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) = 0;
-
- protected:
-  virtual ~CursorDelegate() {}
-};
-
-WM_CORE_EXPORT void SetCursorDelegate(aura::Window* window,
-                                      CursorDelegate* delegate);
-WM_CORE_EXPORT CursorDelegate* GetCursorDelegate(aura::Window* window);
-
-}  // namespace wm
-
-#endif  // UI_WM_PUBLIC_CURSOR_DELEGATE_H_
diff --git a/ui/wm/wm.gyp b/ui/wm/wm.gyp
index cccadc0..a1960ec 100644
--- a/ui/wm/wm.gyp
+++ b/ui/wm/wm.gyp
@@ -85,8 +85,6 @@
         'core/wm_core_switches.h',
         'core/wm_state.cc',
         'core/wm_state.h',
-        'public/cursor_delegate.cc',
-        'public/cursor_delegate.h',
       ],
     },
     {