Hookup mozilla pref about re-using the window on a GURL event

This commit is contained in:
pinkerton%netscape.com 2002-04-26 19:02:28 +00:00
Родитель 2ab04a2ac9
Коммит b3b8884b90
12 изменённых файлов: 128 добавлений и 8 удалений

Просмотреть файл

@ -108,6 +108,7 @@ class nsIDOMNode;
-(CHBrowserWrapper*)getBrowserWrapper;
- (void)loadURL:(NSURL*)aURL;
- (void)loadURLString:(NSString*)aStr;
- (void)updateLocationFields:(NSString *)locationString;
- (void)updateToolbarItems;
- (void)focusURLBar;

Просмотреть файл

@ -564,6 +564,12 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
}
-(void)loadURLString:(NSString*)aStr
{
[self loadURL:[NSURL URLWithString:aStr]];
}
-(void)loadURL:(NSURL*)aURL
{
if (mInitialized) {

Просмотреть файл

@ -24,11 +24,34 @@
#import "CHGetURLCommand.h"
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#include "nsIPref.h"
#include "nsCOMPtr.h"
#include "nsIServiceManagerUtils.h"
@implementation CHGetURLCommand
- (id)performDefaultImplementation {
id controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
- (id)performDefaultImplementation
{
// get the pref that specifies if we want to re-use the existing window or
// open a new one. There's really no point caching this pref.
PRBool reuseWindow = PR_FALSE;
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
if ( prefService )
prefService->GetBoolPref("browser.always_reuse_window", &reuseWindow);
BrowserWindowController* controller = nsnull;
if ( reuseWindow ) {
controller = [[NSApp mainWindow] windowController];
[controller loadURLString:[self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
}
else
controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
return nil;
}
@end

Просмотреть файл

@ -24,11 +24,34 @@
#import "CHGetURLCommand.h"
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#include "nsIPref.h"
#include "nsCOMPtr.h"
#include "nsIServiceManagerUtils.h"
@implementation CHGetURLCommand
- (id)performDefaultImplementation {
id controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
- (id)performDefaultImplementation
{
// get the pref that specifies if we want to re-use the existing window or
// open a new one. There's really no point caching this pref.
PRBool reuseWindow = PR_FALSE;
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
if ( prefService )
prefService->GetBoolPref("browser.always_reuse_window", &reuseWindow);
BrowserWindowController* controller = nsnull;
if ( reuseWindow ) {
controller = [[NSApp mainWindow] windowController];
[controller loadURLString:[self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
}
else
controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
return nil;
}
@end

Просмотреть файл

@ -108,6 +108,7 @@ class nsIDOMNode;
-(CHBrowserWrapper*)getBrowserWrapper;
- (void)loadURL:(NSURL*)aURL;
- (void)loadURLString:(NSString*)aStr;
- (void)updateLocationFields:(NSString *)locationString;
- (void)updateToolbarItems;
- (void)focusURLBar;

Просмотреть файл

@ -564,6 +564,12 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
}
-(void)loadURLString:(NSString*)aStr
{
[self loadURL:[NSURL URLWithString:aStr]];
}
-(void)loadURL:(NSURL*)aURL
{
if (mInitialized) {

Просмотреть файл

@ -108,6 +108,7 @@ class nsIDOMNode;
-(CHBrowserWrapper*)getBrowserWrapper;
- (void)loadURL:(NSURL*)aURL;
- (void)loadURLString:(NSString*)aStr;
- (void)updateLocationFields:(NSString *)locationString;
- (void)updateToolbarItems;
- (void)focusURLBar;

Просмотреть файл

@ -564,6 +564,12 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
}
-(void)loadURLString:(NSString*)aStr
{
[self loadURL:[NSURL URLWithString:aStr]];
}
-(void)loadURL:(NSURL*)aURL
{
if (mInitialized) {

Просмотреть файл

@ -24,11 +24,34 @@
#import "CHGetURLCommand.h"
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#include "nsIPref.h"
#include "nsCOMPtr.h"
#include "nsIServiceManagerUtils.h"
@implementation CHGetURLCommand
- (id)performDefaultImplementation {
id controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
- (id)performDefaultImplementation
{
// get the pref that specifies if we want to re-use the existing window or
// open a new one. There's really no point caching this pref.
PRBool reuseWindow = PR_FALSE;
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
if ( prefService )
prefService->GetBoolPref("browser.always_reuse_window", &reuseWindow);
BrowserWindowController* controller = nsnull;
if ( reuseWindow ) {
controller = [[NSApp mainWindow] windowController];
[controller loadURLString:[self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
}
else
controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
return nil;
}
@end

Просмотреть файл

@ -24,11 +24,34 @@
#import "CHGetURLCommand.h"
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#include "nsIPref.h"
#include "nsCOMPtr.h"
#include "nsIServiceManagerUtils.h"
@implementation CHGetURLCommand
- (id)performDefaultImplementation {
id controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
- (id)performDefaultImplementation
{
// get the pref that specifies if we want to re-use the existing window or
// open a new one. There's really no point caching this pref.
PRBool reuseWindow = PR_FALSE;
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
if ( prefService )
prefService->GetBoolPref("browser.always_reuse_window", &reuseWindow);
BrowserWindowController* controller = nsnull;
if ( reuseWindow ) {
controller = [[NSApp mainWindow] windowController];
[controller loadURLString:[self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
}
else
controller = [[NSApp delegate] openBrowserWindowWithURLString: [self directParameter]];
[[[controller getBrowserWrapper] getBrowserView] setActive: YES];
return nil;
}
@end

Просмотреть файл

@ -108,6 +108,7 @@ class nsIDOMNode;
-(CHBrowserWrapper*)getBrowserWrapper;
- (void)loadURL:(NSURL*)aURL;
- (void)loadURLString:(NSString*)aStr;
- (void)updateLocationFields:(NSString *)locationString;
- (void)updateToolbarItems;
- (void)focusURLBar;

Просмотреть файл

@ -564,6 +564,12 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
}
-(void)loadURLString:(NSString*)aStr
{
[self loadURL:[NSURL URLWithString:aStr]];
}
-(void)loadURL:(NSURL*)aURL
{
if (mInitialized) {