Remove mouse cursor capturer from the ScreenCapturer interface

Mouse can be captured using MouseCursorMonitor and all code in chromium
already uses it instead of ScreenCapturer.

R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31529004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7363 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn
index 2a1eedd..9067177 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -48,7 +48,6 @@
     "mouse_cursor_monitor.h",
     "mouse_cursor_monitor_mac.mm",
     "mouse_cursor_monitor_win.cc",
-    "mouse_cursor_shape.h",
     "screen_capture_frame_queue.cc",
     "screen_capture_frame_queue.h",
     "screen_capturer.cc",
diff --git a/webrtc/modules/desktop_capture/desktop_capture.gypi b/webrtc/modules/desktop_capture/desktop_capture.gypi
index df6c4bc..1b702f2 100644
--- a/webrtc/modules/desktop_capture/desktop_capture.gypi
+++ b/webrtc/modules/desktop_capture/desktop_capture.gypi
@@ -51,7 +51,6 @@
         "mouse_cursor_monitor_mac.mm",
         "mouse_cursor_monitor_win.cc",
         "mouse_cursor_monitor_x11.cc",
-        "mouse_cursor_shape.h",
         "screen_capture_frame_queue.cc",
         "screen_capture_frame_queue.h",
         "screen_capturer.cc",
diff --git a/webrtc/modules/desktop_capture/mouse_cursor_shape.h b/webrtc/modules/desktop_capture/mouse_cursor_shape.h
deleted file mode 100644
index e759cf2..0000000
--- a/webrtc/modules/desktop_capture/mouse_cursor_shape.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_SHAPE_H_
-#define WEBRTC_MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_SHAPE_H_
-
-#include <string>
-
-#include "webrtc/modules/desktop_capture/desktop_geometry.h"
-
-namespace webrtc {
-
-// Type used to return mouse cursor shape from video capturers.
-//
-// TODO(sergeyu): Remove this type and use MouseCursor instead.
-struct MouseCursorShape {
-  // Size of the cursor in screen pixels.
-  DesktopSize size;
-
-  // Coordinates of the cursor hotspot relative to upper-left corner.
-  DesktopVector hotspot;
-
-  // Cursor pixmap data in 32-bit BGRA format.
-  std::string data;
-};
-
-}  // namespace webrtc
-
-#endif  // WEBRTC_MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_SHAPE_H_
diff --git a/webrtc/modules/desktop_capture/screen_capturer.h b/webrtc/modules/desktop_capture/screen_capturer.h
index a8d40a7..ab074f1 100644
--- a/webrtc/modules/desktop_capture/screen_capturer.h
+++ b/webrtc/modules/desktop_capture/screen_capturer.h
@@ -21,7 +21,6 @@
 namespace webrtc {
 
 class DesktopCaptureOptions;
-struct MouseCursorShape;
 
 // Class used to capture video frames asynchronously.
 //
@@ -50,21 +49,6 @@
   };
   typedef std::vector<Screen> ScreenList;
 
-  // Provides callbacks used by the capturer to pass captured video frames and
-  // mouse cursor shapes to the processing pipeline.
-  //
-  // TODO(sergeyu): Move cursor shape capturing to a separate class because it's
-  // unrelated.
-  class MouseShapeObserver {
-   public:
-    // Called when the cursor shape has changed. Must take ownership of
-    // |cursor_shape|.
-    virtual void OnCursorShapeChanged(MouseCursorShape* cursor_shape) = 0;
-
-   protected:
-    virtual ~MouseShapeObserver() {}
-  };
-
   virtual ~ScreenCapturer() {}
 
   // Creates platform-specific capturer.
@@ -84,11 +68,6 @@
   static ScreenCapturer* CreateWithDisableAero(bool disable_aero);
 #endif  // defined(WEBRTC_WIN)
 
-  // Called at the beginning of a capturing session. |mouse_shape_observer| must
-  // remain valid until the capturer is destroyed.
-  virtual void SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) = 0;
-
   // Get the list of screens (not containing kFullDesktopScreenId). Returns
   // false in case of a failure.
   virtual bool GetScreenList(ScreenList* screens) = 0;
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
index effe7eb..d4200e2 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
@@ -28,7 +28,6 @@
 #include "webrtc/modules/desktop_capture/mac/desktop_configuration.h"
 #include "webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.h"
 #include "webrtc/modules/desktop_capture/mac/scoped_pixel_buffer_object.h"
-#include "webrtc/modules/desktop_capture/mouse_cursor_shape.h"
 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
 #include "webrtc/system_wrappers/interface/logging.h"
@@ -200,14 +199,10 @@
   virtual void Start(Callback* callback) OVERRIDE;
   virtual void Capture(const DesktopRegion& region) OVERRIDE;
   virtual void SetExcludedWindow(WindowId window) OVERRIDE;
-  virtual void SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) OVERRIDE;
   virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
   virtual bool SelectScreen(ScreenId id) OVERRIDE;
 
  private:
-  void CaptureCursor();
-
   void GlBlitFast(const DesktopFrame& frame,
                   const DesktopRegion& region);
   void GlBlitSlow(const DesktopFrame& frame);
@@ -239,7 +234,6 @@
   DesktopFrame* CreateFrame();
 
   Callback* callback_;
-  MouseShapeObserver* mouse_shape_observer_;
 
   CGLContextObj cgl_context_;
   ScopedPixelBufferObject pixel_buffer_object_;
@@ -264,9 +258,6 @@
   // recently captured screen.
   ScreenCapturerHelper helper_;
 
-  // The last cursor that we sent to the client.
-  MouseCursorShape last_cursor_;
-
   // Contains an invalid region from the previous capture.
   DesktopRegion last_invalid_region_;
 
@@ -318,7 +309,6 @@
 ScreenCapturerMac::ScreenCapturerMac(
     scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor)
     : callback_(NULL),
-      mouse_shape_observer_(NULL),
       cgl_context_(NULL),
       current_display_(0),
       dip_to_pixel_scale_(1.0f),
@@ -458,9 +448,6 @@
   // and accessing display structures.
   desktop_config_monitor_->Unlock();
 
-  // Capture the current cursor shape and notify |callback_| if it has changed.
-  CaptureCursor();
-
   new_frame->set_capture_time_ms(
       (TickTime::Now() - capture_start_time).Milliseconds());
   callback_->OnCaptureCompleted(new_frame);
@@ -470,13 +457,6 @@
   excluded_window_ = window;
 }
 
-void ScreenCapturerMac::SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) {
-  assert(!mouse_shape_observer_);
-  assert(mouse_shape_observer);
-  mouse_shape_observer_ = mouse_shape_observer;
-}
-
 bool ScreenCapturerMac::GetScreenList(ScreenList* screens) {
   assert(screens->size() == 0);
   if (rtc::GetOSVersionName() < rtc::kMacOSLion) {
@@ -518,61 +498,6 @@
   return true;
 }
 
-void ScreenCapturerMac::CaptureCursor() {
-  if (!mouse_shape_observer_)
-    return;
-
-  NSCursor* cursor = [NSCursor currentSystemCursor];
-  if (cursor == nil)
-    return;
-
-  NSImage* nsimage = [cursor image];
-  NSPoint hotspot = [cursor hotSpot];
-  NSSize size = [nsimage size];
-  CGImageRef image = [nsimage CGImageForProposedRect:NULL
-                                             context:nil
-                                               hints:nil];
-  if (image == nil)
-    return;
-
-  if (CGImageGetBitsPerPixel(image) != 32 ||
-      CGImageGetBytesPerRow(image) != (size.width * 4) ||
-      CGImageGetBitsPerComponent(image) != 8) {
-    return;
-  }
-
-  CGDataProviderRef provider = CGImageGetDataProvider(image);
-  CFDataRef image_data_ref = CGDataProviderCopyData(provider);
-  if (image_data_ref == NULL)
-    return;
-
-  const char* cursor_src_data =
-      reinterpret_cast<const char*>(CFDataGetBytePtr(image_data_ref));
-  int data_size = CFDataGetLength(image_data_ref);
-
-  // Create a MouseCursorShape that describes the cursor and pass it to
-  // the client.
-  scoped_ptr<MouseCursorShape> cursor_shape(new MouseCursorShape());
-  cursor_shape->size.set(size.width, size.height);
-  cursor_shape->hotspot.set(hotspot.x, hotspot.y);
-  cursor_shape->data.assign(cursor_src_data, cursor_src_data + data_size);
-
-  CFRelease(image_data_ref);
-
-  // Compare the current cursor with the last one we sent to the client. If
-  // they're the same, then don't bother sending the cursor again.
-  if (last_cursor_.size.equals(cursor_shape->size) &&
-      last_cursor_.hotspot.equals(cursor_shape->hotspot) &&
-      last_cursor_.data == cursor_shape->data) {
-    return;
-  }
-
-  // Record the last cursor image that we sent to the client.
-  last_cursor_ = *cursor_shape;
-
-  mouse_shape_observer_->OnCursorShapeChanged(cursor_shape.release());
-}
-
 void ScreenCapturerMac::GlBlitFast(const DesktopFrame& frame,
                                    const DesktopRegion& region) {
   // Clip to the size of our current screen.
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h b/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h
index aa0e808..373e66f 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h
+++ b/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h
@@ -12,7 +12,6 @@
 #define WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_MOCK_OBJECTS_H_
 
 #include "testing/gmock/include/gmock/gmock.h"
-#include "webrtc/modules/desktop_capture/mouse_cursor_shape.h"
 #include "webrtc/modules/desktop_capture/screen_capturer.h"
 
 namespace webrtc {
@@ -24,8 +23,6 @@
 
   MOCK_METHOD1(Start, void(Callback* callback));
   MOCK_METHOD1(Capture, void(const DesktopRegion& region));
-  MOCK_METHOD1(SetMouseShapeObserver, void(
-      MouseShapeObserver* mouse_shape_observer));
   MOCK_METHOD1(GetScreenList, bool(ScreenList* screens));
   MOCK_METHOD1(SelectScreen, bool(ScreenId id));
 
@@ -45,24 +42,6 @@
   DISALLOW_COPY_AND_ASSIGN(MockScreenCapturerCallback);
 };
 
-class MockMouseShapeObserver : public ScreenCapturer::MouseShapeObserver {
- public:
-  MockMouseShapeObserver() {}
-  virtual ~MockMouseShapeObserver() {}
-
-  void OnCursorShapeChanged(MouseCursorShape* cursor_shape) OVERRIDE {
-    OnCursorShapeChangedPtr(cursor_shape);
-    delete cursor_shape;
-  }
-
-  MOCK_METHOD1(OnCursorShapeChangedPtr,
-               void(MouseCursorShape* cursor_shape));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(MockMouseShapeObserver);
-};
-
-
 }  // namespace webrtc
 
 #endif  // WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_MOCK_OBJECTS_H_
diff --git a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
index 50ff7a2..1a4b9cf 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
@@ -37,7 +37,6 @@
 
  protected:
   scoped_ptr<ScreenCapturer> capturer_;
-  MockMouseShapeObserver mouse_observer_;
   MockScreenCapturerCallback callback_;
 };
 
@@ -69,7 +68,6 @@
 }
 
 TEST_F(ScreenCapturerTest, StartCapturer) {
-  capturer_->SetMouseShapeObserver(&mouse_observer_);
   capturer_->Start(&callback_);
 }
 
@@ -78,8 +76,6 @@
   DesktopFrame* frame = NULL;
   EXPECT_CALL(callback_, OnCaptureCompleted(_))
       .WillOnce(SaveArg<0>(&frame));
-  EXPECT_CALL(mouse_observer_, OnCursorShapeChangedPtr(_))
-      .Times(AnyNumber());
 
   EXPECT_CALL(callback_, CreateSharedMemory(_))
       .Times(AnyNumber())
@@ -112,8 +108,6 @@
   DesktopFrame* frame = NULL;
   EXPECT_CALL(callback_, OnCaptureCompleted(_))
       .WillOnce(SaveArg<0>(&frame));
-  EXPECT_CALL(mouse_observer_, OnCursorShapeChangedPtr(_))
-      .Times(AnyNumber());
 
   EXPECT_CALL(callback_, CreateSharedMemory(_))
       .Times(AnyNumber())
diff --git a/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
index 4d07d98..0064faa 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_x11.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
@@ -21,7 +21,6 @@
 #include "webrtc/modules/desktop_capture/desktop_capture_options.h"
 #include "webrtc/modules/desktop_capture/desktop_frame.h"
 #include "webrtc/modules/desktop_capture/differ.h"
-#include "webrtc/modules/desktop_capture/mouse_cursor_shape.h"
 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
 #include "webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h"
@@ -55,8 +54,6 @@
   virtual void Capture(const DesktopRegion& region) OVERRIDE;
 
   // ScreenCapturer interface.
-  virtual void SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) OVERRIDE;
   virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
   virtual bool SelectScreen(ScreenId id) OVERRIDE;
 
@@ -68,9 +65,6 @@
 
   void InitXDamage();
 
-  // Capture the cursor image and notify the delegate if it was captured.
-  void CaptureCursor();
-
   // Capture screen pixels to the current buffer in the queue. In the DAMAGE
   // case, the ScreenCapturerHelper already holds the list of invalid rectangles
   // from HandleXEvent(). In the non-DAMAGE case, this captures the
@@ -93,7 +87,6 @@
   DesktopCaptureOptions options_;
 
   Callback* callback_;
-  MouseShapeObserver* mouse_shape_observer_;
 
   // X11 graphics context.
   GC gc_;
@@ -133,7 +126,6 @@
 
 ScreenCapturerLinux::ScreenCapturerLinux()
     : callback_(NULL),
-      mouse_shape_observer_(NULL),
       gc_(NULL),
       root_window_(BadValue),
       has_xfixes_(false),
@@ -153,10 +145,6 @@
     options_.x_display()->RemoveEventHandler(
         damage_event_base_ + XDamageNotify, this);
   }
-  if (has_xfixes_) {
-    options_.x_display()->RemoveEventHandler(
-        xfixes_event_base_ + XFixesCursorNotify, this);
-  }
   DeinitXlib();
 }
 
@@ -196,14 +184,6 @@
     return false;
   }
 
-  if (has_xfixes_) {
-    // Register for changes to the cursor shape.
-    XFixesSelectCursorInput(display(), root_window_,
-                            XFixesDisplayCursorNotifyMask);
-    options_.x_display()->AddEventHandler(
-        xfixes_event_base_ + XFixesCursorNotify, this);
-  }
-
   if (options_.use_update_notifications()) {
     InitXDamage();
   }
@@ -304,14 +284,6 @@
   callback_->OnCaptureCompleted(result);
 }
 
-void ScreenCapturerLinux::SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) {
-  DCHECK(!mouse_shape_observer_);
-  DCHECK(mouse_shape_observer);
-
-  mouse_shape_observer_ = mouse_shape_observer;
-}
-
 bool ScreenCapturerLinux::GetScreenList(ScreenList* screens) {
   DCHECK(screens->size() == 0);
   // TODO(jiayl): implement screen enumeration.
@@ -337,50 +309,10 @@
   } else if (event.type == ConfigureNotify) {
     ScreenConfigurationChanged();
     return true;
-  } else if (has_xfixes_ &&
-             event.type == xfixes_event_base_ + XFixesCursorNotify) {
-    const XFixesCursorNotifyEvent* cursor_event =
-        reinterpret_cast<const XFixesCursorNotifyEvent*>(&event);
-    if (cursor_event->window == root_window_ &&
-        cursor_event->subtype == XFixesDisplayCursorNotify) {
-      CaptureCursor();
-    }
-    // Always return false for cursor notifications, because there might be
-    // other listeners for these for the same window.
-    return false;
   }
   return false;
 }
 
-void ScreenCapturerLinux::CaptureCursor() {
-  DCHECK(has_xfixes_);
-
-  XFixesCursorImage* img = XFixesGetCursorImage(display());
-  if (!img) {
-    return;
-  }
-
-  scoped_ptr<MouseCursorShape> cursor(new MouseCursorShape());
-  cursor->size = DesktopSize(img->width, img->height);
-  cursor->hotspot = DesktopVector(img->xhot, img->yhot);
-
-  int total_bytes = cursor->size.width ()* cursor->size.height() *
-      DesktopFrame::kBytesPerPixel;
-  cursor->data.resize(total_bytes);
-
-  // Xlib stores 32-bit data in longs, even if longs are 64-bits long.
-  unsigned long* src = img->pixels;
-  uint32_t* dst = reinterpret_cast<uint32_t*>(&*(cursor->data.begin()));
-  uint32_t* dst_end = dst + (img->width * img->height);
-  while (dst < dst_end) {
-    *dst++ = static_cast<uint32_t>(*src++);
-  }
-  XFree(img);
-
-  if (mouse_shape_observer_)
-    mouse_shape_observer_->OnCursorShapeChanged(cursor.release());
-}
-
 DesktopFrame* ScreenCapturerLinux::CaptureScreen() {
   DesktopFrame* frame = queue_.current_frame()->Share();
   assert(x_server_pixel_buffer_.window_size().equals(frame->size()));
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
index dc10ece..e6c0605 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
@@ -38,7 +38,6 @@
 
 ScreenCapturerWinGdi::ScreenCapturerWinGdi(const DesktopCaptureOptions& options)
     : callback_(NULL),
-      mouse_shape_observer_(NULL),
       current_screen_id_(kFullDesktopScreenId),
       desktop_dc_(NULL),
       memory_dc_(NULL),
@@ -131,18 +130,6 @@
   frame->set_capture_time_ms(
       (TickTime::Now() - capture_start_time).Milliseconds());
   callback_->OnCaptureCompleted(frame);
-
-  // Check for cursor shape update.
-  if (mouse_shape_observer_)
-    CaptureCursor();
-}
-
-void ScreenCapturerWinGdi::SetMouseShapeObserver(
-    MouseShapeObserver* mouse_shape_observer) {
-  assert(!mouse_shape_observer_);
-  assert(mouse_shape_observer);
-
-  mouse_shape_observer_ = mouse_shape_observer;
 }
 
 bool ScreenCapturerWinGdi::GetScreenList(ScreenList* screens) {
@@ -279,48 +266,4 @@
   return true;
 }
 
-void ScreenCapturerWinGdi::CaptureCursor() {
-  assert(mouse_shape_observer_);
-
-  CURSORINFO cursor_info;
-  cursor_info.cbSize = sizeof(CURSORINFO);
-  if (!GetCursorInfo(&cursor_info)) {
-    LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError();
-    return;
-  }
-
-  // Note that |cursor_info.hCursor| does not need to be freed.
-  scoped_ptr<MouseCursor> cursor_image(
-      CreateMouseCursorFromHCursor(desktop_dc_, cursor_info.hCursor));
-  if (!cursor_image.get())
-    return;
-
-  scoped_ptr<MouseCursorShape> cursor(new MouseCursorShape);
-  cursor->hotspot = cursor_image->hotspot();
-  cursor->size = cursor_image->image()->size();
-  uint8_t* current_row = cursor_image->image()->data();
-  for (int y = 0; y < cursor_image->image()->size().height(); ++y) {
-    cursor->data.append(current_row,
-                        current_row + cursor_image->image()->size().width() *
-                                        DesktopFrame::kBytesPerPixel);
-    current_row += cursor_image->image()->stride();
-  }
-
-  // Compare the current cursor with the last one we sent to the client. If
-  // they're the same, then don't bother sending the cursor again.
-  if (last_cursor_.size.equals(cursor->size) &&
-      last_cursor_.hotspot.equals(cursor->hotspot) &&
-      last_cursor_.data == cursor->data) {
-    return;
-  }
-
-  LOG(LS_VERBOSE) << "Sending updated cursor: " << cursor->size.width() << "x"
-                  << cursor->size.height();
-
-  // Record the last cursor image that we sent to the client.
-  last_cursor_ = *cursor;
-
-  mouse_shape_observer_->OnCursorShapeChanged(cursor.release());
-}
-
 }  // namespace webrtc
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
index 2db87d0..2d48182 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
@@ -15,7 +15,6 @@
 
 #include <windows.h>
 
-#include "webrtc/modules/desktop_capture/mouse_cursor_shape.h"
 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h"
@@ -24,7 +23,6 @@
 namespace webrtc {
 
 class Differ;
-class MouseShapeObserver;
 
 // ScreenCapturerWinGdi captures 32bit RGB using GDI.
 //
@@ -37,8 +35,6 @@
   // Overridden from ScreenCapturer:
   virtual void Start(Callback* callback) OVERRIDE;
   virtual void Capture(const DesktopRegion& region) OVERRIDE;
-  virtual void SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) OVERRIDE;
   virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
   virtual bool SelectScreen(ScreenId id) OVERRIDE;
 
@@ -56,7 +52,6 @@
   void CaptureCursor();
 
   Callback* callback_;
-  MouseShapeObserver* mouse_shape_observer_;
   ScreenId current_screen_id_;
   std::wstring current_device_key_;
 
@@ -64,11 +59,6 @@
   // recently captured screen.
   ScreenCapturerHelper helper_;
 
-  // Snapshot of the last cursor bitmap we sent to the client. This is used
-  // to diff against the current cursor so we only send a cursor-change
-  // message when the shape has changed.
-  MouseCursorShape last_cursor_;
-
   ScopedThreadDesktop desktop_;
 
   // GDI resources used for screen capture.
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
index 042cb93..e0c9199 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
@@ -166,11 +166,6 @@
   callback_->OnCaptureCompleted(frame);
 }
 
-void ScreenCapturerWinMagnifier::SetMouseShapeObserver(
-    MouseShapeObserver* mouse_shape_observer) {
-  assert(false);  // NOTREACHED();
-}
-
 bool ScreenCapturerWinMagnifier::GetScreenList(ScreenList* screens) {
   return webrtc::GetScreenList(screens);
 }
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
index b6d5590..11278dd 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
@@ -28,7 +28,6 @@
 class DesktopFrame;
 class DesktopRect;
 class Differ;
-class MouseShapeObserver;
 
 // Captures the screen using the Magnification API to support window exclusion.
 // Each capturer must run on a dedicated thread because it uses thread local
@@ -46,8 +45,6 @@
   // Overridden from ScreenCapturer:
   virtual void Start(Callback* callback) OVERRIDE;
   virtual void Capture(const DesktopRegion& region) OVERRIDE;
-  virtual void SetMouseShapeObserver(
-      MouseShapeObserver* mouse_shape_observer) OVERRIDE;
   virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
   virtual bool SelectScreen(ScreenId id) OVERRIDE;
   virtual void SetExcludedWindow(WindowId window) OVERRIDE;