From 33371ec4d1dd33601b9421ad1dbf78d65bd2d78a Mon Sep 17 00:00:00 2001 From: "alqahira%ardisson.org" Date: Fri, 12 Mar 2010 05:49:44 +0000 Subject: [PATCH] Bug 385791 - Context menu's Search item should always use a new tab or new window. r/sr=smorgan git-svn-id: svn://10.0.0.236/trunk@259946 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/browser/BrowserWindowController.mm | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/mozilla/camino/src/browser/BrowserWindowController.mm b/mozilla/camino/src/browser/BrowserWindowController.mm index 763bad6b129..a2b277f8a01 100644 --- a/mozilla/camino/src/browser/BrowserWindowController.mm +++ b/mozilla/camino/src/browser/BrowserWindowController.mm @@ -2823,19 +2823,13 @@ public: [mSearchBar becomeFirstResponder]; [mSearchBar setStringValue:selection]; - unsigned int modifiers = [[NSApp currentEvent] modifierFlags]; - - EOpenDestination destination = eDestinationCurrentView; - BOOL loadInBackground = NO; - // do search in a new window/tab if Command is held down - if (modifiers & NSCommandKeyMask) { - BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick - withSuccess:NULL]; - destination = loadInTab ? eDestinationNewTab : eDestinationNewWindow; - loadInBackground = [BrowserWindowController shouldLoadInBackgroundForDestination:destination - sender:nil]; - } - + // Open searches in a new tab or window, depending on user preferences, and + // honor the user preference (and toggle) for foreground or background. + BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick + withSuccess:NULL]; + EOpenDestination destination = loadInTab ? eDestinationNewTab : eDestinationNewWindow; + BOOL loadInBackground = [BrowserWindowController shouldLoadInBackgroundForDestination:destination + sender:nil]; [self performSearch:mSearchBar inView:destination inBackground:loadInBackground]; }