Bug 1354159 - Part 1 - Remove the unneeded third 'view' argument from PlacesUIUtils.openNodeWithEvent(). r=mak

MozReview-Commit-ID: Jema2qMYEdX

--HG--
extra : rebase_source : 9cd5850e7c306ff62f9751ce419a278e8978b04e
This commit is contained in:
Mike de Boer 2017-06-29 17:57:22 -07:00
parent fb0361e188
commit 0da1ebf2ab
6 changed files with 14 additions and 20 deletions

View File

@ -385,7 +385,7 @@
#endif
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
oncommand="BookmarksEventHandler.onCommand(event);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarkingUI.onMainMenuPopupShowing(event);
if (!this.parentNode._placesView)

View File

@ -883,7 +883,7 @@ var BookmarksEventHandler = {
PlacesUIUtils.openContainerNodeInTabs(target._placesNode, aEvent, aView);
} else if (aEvent.button == 1) {
// left-clicks with modifier are already served by onCommand
this.onCommand(aEvent, aView);
this.onCommand(aEvent);
}
},
@ -893,13 +893,11 @@ var BookmarksEventHandler = {
* Opens the item.
* @param aEvent
* DOMEvent for the command
* @param aView
* The places view which aEvent should be associated with.
*/
onCommand: function BEH_onCommand(aEvent, aView) {
onCommand: function BEH_onCommand(aEvent) {
var target = aEvent.originalTarget;
if (target._placesNode)
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent, aView);
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent);
},
fillInBHTooltip: function BEH_fillInBHTooltip(aDocument, aEvent) {
@ -1926,14 +1924,14 @@ var BookmarkingUI = {
aEvent.target.removeEventListener("ViewHiding", this);
},
onPanelMenuViewCommand: function BUI_onPanelMenuViewCommand(aEvent, aView) {
onPanelMenuViewCommand: function BUI_onPanelMenuViewCommand(aEvent) {
let target = aEvent.originalTarget;
if (!target._placesNode)
return;
if (PlacesUtils.nodeIsContainer(target._placesNode))
PlacesCommandHook.showPlacesOrganizer([ "BookmarksMenu", target._placesNode.itemId ]);
else
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent, aView);
PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent);
PanelUI.hide();
},

View File

@ -979,7 +979,7 @@
placespopup="true"
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
oncommand="BookmarksEventHandler.onCommand(event);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarkingUI.onPopupShowing(event);
BookmarkingUI.attachPlacesView(event, this);"
@ -1143,7 +1143,7 @@
id="PlacesToolbar"
context="placesContext"
onclick="BookmarksEventHandler.onClick(event, this._placesView);"
oncommand="BookmarksEventHandler.onCommand(event, this._placesView);"
oncommand="BookmarksEventHandler.onCommand(event);"
tooltip="bhTooltip"
popupsinherittooltip="true">
<hbox flex="1">

View File

@ -1010,12 +1010,10 @@ this.PlacesUIUtils = {
* @param aEvent
* The DOM mouse/key event with modifier keys set that track the
* user's preferred destination window or tab.
* @param aView
* The controller associated with aNode.
*/
openNodeWithEvent:
function PUIU_openNodeWithEvent(aNode, aEvent, aView) {
let window = aView.ownerWindow;
function PUIU_openNodeWithEvent(aNode, aEvent) {
let window = aEvent.target.ownerGlobal;
this._openNodeIn(aNode, window.whereToOpenLink(aEvent, false, true), window);
},

View File

@ -1365,7 +1365,7 @@ var ContentTree = {
openSelectedNode: function CT_openSelectedNode(aEvent) {
let view = this.view;
PlacesUIUtils.openNodeWithEvent(view.selectedNode, aEvent, view);
PlacesUIUtils.openNodeWithEvent(view.selectedNode, aEvent);
},
onClick: function CT_onClick(aEvent) {

View File

@ -52,17 +52,15 @@ var SidebarUtils = {
// do this *before* attempting to load the link since openURL uses
// selection as an indication of which link to load.
tbo.view.selection.select(cell.row);
PlacesUIUtils.openNodeWithEvent(aTree.selectedNode, aEvent, aTree);
PlacesUIUtils.openNodeWithEvent(aTree.selectedNode, aEvent);
}
},
handleTreeKeyPress: function SU_handleTreeKeyPress(aEvent) {
// XXX Bug 627901: Post Fx4, this method should take a tree parameter.
let tree = aEvent.target;
let node = tree.selectedNode;
let node = aEvent.target.selectedNode;
if (node) {
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN)
PlacesUIUtils.openNodeWithEvent(node, aEvent, tree);
PlacesUIUtils.openNodeWithEvent(node, aEvent);
}
},