Bug 1387802 - Remove [deprecated] methods from nsITaskbarPreviewController. r?jimm draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sun, 06 Aug 2017 13:35:02 +0900
changeset 641160 94d1c577e43a40b873f47ba9324060a8a99f0031
parent 641159 a71bace942d0c7b17107146969919160e36b4422
child 641163 f2d9bb5ca48a6da7876a69637955ba9c59af4e2e
push id72463
push userVYV03354@nifty.ne.jp
push dateSun, 06 Aug 2017 04:36:19 +0000
reviewersjimm
bugs1387802
milestone57.0a1
Bug 1387802 - Remove [deprecated] methods from nsITaskbarPreviewController. r?jimm MozReview-Commit-ID: 25cdKHqVLSh
widget/nsITaskbarPreviewController.idl
widget/nsITaskbarWindowPreview.idl
widget/tests/taskbar_previews.xul
widget/windows/WinTaskbar.cpp
--- a/widget/nsITaskbarPreviewController.idl
+++ b/widget/nsITaskbarPreviewController.idl
@@ -32,52 +32,43 @@ interface nsITaskbarPreviewCallback : ns
  * the interface the controller is attached to, only certain methods/attributes
  * are required to be implemented.
  */
 [scriptable, uuid(8b427646-e446-4941-ae0b-c1122a173a68)]
 interface nsITaskbarPreviewController : nsISupports
 {
   /**
    * The width of the preview image. This value is allowed to change at any
-   * time. See drawPreview for more information.
+   * time. See requestPreview for more information.
    */
   readonly attribute unsigned long width;
 
   /**
    * The height of the preview image. This value is allowed to change at any
-   * time.  See drawPreview for more information.
+   * time.  See requestPreview for more information.
    */
   readonly attribute unsigned long height;
 
   /**
    * The aspect ratio of the thumbnail - this does not need to match the ratio
    * of the preview. This value is allowed to change at any time. See
-   * drawThumbnail for more information.
+   * requestThumbnail for more information.
    */
   readonly attribute float thumbnailAspectRatio;
 
-  [deprecated]
-  boolean drawPreview(in nsISupports ctx);
-
-  [deprecated]
-  boolean drawThumbnail(in nsISupports ctx, in unsigned long width, in unsigned long height);
-
   /**
    * Invoked by nsITaskbarPreview when it needs to render the preview.
    *
    * @param aCallback Async callback the controller should invoke once
    * the thumbnail is rendered. aCallback receives as its only parameter
    * a canvas containing the preview image.
    */
   void requestPreview(in nsITaskbarPreviewCallback aCallback);
 
   /**
-   * An asynchronous version of drawPreview and drawThumbnail apis
-   * implemented in nsITaskbarPreviewController.
-   *
    * Note: it is guaranteed that width/height == thumbnailAspectRatio
    * (modulo rounding errors)
    *
    * Also note that the context is not attached to a canvas element.
    *
    * @param aCallback Async callback the controller should invoke once
    * the thumbnail is rendered. aCallback receives as its only parameter
    * a canvas containing the thumbnail image. Canvas dimensions should
--- a/widget/nsITaskbarWindowPreview.idl
+++ b/widget/nsITaskbarWindowPreview.idl
@@ -15,18 +15,18 @@ interface nsITaskbarPreviewButton;
  * default, Windows implements much of the behavior for applications by
  * default. The primary purpose of this interface is to allow Gecko
  * applications to take control over parts of the preview. Some parts are not
  * controlled through this interface: the title and icon of the preview match
  * the title and icon of the window always.
  *
  * By default, Windows takes care of drawing the thumbnail and preview for the
  * application however if enableCustomDrawing is set to true, then the
- * controller will start to receive drawPreview and drawThumbnail calls as well
- * as reads on the thumbnailAspectRatio, width and height properties.
+ * controller will start to receive requestPreview and requestThumbnail calls
+ * as well as reads on the thumbnailAspectRatio, width and height properties.
  *
  * By default, nsITaskbarWindowPreviews are visible. When made invisible, the
  * window disappears from the list of windows in the taskbar for the
  * application.
  *
  * If the window has any visible nsITaskbarTabPreviews, then the
  * nsITaskbarWindowPreview for the corresponding window is automatically
  * hidden. This is not reflected in the visible property. Note that other parts
--- a/widget/tests/taskbar_previews.xul
+++ b/widget/tests/taskbar_previews.xul
@@ -45,18 +45,16 @@
     function loaded()
     {
       if (!taskbar.available)
         SimpleTest.finish();
       let controller = {
         width: 400,
         height: 400,
         thumbnailAspectRatio: 1.0,
-        drawThumbnail: function () { return false; },
-        drawPreview: function () { return false; },
         get wrappedJSObject() { return this; }
       }
       // HACK from mconnor:
       var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
       let win = wm.getMostRecentWindow("navigator:browser");
       let docShell = win.gBrowser.docShell;
 
       let winPreview = taskbar.getTaskbarWindowPreview(docShell);
--- a/widget/windows/WinTaskbar.cpp
+++ b/widget/windows/WinTaskbar.cpp
@@ -138,30 +138,16 @@ DefaultController::GetThumbnailAspectRat
   GetHeight(&height);
   if (!height)
     height = 1;
 
   *aThumbnailAspectRatio = width/float(height);
   return NS_OK;
 }
 
-// deprecated
-NS_IMETHODIMP
-DefaultController::DrawPreview(nsISupports *ctx, bool *rDrawFrame) {
-  *rDrawFrame = true;
-  return NS_ERROR_UNEXPECTED;
-}
-
-// deprecated
-NS_IMETHODIMP
-DefaultController::DrawThumbnail(nsISupports *ctx, uint32_t width, uint32_t height, bool *rDrawFrame) {
-  *rDrawFrame = false;
-  return NS_ERROR_UNEXPECTED;
-}
-
 NS_IMETHODIMP
 DefaultController::RequestThumbnail(nsITaskbarPreviewCallback *aCallback, uint32_t width, uint32_t height) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DefaultController::RequestPreview(nsITaskbarPreviewCallback *aCallback) {
   return NS_OK;