зеркало из https://github.com/mozilla/gecko-dev.git
cleanup for bug 317214, rename some constants and remove unused logic to simplify.
r/sr=mento
This commit is contained in:
Родитель
2996640c67
Коммит
e632a8a4a9
|
@ -52,13 +52,10 @@
|
|||
|
||||
typedef enum EBookmarkOpenBehavior
|
||||
{
|
||||
eBookmarkOpenBehaviorDefault, // follow the prefs
|
||||
eBookmarkOpenBehaviorNewTabDefault,
|
||||
eBookmarkOpenBehaviorNewTabForeground,
|
||||
eBookmarkOpenBehaviorNewTabBackground,
|
||||
eBookmarkOpenBehaviorNewWindowDefault,
|
||||
eBookmarkOpenBehaviorNewWindowForeground,
|
||||
eBookmarkOpenBehaviorNewWindowBackground
|
||||
eBookmarkOpenBehavior_Preferred, // simply opens the bookmark
|
||||
eBookmarkOpenBehavior_NewWindowOrTab, // opens the bookmark in a new tab/window, depending on the pref
|
||||
eBookmarkOpenBehavior_NewWindow,
|
||||
eBookmarkOpenBehavior_NewTab
|
||||
};
|
||||
|
||||
@interface MainController : NSObject
|
||||
|
|
|
@ -531,7 +531,7 @@ const int kReuseWindowOnAE = 2;
|
|||
|
||||
switch (behavior)
|
||||
{
|
||||
case eBookmarkOpenBehaviorDefault:
|
||||
case eBookmarkOpenBehavior_Preferred:
|
||||
{
|
||||
BOOL cmdKeyDown = (GetCurrentKeyModifiers() & cmdKey) != 0;
|
||||
if (cmdKeyDown)
|
||||
|
@ -547,34 +547,16 @@ const int kReuseWindowOnAE = 2;
|
|||
}
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewTabDefault:
|
||||
case eBookmarkOpenBehavior_NewTab:
|
||||
openInNewTab = YES;
|
||||
newTabInBackground = browserWindowController && loadNewTabsInBackgroundPref;
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewTabForeground:
|
||||
openInNewTab = YES;
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewTabBackground:
|
||||
openInNewTab = YES;
|
||||
newTabInBackground = YES;
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewWindowDefault:
|
||||
case eBookmarkOpenBehavior_NewWindow:
|
||||
openInNewWindow = YES;
|
||||
if (loadNewTabsInBackgroundPref)
|
||||
behindWindow = [browserWindowController window];
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewWindowForeground:
|
||||
openInNewWindow = YES;
|
||||
break;
|
||||
|
||||
case eBookmarkOpenBehaviorNewWindowBackground:
|
||||
openInNewWindow = YES;
|
||||
behindWindow = [browserWindowController window];
|
||||
break;
|
||||
}
|
||||
|
||||
// we allow popups for the load that fires off a bookmark. Subsequent page loads, however, will
|
||||
|
@ -1186,7 +1168,7 @@ Otherwise, we return the URL we originally got. Right now this supports .url and
|
|||
-(IBAction) openMenuBookmark:(id)aSender
|
||||
{
|
||||
BookmarkItem* item = [aSender representedObject];
|
||||
[self loadBookmark:item withWindowController:[self getMainWindowBrowserController] openBehavior:eBookmarkOpenBehaviorDefault];
|
||||
[self loadBookmark:item withWindowController:[self getMainWindowBrowserController] openBehavior:eBookmarkOpenBehavior_Preferred];
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
BrowserWindowController* brController = [[self window] windowController];
|
||||
BookmarkItem *item = [self bookmarkItem];
|
||||
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehaviorDefault];
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehavior_Preferred];
|
||||
}
|
||||
|
||||
-(IBAction)openBookmarkInNewTab:(id)aSender
|
||||
|
@ -174,7 +174,7 @@
|
|||
BrowserWindowController* brController = [[self window] windowController];
|
||||
BookmarkItem *item = [self bookmarkItem];
|
||||
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehaviorNewTabDefault];
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehavior_NewTab];
|
||||
}
|
||||
|
||||
-(IBAction)openBookmarkInNewWindow:(id)aSender
|
||||
|
@ -182,7 +182,7 @@
|
|||
BrowserWindowController* brController = [[self window] windowController];
|
||||
BookmarkItem *item = [self bookmarkItem];
|
||||
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehaviorNewWindowDefault];
|
||||
[[NSApp delegate] loadBookmark:item withWindowController:brController openBehavior:eBookmarkOpenBehavior_NewWindow];
|
||||
}
|
||||
|
||||
- (IBAction)copyURLs:(id)aSender
|
||||
|
|
|
@ -500,7 +500,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
|
|||
else
|
||||
{
|
||||
// otherwise follow the standard bookmark opening behavior
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehaviorDefault];
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehavior_Preferred];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
|
|||
else
|
||||
{
|
||||
// otherwise follow the standard bookmark opening behavior
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehaviorNewTabDefault];
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehavior_NewTab];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
|
|||
else
|
||||
{
|
||||
// otherwise follow the standard bookmark opening behavior
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehaviorNewWindowDefault];
|
||||
[[NSApp delegate] loadBookmark:curItem withWindowController:mBrowserWindowController openBehavior:eBookmarkOpenBehavior_NewWindow];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче