Bug 895274 part.168 Rename NS_CONTENT_COMMAND_REDO to eContentCommandRedo r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 11 Sep 2015 01:59:53 +0900
changeset 296122 29bac9c0a25ab19f1d46e0304d262604c815c4e8
parent 296121 5863be1170c9bffe100db5bc150cba567a4f97e7
child 296123 6942dd64d65e89cecab991e36c82d15e2d9c83e7
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.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 895274 part.168 Rename NS_CONTENT_COMMAND_REDO to eContentCommandRedo r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/EventStateManager.cpp
widget/EventMessageList.h
widget/gtk/nsWindow.cpp
widget/qt/nsWindow.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2050,32 +2050,33 @@ nsDOMWindowUtils::SendContentCommandEven
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
 
   // get the widget to send the event to
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget)
     return NS_ERROR_FAILURE;
 
   EventMessage msg;
-  if (aType.EqualsLiteral("cut"))
+  if (aType.EqualsLiteral("cut")) {
     msg = eContentCommandCut;
-  else if (aType.EqualsLiteral("copy"))
+  } else if (aType.EqualsLiteral("copy")) {
     msg = eContentCommandCopy;
-  else if (aType.EqualsLiteral("paste"))
+  } else if (aType.EqualsLiteral("paste")) {
     msg = eContentCommandPaste;
-  else if (aType.EqualsLiteral("delete"))
+  } else if (aType.EqualsLiteral("delete")) {
     msg = eContentCommandDelete;
-  else if (aType.EqualsLiteral("undo"))
+  } else if (aType.EqualsLiteral("undo")) {
     msg = eContentCommandUndo;
-  else if (aType.EqualsLiteral("redo"))
-    msg = NS_CONTENT_COMMAND_REDO;
-  else if (aType.EqualsLiteral("pasteTransferable"))
+  } else if (aType.EqualsLiteral("redo")) {
+    msg = eContentCommandRedo;
+  } else if (aType.EqualsLiteral("pasteTransferable")) {
     msg = eContentCommandPasteTransferable;
-  else
+  } else {
     return NS_ERROR_FAILURE;
+  }
 
   WidgetContentCommandEvent event(true, msg, widget);
   if (msg == eContentCommandPasteTransferable) {
     event.mTransferable = aTransferable;
   }
 
   nsEventStatus status;
   return widget->DispatchEvent(&event, status);
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -747,17 +747,17 @@ EventStateManager::PreHandleEvent(nsPres
     IMEStateManager::HandleSelectionEvent(aPresContext, GetFocusedContent(),
                                           aEvent->AsSelectionEvent());
     break;
   case eContentCommandCut:
   case eContentCommandCopy:
   case eContentCommandPaste:
   case eContentCommandDelete:
   case eContentCommandUndo:
-  case NS_CONTENT_COMMAND_REDO:
+  case eContentCommandRedo:
   case eContentCommandPasteTransferable:
     DoContentCommandEvent(aEvent->AsContentCommandEvent());
     break;
   case NS_CONTENT_COMMAND_SCROLL:
     {
       DoContentCommandScrollEvent(aEvent->AsContentCommandEvent());
     }
     break;
@@ -5047,17 +5047,17 @@ EventStateManager::DoContentCommandEvent
       cmd = "cmd_paste";
       break;
     case eContentCommandDelete:
       cmd = "cmd_delete";
       break;
     case eContentCommandUndo:
       cmd = "cmd_undo";
       break;
-    case NS_CONTENT_COMMAND_REDO:
+    case eContentCommandRedo:
       cmd = "cmd_redo";
       break;
     case eContentCommandPasteTransferable:
       cmd = "cmd_pasteTransferable";
       break;
     default:
       return NS_ERROR_NOT_IMPLEMENTED;
   }
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -300,17 +300,17 @@ NS_EVENT_MESSAGE(eSetSelection,         
 
 // Events of commands for the contents
 NS_EVENT_MESSAGE(eContentCommandEventFirst,        3800)
 NS_EVENT_MESSAGE(eContentCommandCut,               eContentCommandEventFirst)
 NS_EVENT_MESSAGE(eContentCommandCopy,              eContentCommandEventFirst + 1)
 NS_EVENT_MESSAGE(eContentCommandPaste,             eContentCommandEventFirst + 2)
 NS_EVENT_MESSAGE(eContentCommandDelete,            eContentCommandEventFirst + 3)
 NS_EVENT_MESSAGE(eContentCommandUndo,              eContentCommandEventFirst + 4)
-NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_REDO,          eContentCommandEventFirst + 5)
+NS_EVENT_MESSAGE(eContentCommandRedo,              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
 // the same element scrolled by keyboard scroll commands, except that this event
 // will scroll an element scrollable in either direction.  I.e., if the nearest
 // scrollable ancestor element can only be scrolled vertically, and horizontal
 // scrolling is requested using this event, no scrolling will occur.
 NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_SCROLL,        eContentCommandEventFirst + 7)
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3040,17 +3040,17 @@ nsWindow::OnKeyPressEvent(GdkEventKey *a
             return DispatchContentCommandEvent(eContentCommandCopy);
         case XF86XK_Cut:
         case GDK_F20:
             return DispatchContentCommandEvent(eContentCommandCut);
         case XF86XK_Paste:
         case GDK_F18:
             return DispatchContentCommandEvent(eContentCommandPaste);
         case GDK_Redo:
-            return DispatchContentCommandEvent(NS_CONTENT_COMMAND_REDO);
+            return DispatchContentCommandEvent(eContentCommandRedo);
         case GDK_Undo:
         case GDK_F14:
             return DispatchContentCommandEvent(eContentCommandUndo);
     }
 #endif /* ! AIX */
 #endif /* MOZ_X11 */
 
     WidgetKeyboardEvent event(true, eKeyPress, this);
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1211,17 +1211,17 @@ nsWindow::keyPressEvent(QKeyEvent* aEven
         case Qt::Key_F9:
             return DispatchContentCommandEvent(eContentCommandPaste);
         case Qt::Key_F14:
             return DispatchContentCommandEvent(eContentCommandUndo);
     }
 
     // Qt::Key_Redo and Qt::Key_Undo are not available yet.
     if (aEvent->nativeVirtualKey() == 0xff66) {
-        return DispatchContentCommandEvent(NS_CONTENT_COMMAND_REDO);
+        return DispatchContentCommandEvent(eContentCommandRedo);
     }
     if (aEvent->nativeVirtualKey() == 0xff65) {
         return DispatchContentCommandEvent(eContentCommandUndo);
     }
 
     WidgetKeyboardEvent event(true, eKeyPress, this);
     InitKeyEvent(event, aEvent);
     // Seend the key press event
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1358,17 +1358,17 @@ NativeKey::HandleAppCommandMessage() con
         break;
       case APPCOMMAND_CUT:
         contentCommandMessage = eContentCommandCut;
         break;
       case APPCOMMAND_PASTE:
         contentCommandMessage = eContentCommandPaste;
         break;
       case APPCOMMAND_REDO:
-        contentCommandMessage = NS_CONTENT_COMMAND_REDO;
+        contentCommandMessage = eContentCommandRedo;
         break;
       case APPCOMMAND_UNDO:
         contentCommandMessage = eContentCommandUndo;
         break;
     }
 
     if (contentCommandMessage) {
       WidgetContentCommandEvent contentCommandEvent(true, contentCommandMessage,
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5684,17 +5684,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       DispatchWindowEvent(&command);
       *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled);
       result = true;
     }
     break;
 
     case EM_REDO:
     {
-      WidgetContentCommandEvent command(true, NS_CONTENT_COMMAND_REDO, this);
+      WidgetContentCommandEvent command(true, eContentCommandRedo, this);
       DispatchWindowEvent(&command);
       *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled);
       result = true;
     }
     break;
 
     case EM_CANPASTE:
     {
@@ -5716,18 +5716,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       DispatchWindowEvent(&command);
       *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled);
       result = true;
     }
     break;
 
     case EM_CANREDO:
     {
-      WidgetContentCommandEvent command(true, NS_CONTENT_COMMAND_REDO,
-                                        this, true);
+      WidgetContentCommandEvent command(true, eContentCommandRedo, this, true);
       DispatchWindowEvent(&command);
       *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled);
       result = true;
     }
     break;
 
     default:
     {