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
This commit is contained in:
alqahira%ardisson.org
2010-03-12 05:49:44 +00:00
parent 67256d5204
commit 33371ec4d1

View File

@@ -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];
}