CPDFSDK_MediaActionHandler is unused.
authorTom Sepez <tsepez@chromium.org>
Tue, 1 Sep 2015 20:53:19 +0000 (13:53 -0700)
committerTom Sepez <tsepez@chromium.org>
Tue, 1 Sep 2015 20:53:19 +0000 (13:53 -0700)
It's never instantiated, and any pointers to it are always NULL.
Also kill an unused arg to CPDFSDK_ActionHandler ctor along the way.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1329583004 .

fpdfsdk/include/fsdk_actionhandler.h
fpdfsdk/src/fsdk_actionhandler.cpp
fpdfsdk/src/fsdk_mgr.cpp

index dfb7d48..09f13ac 100644 (file)
 #include "fsdk_baseform.h"
 
 class CFX_PtrList;
-class CPDFDoc_Environment;
 class CPDFSDK_Annot;
 class CPDFSDK_Document;
 class CPDF_Bookmark;
 class CPDF_Dictionary;
-class IFXJS_Runtime;
 
 class CPDFSDK_FormActionHandler {
  public:
@@ -31,21 +29,9 @@ class CPDFSDK_FormActionHandler {
                               CPDFSDK_Document* pDocument);
 };
 
-class CPDFSDK_MediaActionHandler {
- public:
-  FX_BOOL DoAction_Rendition(const CPDF_Action& action,
-                             CPDFSDK_Document* pDocument);
-  FX_BOOL DoAction_Sound(const CPDF_Action& action,
-                         CPDFSDK_Document* pDocument);
-  FX_BOOL DoAction_Movie(const CPDF_Action& action,
-                         CPDFSDK_Document* pDocument);
-};
-
 class CPDFSDK_ActionHandler {
  public:
-  CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi);
-
-  void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler);
+  CPDFSDK_ActionHandler();
 
   FX_BOOL DoAction_DocOpen(const CPDF_Action& action,
                            CPDFSDK_Document* pDocument);
@@ -131,7 +117,6 @@ class CPDFSDK_ActionHandler {
                             const CPDF_Action& action);
 
   nonstd::unique_ptr<CPDFSDK_FormActionHandler> m_pFormActionHandler;
-  CPDFSDK_MediaActionHandler* m_pMediaActionHandler;
 };
 
 #endif  // FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_
index a16c21a..a2a9eff 100644 (file)
@@ -9,27 +9,16 @@
 #include "../include/fsdk_actionhandler.h"
 #include "../include/javascript/IJavaScript.h"
 
-/* -------------------------- CBA_ActionHandler -------------------------- */
-
-CPDFSDK_ActionHandler::CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi)
-    : m_pFormActionHandler(new CPDFSDK_FormActionHandler),
-      m_pMediaActionHandler(NULL) {}
-
-void CPDFSDK_ActionHandler::SetMediaActionHandler(
-    CPDFSDK_MediaActionHandler* pHandler) {
-  ASSERT(pHandler != NULL);
-  ASSERT(m_pMediaActionHandler == NULL);
-  m_pMediaActionHandler = pHandler;
+CPDFSDK_ActionHandler::CPDFSDK_ActionHandler()
+    : m_pFormActionHandler(new CPDFSDK_FormActionHandler) {
 }
 
-// document open
 FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action,
                                                 CPDFSDK_Document* pDocument) {
   CFX_PtrList list;
   return ExecuteDocumentOpenAction(action, pDocument, list);
 }
 
-// document open
 FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(
     const CPDF_Action& JsAction,
     CFX_WideString csJSName,
@@ -453,14 +442,8 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action,
       DoAction_URI(pDocument, action);
       break;
     case CPDF_Action::Sound:
-      if (m_pMediaActionHandler) {
-        m_pMediaActionHandler->DoAction_Sound(action, pDocument);
-      }
       break;
     case CPDF_Action::Movie:
-      if (m_pMediaActionHandler) {
-        m_pMediaActionHandler->DoAction_Movie(action, pDocument);
-      }
       break;
     case CPDF_Action::Hide:
       if (m_pFormActionHandler) {
@@ -492,9 +475,6 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action,
       DoAction_SetOCGState(pDocument, action);
       break;
     case CPDF_Action::Rendition:
-      if (m_pMediaActionHandler) {
-        m_pMediaActionHandler->DoAction_Rendition(action, pDocument);
-      }
       break;
     case CPDF_Action::Trans:
       break;
@@ -766,21 +746,3 @@ FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(
 
   return FALSE;
 }
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(
-    const CPDF_Action& action,
-    CPDFSDK_Document* pDocument) {
-  return FALSE;
-}
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(
-    const CPDF_Action& action,
-    CPDFSDK_Document* pDocument) {
-  return FALSE;
-}
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(
-    const CPDF_Action& action,
-    CPDFSDK_Document* pDocument) {
-  return FALSE;
-}
index fa270cc..3eca559 100644 (file)
@@ -396,7 +396,7 @@ CPDFSDK_AnnotHandlerMgr* CPDFDoc_Environment::GetAnnotHandlerMgr() {
 
 CPDFSDK_ActionHandler* CPDFDoc_Environment::GetActionHander() {
   if (!m_pActionHandler)
-    m_pActionHandler = new CPDFSDK_ActionHandler(this);
+    m_pActionHandler = new CPDFSDK_ActionHandler();
   return m_pActionHandler;
 }