Bug 1309397 - Remove nsIPrintOptions::ShowPrintSetupDialog. r=vlad, f=myk
authorJonathan Watt <jwatt@jwatt.org>
Tue, 11 Oct 2016 16:32:57 +0100
changeset 319878 da1c0184e9f51860b8ac0b75c78bb30ddeed473c
parent 319877 a8c8bb56737d5f5407d80c731bfe70fa3cba7f77
child 319879 04ee6f23fb6f13061acad21a0e57b1a0f7664615
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs1309397
milestone52.0a1
Bug 1309397 - Remove nsIPrintOptions::ShowPrintSetupDialog. r=vlad, f=myk
widget/nsIPrintOptions.idl
widget/nsPrintOptionsImpl.cpp
--- a/widget/nsIPrintOptions.idl
+++ b/widget/nsIPrintOptions.idl
@@ -14,20 +14,16 @@ interface nsIStringEnumerator;
  * Do not attempt to freeze this API - it still needs lots of work. Consult
  * John Keiser <jkeiser@netscape.com> and Roland Mainz
  * <roland.mainz@informatik.med.uni-giessen.de> for futher details.
  */
 [scriptable, uuid(2ac74034-700e-40fd-8059-81d33223af58)]
 
 interface nsIPrintOptions : nsISupports
 {
-  /**
-   * Show Native Print Options dialog, this may not be supported on all platforms
-   */
-  void ShowPrintSetupDialog(in nsIPrintSettings aThePrintSettings);
 };
 
 [scriptable, uuid(5e738fff-404c-4c94-9189-e8f2cce93e94)]
 
 interface nsIPrinterEnumerator : nsISupports
 {
   /**
    * The name of the system default printer. This name should also be
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -325,56 +325,16 @@ nsPrintOptions::DeserializeToPrintSettin
   settings->SetIsInitializedFromPrefs(data.isInitializedFromPrefs());
 
   settings->SetPrintOptionsBits(data.optionFlags());
 
   return NS_OK;
 }
 
 
-NS_IMETHODIMP
-nsPrintOptions::ShowPrintSetupDialog(nsIPrintSettings *aPS)
-{
-  NS_ENSURE_ARG_POINTER(aPS);
-  nsresult rv;
-
-  // create a nsIArray of the parameters
-  // being passed to the window
-  nsCOMPtr<nsIMutableArray> array = nsArray::Create();
-
-  nsCOMPtr<nsISupports> psSupports = do_QueryInterface(aPS);
-  NS_ASSERTION(psSupports, "PrintSettings must be a supports");
-  array->AppendElement(psSupports, /*weak =*/ false);
-
-  nsCOMPtr<nsIDialogParamBlock> ioParamBlock =
-      do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  ioParamBlock->SetInt(0, 0);
-
-  nsCOMPtr<nsISupports> blkSupps = do_QueryInterface(ioParamBlock);
-  NS_ASSERTION(blkSupps, "IOBlk must be a supports");
-  array->AppendElement(blkSupps, /*weak =*/ false);
-
-  nsCOMPtr<nsIWindowWatcher> wwatch =
-      do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<mozIDOMWindowProxy> parent;
-  wwatch->GetActiveWindow(getter_AddRefs(parent));
-  // null |parent| is non-fatal
-
-  nsCOMPtr<mozIDOMWindowProxy> newWindow;
-
-  return wwatch->OpenWindow(parent,
-                            "chrome://global/content/printPageSetup.xul",
-                            "_blank","chrome,modal,centerscreen", array,
-                            getter_AddRefs(newWindow));
-}
-
 /** ---------------------------------------------------
  *  Helper function - Creates the "prefix" for the pref
  *  It is either "print."
  *  or "print.printer_<print name>."
  */
 const char*
 nsPrintOptions::GetPrefName(const char * aPrefName,
                             const nsAString& aPrinterName)