Bug 895274 part.162 Rename NS_CONTENT_COMMAND_PASTE_TRANSFERABLE to eContentCommandPasteTransferable r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 11 Sep 2015 01:59:52 +0900
changeset 296116 667d75050a9411dba70607df4437cba134753501
parent 296115 e59cc10fc94562a1859fc86f61b3c16523045450
child 296117 54ac42eda76f6f66400846dd5a32e92b827ff389
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.162 Rename NS_CONTENT_COMMAND_PASTE_TRANSFERABLE to eContentCommandPasteTransferable r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/EventStateManager.cpp
widget/EventMessageList.h
widget/MiscEvents.h
widget/cocoa/nsChildView.mm
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2063,22 +2063,22 @@ nsDOMWindowUtils::SendContentCommandEven
     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;
   else if (aType.EqualsLiteral("redo"))
     msg = NS_CONTENT_COMMAND_REDO;
   else if (aType.EqualsLiteral("pasteTransferable"))
-    msg = NS_CONTENT_COMMAND_PASTE_TRANSFERABLE;
+    msg = eContentCommandPasteTransferable;
   else
     return NS_ERROR_FAILURE;
 
   WidgetContentCommandEvent event(true, msg, widget);
-  if (msg == NS_CONTENT_COMMAND_PASTE_TRANSFERABLE) {
+  if (msg == eContentCommandPasteTransferable) {
     event.mTransferable = aTransferable;
   }
 
   nsEventStatus status;
   return widget->DispatchEvent(&event, status);
 }
 
 NS_IMETHODIMP
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -748,20 +748,18 @@ EventStateManager::PreHandleEvent(nsPres
                                           aEvent->AsSelectionEvent());
     break;
   case NS_CONTENT_COMMAND_CUT:
   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 NS_CONTENT_COMMAND_PASTE_TRANSFERABLE:
-    {
-      DoContentCommandEvent(aEvent->AsContentCommandEvent());
-    }
+  case eContentCommandPasteTransferable:
+    DoContentCommandEvent(aEvent->AsContentCommandEvent());
     break;
   case NS_CONTENT_COMMAND_SCROLL:
     {
       DoContentCommandScrollEvent(aEvent->AsContentCommandEvent());
     }
     break;
   case NS_COMPOSITION_START:
     if (aEvent->mFlags.mIsTrusted) {
@@ -5052,17 +5050,17 @@ EventStateManager::DoContentCommandEvent
       cmd = "cmd_delete";
       break;
     case NS_CONTENT_COMMAND_UNDO:
       cmd = "cmd_undo";
       break;
     case NS_CONTENT_COMMAND_REDO:
       cmd = "cmd_redo";
       break;
-    case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE:
+    case eContentCommandPasteTransferable:
       cmd = "cmd_pasteTransferable";
       break;
     default:
       return NS_ERROR_NOT_IMPLEMENTED;
   }
   nsCOMPtr<nsIController> controller;
   nsresult rv = root->GetControllerForCommand(cmd, getter_AddRefs(controller));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -5072,17 +5070,17 @@ EventStateManager::DoContentCommandEvent
     aEvent->mIsEnabled = false;
   } else {
     bool canDoIt;
     rv = controller->IsCommandEnabled(cmd, &canDoIt);
     NS_ENSURE_SUCCESS(rv, rv);
     aEvent->mIsEnabled = canDoIt;
     if (canDoIt && !aEvent->mOnlyEnabledCheck) {
       switch (aEvent->mMessage) {
-        case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
+        case eContentCommandPasteTransferable: {
           nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
           NS_ENSURE_STATE(commandController);
 
           nsCOMPtr<nsICommandParams> params = do_CreateInstance("@mozilla.org/embedcomp/command-params;1", &rv);
           NS_ENSURE_SUCCESS(rv, rv);
 
           rv = params->SetISupportsValue("transferable", aEvent->mTransferable);
           NS_ENSURE_SUCCESS(rv, rv);
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -294,31 +294,31 @@ NS_EVENT_MESSAGE(ePluginEventFirst,     
 NS_EVENT_MESSAGE(ePluginInputEvent,     ePluginEventFirst)
 
 // 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(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(NS_CONTENT_COMMAND_PASTE_TRANSFERABLE, eContentCommandEventFirst + 6)
+NS_EVENT_MESSAGE(eContentCommandEventFirst,        3800)
+NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_CUT,           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
 // 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)
+NS_EVENT_MESSAGE(NS_CONTENT_COMMAND_SCROLL,        eContentCommandEventFirst + 7)
 
 // Event to gesture notification
 NS_EVENT_MESSAGE(NS_GESTURENOTIFY_EVENT_START, 3900)
 
 NS_EVENT_MESSAGE(NS_ORIENTATION_EVENT,  4000)
 
 NS_EVENT_MESSAGE(NS_SCROLLAREA_EVENT_START, 4100)
 NS_EVENT_MESSAGE(NS_SCROLLEDAREACHANGED, NS_SCROLLAREA_EVENT_START)
--- a/widget/MiscEvents.h
+++ b/widget/MiscEvents.h
@@ -41,17 +41,17 @@ public:
   {
     // This event isn't an internal event of any DOM event.
     NS_ASSERTION(!IsAllowedToDispatchDOMEvent(),
       "WidgetQueryContentEvent needs to support Duplicate()");
     MOZ_CRASH("WidgetQueryContentEvent doesn't support Duplicate()");
     return nullptr;
   }
 
-  // NS_CONTENT_COMMAND_PASTE_TRANSFERABLE
+  // eContentCommandPasteTransferable
   nsCOMPtr<nsITransferable> mTransferable; // [in]
 
   // NS_CONTENT_COMMAND_SCROLL
   // for mScroll.mUnit
   enum
   {
     eCmdScrollUnit_Line,
     eCmdScrollUnit_Page,
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -6053,17 +6053,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
         mGeckoChild->DispatchWindowEvent(event);
         if (!mGeckoChild || !event.mSucceeded || !event.mReply.mHasSelection)
           result = nil;
       }
 
       // Determine if we can paste (if receiving data from the service).
       if (mGeckoChild && returnType) {
         WidgetContentCommandEvent command(true,
-                                          NS_CONTENT_COMMAND_PASTE_TRANSFERABLE,
+                                          eContentCommandPasteTransferable,
                                           mGeckoChild, true);
         // This might possibly destroy our widget (and null out mGeckoChild).
         mGeckoChild->DispatchWindowEvent(command);
         if (!mGeckoChild || !command.mSucceeded || !command.mIsEnabled)
           result = nil;
       }
     }
   }
@@ -6151,17 +6151,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
 
   rv = nsClipboard::TransferableFromPasteboard(trans, pboard);
   if (NS_FAILED(rv))
     return NO;
 
   NS_ENSURE_TRUE(mGeckoChild, false);
 
   WidgetContentCommandEvent command(true,
-                                    NS_CONTENT_COMMAND_PASTE_TRANSFERABLE,
+                                    eContentCommandPasteTransferable,
                                     mGeckoChild);
   command.mTransferable = trans;
   mGeckoChild->DispatchWindowEvent(command);
 
   return command.mSucceeded && command.mIsEnabled;
 }
 
 #pragma mark -