Bug 1480637 - Remove nsIClipboardCommands; r=nika
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 02 Aug 2018 17:12:30 -0700
changeset 430496 e05eb5161a5d5ea3b722b99ed2f1318a67481de8
parent 430495 c629114f55f0c9120f58e4fb2747d4ac96464bef
child 430497 796b4331f06a3324b893b15ec28a5d8626440e42
push id34406
push userncsoregi@mozilla.com
push dateWed, 08 Aug 2018 09:58:58 +0000
treeherdermozilla-central@17116905bc07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1480637
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480637 - Remove nsIClipboardCommands; r=nika Summary: Unused interface that can be removed. MozReview-Commit-ID: GnHRXdtI4qe Test Plan: Try run Reviewers: nika Tags: #secure-revision Bug #: 1480637 Differential Revision: https://phabricator.services.mozilla.com/D2694
docshell/base/moz.build
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsIClipboardCommands.idl
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -32,17 +32,16 @@ with Files('nsIScrollObserver.*'):
     BUG_COMPONENT = ('Core', 'Panning and Zooming')
 
 DIRS += [
     'timeline',
 ]
 
 XPIDL_SOURCES += [
     'nsCDefaultURIFixup.idl',
-    'nsIClipboardCommands.idl',
     'nsIContentViewer.idl',
     'nsIContentViewerEdit.idl',
     'nsIDocShell.idl',
     'nsIDocShellTreeItem.idl',
     'nsIDocShellTreeOwner.idl',
     'nsIDocumentLoaderFactory.idl',
     'nsILoadContext.idl',
     'nsIPrivacyTransitionObserver.idl',
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -523,17 +523,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsITextScroll)
   NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIWebPageDescriptor)
   NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
   NS_INTERFACE_MAP_ENTRY(nsILoadContext)
   NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
-  NS_INTERFACE_MAP_ENTRY(nsIClipboardCommands)
   NS_INTERFACE_MAP_ENTRY(nsIDOMStorageManager)
   NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsINetworkInterceptController,
                                      mInterceptController)
   NS_INTERFACE_MAP_ENTRY(nsIDeprecationWarner)
 NS_INTERFACE_MAP_END_INHERITING(nsDocLoader)
 
 NS_IMETHODIMP
 nsDocShell::GetInterface(const nsIID& aIID, void** aSink)
@@ -13284,106 +13283,16 @@ nsDocShell::EnsureCommandHandler()
     if (NS_SUCCEEDED(rv)) {
       mCommandManager = do_QueryInterface(commandUpdater);
     }
   }
 
   return mCommandManager ? NS_OK : NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
-nsDocShell::CanCutSelection(bool* aResult)
-{
-  return IsCommandEnabled("cmd_cut", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CanCopySelection(bool* aResult)
-{
-  return IsCommandEnabled("cmd_copy", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CanCopyLinkLocation(bool* aResult)
-{
-  return IsCommandEnabled("cmd_copyLink", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CanCopyImageLocation(bool* aResult)
-{
-  return IsCommandEnabled("cmd_copyImageLocation", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CanCopyImageContents(bool* aResult)
-{
-  return IsCommandEnabled("cmd_copyImageContents", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CanPaste(bool* aResult)
-{
-  return IsCommandEnabled("cmd_paste", aResult);
-}
-
-NS_IMETHODIMP
-nsDocShell::CutSelection(void)
-{
-  return DoCommand("cmd_cut");
-}
-
-NS_IMETHODIMP
-nsDocShell::CopySelection(void)
-{
-  return DoCommand("cmd_copy");
-}
-
-NS_IMETHODIMP
-nsDocShell::CopyLinkLocation(void)
-{
-  return DoCommand("cmd_copyLink");
-}
-
-NS_IMETHODIMP
-nsDocShell::CopyImageLocation(void)
-{
-  return DoCommand("cmd_copyImageLocation");
-}
-
-NS_IMETHODIMP
-nsDocShell::CopyImageContents(void)
-{
-  return DoCommand("cmd_copyImageContents");
-}
-
-NS_IMETHODIMP
-nsDocShell::Paste(void)
-{
-  return DoCommand("cmd_paste");
-}
-
-NS_IMETHODIMP
-nsDocShell::SelectAll(void)
-{
-  return DoCommand("cmd_selectAll");
-}
-
-//
-// SelectNone
-//
-// Collapses the current selection, insertion point ends up at beginning
-// of previous selection.
-//
-NS_IMETHODIMP
-nsDocShell::SelectNone(void)
-{
-  return DoCommand("cmd_selectNone");
-}
-
 // link handling
 
 class OnLinkClickEvent : public Runnable
 {
 public:
   OnLinkClickEvent(nsDocShell* aHandler, nsIContent* aContent,
                    nsIURI* aURI,
                    const char16_t* aTargetSpec,
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -17,17 +17,16 @@
 
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 #include "mozilla/gfx/Matrix.h"
 #include "mozilla/dom/ChildSHistory.h"
 
 #include "nsIAuthPromptProvider.h"
 #include "nsIBaseWindow.h"
-#include "nsIClipboardCommands.h"
 #include "nsIDeprecationWarner.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDOMStorageManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsILinkHandler.h"
 #include "nsILoadContext.h"
 #include "nsILoadURIDelegate.h"
@@ -124,17 +123,16 @@ class nsDocShell final
   , public nsIScrollable
   , public nsITextScroll
   , public nsIRefreshURI
   , public nsIWebProgressListener
   , public nsIWebPageDescriptor
   , public nsIAuthPromptProvider
   , public nsILoadContext
   , public nsILinkHandler
-  , public nsIClipboardCommands
   , public nsIDOMStorageManager
   , public nsINetworkInterceptController
   , public nsIDeprecationWarner
   , public mozilla::SupportsWeakPtr<nsDocShell>
 {
 public:
   // Event type dispatched by RestorePresentation
   class RestorePresentationEvent : public mozilla::Runnable
@@ -173,17 +171,16 @@ public:
   NS_DECL_NSIBASEWINDOW
   NS_DECL_NSISCROLLABLE
   NS_DECL_NSITEXTSCROLL
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSIREFRESHURI
   NS_DECL_NSIWEBPAGEDESCRIPTOR
   NS_DECL_NSIAUTHPROMPTPROVIDER
-  NS_DECL_NSICLIPBOARDCOMMANDS
   NS_DECL_NSINETWORKINTERCEPTCONTROLLER
   NS_DECL_NSIDEPRECATIONWARNER
 
   NS_FORWARD_SAFE_NSIDOMSTORAGEMANAGER(TopSessionStorageManager())
 
   // Need to implement (and forward) nsISecurityEventSink, because
   // nsIWebProgressListener has methods with identical names...
   NS_FORWARD_NSISECURITYEVENTSINK(nsDocLoader::)
deleted file mode 100644
--- a/docshell/base/nsIClipboardCommands.idl
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/**
- * An interface for embedding clients who wish to interact with
- * the system-wide OS clipboard. Mozilla does not use a private
- * clipboard, instead it places its data directly onto the system 
- * clipboard. The webshell implements this interface.
- */
-
-[scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)]
-interface nsIClipboardCommands : nsISupports {
-
-  /**
-   * Returns whether there is a selection and it is not read-only.
-   *
-   * @return <code>true</code> if the current selection can be cut,
-   *          <code>false</code> otherwise.
-   */
-  boolean canCutSelection();
-
-  /**
-   * Returns whether there is a selection and it is copyable.
-   *
-   * @return <code>true</code> if there is a selection,
-   *          <code>false</code> otherwise.
-   */
-  boolean canCopySelection();
-
-  /**
-   * Returns whether we can copy a link location.
-   *
-   * @return <code>true</code> if a link is selected,
-   *           <code>false</code> otherwise.
-   */
-  boolean canCopyLinkLocation();
-
-  /**
-   * Returns whether we can copy an image location.
-   *
-   * @return <code>true</code> if an image is selected,
-              <code>false</code> otherwise.
-   */
-  boolean canCopyImageLocation();
-
-  /**
-   * Returns whether we can copy an image's contents.
-   *
-   * @return <code>true</code> if an image is selected,
-   *          <code>false</code> otherwise
-   */
-  boolean canCopyImageContents();
-
-  /**
-   * Returns whether the current contents of the clipboard can be
-   * pasted and if the current selection is not read-only.
-   *
-   * @return <code>true</code> there is data to paste on the clipboard
-   *          and the current selection is not read-only,
-   *          <code>false</code> otherwise
-   */
-  boolean canPaste();
-
-  /**
-   * Cut the current selection onto the clipboard.
-   */
-  void cutSelection();
-
-  /**
-   * Copy the current selection onto the clipboard.
-   */
-  void copySelection();
-
-  /**
-   * Copy the link location of the current selection (e.g.,
-   * the |href| attribute of a selected |a| tag).
-   */
-  void copyLinkLocation();
-
-  /**
-   * Copy the location of the selected image.
-   */
-  void copyImageLocation();
-
-  /**
-   * Copy the contents of the selected image.
-   */
-  void copyImageContents();
-
-  /**
-   * Paste the contents of the clipboard into the current selection.
-   */
-  void paste();
-
-  /**
-   * Select the entire contents.
-   */
-  void selectAll();
-
-  /**
-   * Clear the current selection (if any). Insertion point ends up
-   * at beginning of current selection.
-   */
-  void selectNone();
-
-};