Make deprecated OnMouseCursorPosition overload optional.

The only callers or non-trivial implementations of this that I could
find are in remoting/ in Chromium, which I plan on fixing once this
gets rolled.

Bug: chromium:1043325
Change-Id: Id5a33fc09bb066f979876b2a7dcbc3dc5c2d3dd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166560
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30310}
diff --git a/modules/desktop_capture/desktop_and_cursor_composer.cc b/modules/desktop_capture/desktop_and_cursor_composer.cc
index b668490..638372d 100644
--- a/modules/desktop_capture/desktop_and_cursor_composer.cc
+++ b/modules/desktop_capture/desktop_and_cursor_composer.cc
@@ -198,12 +198,6 @@
 }
 
 void DesktopAndCursorComposer::OnMouseCursorPosition(
-    MouseCursorMonitor::CursorState state,
-    const DesktopVector& position) {
-  RTC_NOTREACHED();
-}
-
-void DesktopAndCursorComposer::OnMouseCursorPosition(
     const DesktopVector& position) {
   cursor_position_ = position;
 }
diff --git a/modules/desktop_capture/desktop_and_cursor_composer.h b/modules/desktop_capture/desktop_and_cursor_composer.h
index 1381106..d4e5f8a 100644
--- a/modules/desktop_capture/desktop_and_cursor_composer.h
+++ b/modules/desktop_capture/desktop_and_cursor_composer.h
@@ -63,8 +63,6 @@
 
   // MouseCursorMonitor::Callback interface.
   void OnMouseCursor(MouseCursor* cursor) override;
-  void OnMouseCursorPosition(MouseCursorMonitor::CursorState state,
-                             const DesktopVector& position) override;
   void OnMouseCursorPosition(const DesktopVector& position) override;
 
   const std::unique_ptr<DesktopCapturer> desktop_capturer_;
diff --git a/modules/desktop_capture/mouse_cursor_monitor.h b/modules/desktop_capture/mouse_cursor_monitor.h
index 22fd629..43b75b3 100644
--- a/modules/desktop_capture/mouse_cursor_monitor.h
+++ b/modules/desktop_capture/mouse_cursor_monitor.h
@@ -54,7 +54,7 @@
     // relative to the |window| specified in the constructor.
     // Deprecated: use the following overload instead.
     virtual void OnMouseCursorPosition(CursorState state,
-                                       const DesktopVector& position) = 0;
+                                       const DesktopVector& position) {}
 
     // Called in response to Capture(). |position| indicates cursor absolute
     // position on the system in fullscreen coordinate, i.e. the top-left
@@ -62,7 +62,6 @@
     // The coordinates of the position is controlled by OS, but it's always
     // consistent with DesktopFrame.rect().top_left().
     // TODO(zijiehe): Ensure all implementations return the absolute position.
-    // TODO(zijiehe): Make this function pure virtual after Chromium changes.
     // TODO(zijiehe): Current this overload works correctly only when capturing
     // mouse cursor against fullscreen.
     virtual void OnMouseCursorPosition(const DesktopVector& position) {}
diff --git a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc
index 93ac0da..ee2dff3 100644
--- a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc
+++ b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc
@@ -34,11 +34,6 @@
     cursor_image_.reset(cursor_image);
   }
 
-  void OnMouseCursorPosition(MouseCursorMonitor::CursorState state,
-                             const DesktopVector& position) override {
-    RTC_NOTREACHED();
-  }
-
   void OnMouseCursorPosition(const DesktopVector& position) override {
     position_ = position;
     position_received_ = true;