Bug 895274 part.163 Rename NS_CONTENT_COMMAND_CUT to eContentCommandCut r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 11 Sep 2015 01:59:52 +0900
changeset 292023 54ac42eda76f6f66400846dd5a32e92b827ff389
parent 292022 667d75050a9411dba70607df4437cba134753501
child 292024 1c4f895797d85ea7853977809150c656ac9d807b
push id5285
push usercmanchester@mozilla.com
push dateThu, 10 Sep 2015 19:28:06 +0000
reviewerssmaug
bugs895274
milestone43.0a1
Bug 895274 part.163 Rename NS_CONTENT_COMMAND_CUT to eContentCommandCut r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/EventStateManager.cpp
widget/EventMessageList.h
widget/gtk/nsWindow.cpp
widget/qt/nsWindow.cpp
widget/qt/nsWindow.h
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2051,17 +2051,17 @@ nsDOMWindowUtils::SendContentCommandEven
 
   // get the widget to send the event to
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget)
     return NS_ERROR_FAILURE;
 
   EventMessage msg;
   if (aType.EqualsLiteral("cut"))
-    msg = NS_CONTENT_COMMAND_CUT;
+    msg = eContentCommandCut;
   else if (aType.EqualsLiteral("copy"))
     msg = NS_CONTENT_COMMAND_COPY;
   else if (aType.EqualsLiteral("paste"))
     msg = NS_CONTENT_COMMAND_PASTE;
   else if (aType.EqualsLiteral("delete"))
     msg = NS_CONTENT_COMMAND_DELETE;
   else if (aType.EqualsLiteral("undo"))
     msg = NS_CONTENT_COMMAND_UNDO;
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -742,17 +742,17 @@ EventStateManager::PreHandleEvent(nsPres
       DeltaAccumulator::GetInstance()->
         InitLineOrPageDelta(aTargetFrame, this, wheelEvent);
     }
     break;
   case eSetSelection:
     IMEStateManager::HandleSelectionEvent(aPresContext, GetFocusedContent(),
                                           aEvent->AsSelectionEvent());
     break;
-  case NS_CONTENT_COMMAND_CUT:
+  case eContentCommandCut:
   case NS_CONTENT_COMMAND_COPY:
   case NS_CONTENT_COMMAND_PASTE:
   case NS_CONTENT_COMMAND_DELETE:
   case NS_CONTENT_COMMAND_UNDO:
   case NS_CONTENT_COMMAND_REDO:
   case eContentCommandPasteTransferable:
     DoContentCommandEvent(aEvent->AsContentCommandEvent());
     break;
@@ -5032,17 +5032,17 @@ EventStateManager::DoContentCommandEvent
   NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
   nsCOMPtr<nsPIDOMWindow> window(mDocument->GetWindow());
   NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
   NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
   const char* cmd;
   switch (aEvent->mMessage) {
-    case NS_CONTENT_COMMAND_CUT:
+    case eContentCommandCut:
       cmd = "cmd_cut";
       break;
     case NS_CONTENT_COMMAND_COPY:
       cmd = "cmd_copy";
       break;
     case NS_CONTENT_COMMAND_PASTE:
       cmd = "cmd_paste";
       break;
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -295,17 +295,17 @@ NS_EVENT_MESSAGE(ePluginInputEvent,     
 
 // Events to manipulate selection (WidgetSelectionEvent)
 NS_EVENT_MESSAGE(eSelectionEventFirst,  3700)
 // Clear any previous selection and set the given range as the selection
 NS_EVENT_MESSAGE(eSetSelection,         eSelectionEventFirst)
 
 // Events of commands for the contents
 NS_EVENT_MESSAGE(eContentCommandEventFirst,        3800)
-NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_CUT,           eContentCommandEventFirst)
+NS_EVENT_MESSAGE(eContentCommandCut,               eContentCommandEventFirst)
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_COPY,          eContentCommandEventFirst + 1)
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_PASTE,         eContentCommandEventFirst + 2)
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_DELETE,        eContentCommandEventFirst + 3)
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_UNDO,          eContentCommandEventFirst + 4)
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_REDO,          eContentCommandEventFirst + 5)
 NS_EVENT_MESSAGE(eContentCommandPasteTransferable, eContentCommandEventFirst + 6)
 // NS_CONTENT_COMMAND_SCROLL scrolls the nearest scrollable element to the
 // currently focused content or latest DOM selection. This would normally be
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3035,17 +3035,17 @@ nsWindow::OnKeyPressEvent(GdkEventKey *a
             return DispatchCommandEvent(nsGkAtoms::Bookmarks);
         case XF86XK_HomePage:
             return DispatchCommandEvent(nsGkAtoms::Home);
         case XF86XK_Copy:
         case GDK_F16:  // F16, F20, F18, F14 are old keysyms for Copy Cut Paste Undo
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_COPY);
         case XF86XK_Cut:
         case GDK_F20:
-            return DispatchContentCommandEvent(NS_CONTENT_COMMAND_CUT);
+            return DispatchContentCommandEvent(eContentCommandCut);
         case XF86XK_Paste:
         case GDK_F18:
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_PASTE);
         case GDK_Redo:
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_REDO);
         case GDK_Undo:
         case GDK_F14:
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_UNDO);
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1200,17 +1200,17 @@ nsWindow::keyPressEvent(QKeyEvent* aEven
             return DispatchCommandEvent(nsGkAtoms::Bookmarks);
         case Qt::Key_HomePage:
             return DispatchCommandEvent(nsGkAtoms::Home);
         case Qt::Key_Copy:
         case Qt::Key_F16: // F16, F20, F18, F14 are old keysyms for Copy Cut Paste Undo
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_COPY);
         case Qt::Key_Cut:
         case Qt::Key_F20:
-            return DispatchContentCommandEvent(NS_CONTENT_COMMAND_CUT);
+            return DispatchContentCommandEvent(eContentCommandCut);
         case Qt::Key_Paste:
         case Qt::Key_F18:
         case Qt::Key_F9:
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_PASTE);
         case Qt::Key_F14:
             return DispatchContentCommandEvent(NS_CONTENT_COMMAND_UNDO);
     }
 
@@ -1660,17 +1660,17 @@ nsWindow::DispatchCommandEvent(nsIAtom* 
 
     nsEventStatus status;
     DispatchEvent(&event, status);
 
     return status;
 }
 
 nsEventStatus
-nsWindow::DispatchContentCommandEvent(int32_t aMsg)
+nsWindow::DispatchContentCommandEvent(EventMessage aMsg)
 {
     WidgetContentCommandEvent event(true, aMsg, this);
 
     nsEventStatus status;
     DispatchEvent(&event, status);
 
     return status;
 }
--- a/widget/qt/nsWindow.h
+++ b/widget/qt/nsWindow.h
@@ -254,17 +254,17 @@ private:
     } MozCachedMoveEvent;
 
     bool               CheckForRollup(double aMouseX, double aMouseY, bool aIsWheel);
     void*              SetupPluginPort(void);
     nsresult           SetWindowIconList(const nsTArray<nsCString> &aIconList);
     void               SetDefaultIcon(void);
 
     nsEventStatus      DispatchCommandEvent(nsIAtom* aCommand);
-    nsEventStatus      DispatchContentCommandEvent(int32_t aMsg);
+    nsEventStatus      DispatchContentCommandEvent(mozilla::EventMessage aMsg);
     void               SetSoftwareKeyboardState(bool aOpen, const InputContextAction& aAction);
     void               ClearCachedResources();
 
     uint32_t           mActivatePending : 1;
     int32_t            mSizeState;
 
     bool         mIsTransparent;
 
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1352,17 +1352,17 @@ NativeKey::HandleAppCommandMessage() con
         consumed = DispatchCommandEvent(appCommand);
         break;
 
       // Use content command for following commands:
       case APPCOMMAND_COPY:
         contentCommandMessage = NS_CONTENT_COMMAND_COPY;
         break;
       case APPCOMMAND_CUT:
-        contentCommandMessage = NS_CONTENT_COMMAND_CUT;
+        contentCommandMessage = eContentCommandCut;
         break;
       case APPCOMMAND_PASTE:
         contentCommandMessage = NS_CONTENT_COMMAND_PASTE;
         break;
       case APPCOMMAND_REDO:
         contentCommandMessage = NS_CONTENT_COMMAND_REDO;
         break;
       case APPCOMMAND_UNDO:
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5651,17 +5651,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       WidgetContentCommandEvent command(true, NS_CONTENT_COMMAND_DELETE, this);
       DispatchWindowEvent(&command);
       result = true;
     }
     break;
 
     case WM_CUT:
     {
-      WidgetContentCommandEvent command(true, NS_CONTENT_COMMAND_CUT, this);
+      WidgetContentCommandEvent command(true, eContentCommandCut, this);
       DispatchWindowEvent(&command);
       result = true;
     }
     break;
 
     case WM_COPY:
     {
       WidgetContentCommandEvent command(true, NS_CONTENT_COMMAND_COPY, this);