From 53826b4560ffb2a9338ee049d7b2a5a944c75eda Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Tue, 25 Jun 2002 22:08:33 +0000 Subject: [PATCH] Fixing bug 154069; hooking up additional find options. Also did some file detabbing. r=ccarlen/pinkerton. --- camino/BrowserWindowController.h | 2 - camino/BrowserWindowController.mm | 26 +++++---- camino/CHBrowserView.h | 3 +- camino/CHBrowserView.mm | 53 ++++++++++-------- .../English.lproj/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes camino/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes .../English.lproj/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes camino/src/browser/BrowserWindowController.h | 2 - camino/src/browser/BrowserWindowController.mm | 26 +++++---- camino/src/embedding/CHBrowserView.h | 3 +- camino/src/embedding/CHBrowserView.mm | 53 ++++++++++-------- chimera/BrowserWindowController.h | 2 - chimera/BrowserWindowController.mm | 26 +++++---- chimera/CHBrowserView.h | 3 +- chimera/CHBrowserView.mm | 53 ++++++++++-------- .../English.lproj/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes chimera/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes .../English.lproj/FindDialog.nib/objects.nib | Bin 2336 -> 2536 bytes chimera/src/browser/BrowserWindowController.h | 2 - .../src/browser/BrowserWindowController.mm | 26 +++++---- chimera/src/embedding/CHBrowserView.h | 3 +- chimera/src/embedding/CHBrowserView.mm | 53 ++++++++++-------- 22 files changed, 180 insertions(+), 156 deletions(-) diff --git a/camino/BrowserWindowController.h b/camino/BrowserWindowController.h index d2b0fa70e86..b57a076cbef 100644 --- a/camino/BrowserWindowController.h +++ b/camino/BrowserWindowController.h @@ -177,8 +177,6 @@ class nsIDOMNode; - (void)startThrobber; - (void)stopThrobber; -//- (BOOL)findInPage:(NSString*)text; - -(void) biggerTextSize; -(void) smallerTextSize; diff --git a/camino/BrowserWindowController.mm b/camino/BrowserWindowController.mm index 947a439a7cb..ab9446d0aab 100644 --- a/camino/BrowserWindowController.mm +++ b/camino/BrowserWindowController.mm @@ -224,8 +224,8 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; [self setupToolbar]; // 03/03/2002 mlj Changing strategy a bit here. The addTab: method was -// duplicating a lot of the code found here. I have moved it to that method. -// We now remove the IB tab, then add one of our own. +// duplicating a lot of the code found here. I have moved it to that method. +// We now remove the IB tab, then add one of our own. [mTabBrowser removeTabViewItem:[mTabBrowser tabViewItemAtIndex:0]]; [self newTab]; @@ -348,7 +348,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -367,7 +367,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -522,11 +522,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (void)beginLocationSheet { - [NSApp beginSheet: mLocationSheetWindow - modalForWindow: [self window] - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; + [NSApp beginSheet: mLocationSheetWindow + modalForWindow: [self window] + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; } - (IBAction)endLocationSheet:(id)sender @@ -701,9 +701,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; } -- (BOOL)findInPage:(NSString*)text +- (BOOL)findInPageWithPattern:(NSString*)text caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { - return [[mBrowserView getBrowserView] findInPage:text]; + return [[mBrowserView getBrowserView] findInPageWithPattern:text caseSensitive:inCaseSensitive + wrap:inWrap backwards:inBackwards]; } - (void)addBookmarkExtended: (BOOL)aIsFromMenu isFolder:(BOOL)aIsFolder @@ -764,7 +766,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; NSResponder* resp = [[self window] firstResponder]; [[self window] makeFirstResponder: nil]; - if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { + if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { // XXXHack to bypass sidebar crashes. [mSidebarDrawer openOnEdge: NSMaxXEdge]; } else { diff --git a/camino/CHBrowserView.h b/camino/CHBrowserView.h index e5c8ff5866a..017cf13a2f6 100644 --- a/camino/CHBrowserView.h +++ b/camino/CHBrowserView.h @@ -142,7 +142,8 @@ enum { - (void)printDocument; -- (BOOL)findInPage:(NSString*)inText; +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards; -(IBAction)cut:(id)aSender; -(IBAction)copy:(id)aSender; diff --git a/camino/CHBrowserView.mm b/camino/CHBrowserView.mm index 7a0acad2b4d..a9d9864a043 100644 --- a/camino/CHBrowserView.mm +++ b/camino/CHBrowserView.mm @@ -98,7 +98,7 @@ const char* dirServiceContractID = "@mozilla.org/file/directory_service;1"; class nsCocoaBrowserListener : public nsSupportsWeakReference, public nsIInterfaceRequestor, - public nsIWebBrowserChrome, + public nsIWebBrowserChrome, public nsIWindowCreator, public nsIEmbeddingSiteWindow2, public nsIWebProgressListener, @@ -148,12 +148,12 @@ nsCocoaBrowserListener::~nsCocoaBrowserListener() } NS_IMPL_ISUPPORTS9(nsCocoaBrowserListener, - nsIInterfaceRequestor, - nsIWebBrowserChrome, + nsIInterfaceRequestor, + nsIWebBrowserChrome, nsIWindowCreator, - nsIEmbeddingSiteWindow, + nsIEmbeddingSiteWindow, nsIEmbeddingSiteWindow2, - nsIWebProgressListener, + nsIWebProgressListener, nsISupportsWeakReference, nsIContextMenuListener, nsITooltipListener) @@ -218,14 +218,14 @@ nsCocoaBrowserListener::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const NSPoint where; where.x = aXCoords; where.y = aYCoords; [mContainer onShowTooltip:where withText:[NSString stringWithCharacters:aTipText length:nsCRT::strlen(aTipText)]]; - return NS_OK; + return NS_OK; } NS_IMETHODIMP nsCocoaBrowserListener::OnHideTooltip() { [mContainer onHideTooltip]; - return NS_OK; + return NS_OK; } // Implementation of nsIWebBrowserChrome @@ -363,7 +363,7 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) NS_IMETHODIMP nsCocoaBrowserListener::Blur() { - return NS_OK; + return NS_OK; } // Implementation of nsIEmbeddingSiteWindow @@ -890,11 +890,11 @@ void nsHeaderSniffer::PerformSave() /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */ NS_IMETHODIMP nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) + nsIRequest *aRequest, + PRInt32 aCurSelfProgress, + PRInt32 aMaxSelfProgress, + PRInt32 aCurTotalProgress, + PRInt32 aMaxTotalProgress) { return NS_OK; } @@ -902,8 +902,8 @@ nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */ NS_IMETHODIMP nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location) + nsIRequest *aRequest, + nsIURI *location) { return NS_OK; } @@ -911,9 +911,9 @@ nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */ NS_IMETHODIMP nsHeaderSniffer::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aMessage) + nsIRequest *aRequest, + nsresult aStatus, + const PRUnichar *aMessage) { return NS_OK; } @@ -1000,8 +1000,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { nsCOMPtr window = do_QueryInterface(_webBrowser); window->SetSize((PRInt32)frameRect.size.width, - (PRInt32)frameRect.size.height, - PR_TRUE); + (PRInt32)frameRect.size.height, + PR_TRUE); } } @@ -1173,14 +1173,14 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { // Set the container nsIWebBrowserChrome _webBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, - _listener)); + _listener)); NSRect frame = [self frame]; // Hook up the widget hierarchy with us as the parent nsCOMPtr baseWin = do_QueryInterface(_webBrowser); baseWin->InitWindow((NSView*)self, nsnull, 0, 0, - frame.size.width, frame.size.height); + frame.size.width, frame.size.height); baseWin->Create(); } @@ -1248,7 +1248,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq print->Print(nsnull, nsnull); } --(BOOL)findInPage:(NSString*)inText +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { PRBool found = PR_FALSE; @@ -1265,6 +1266,10 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq framesFind->SetRootSearchFrame(rootWindow); framesFind->SetCurrentSearchFrame(focusedWindow); + webFind->SetMatchCase(inCaseSensitive ? PR_TRUE : PR_FALSE); + webFind->SetWrapFind(inWrap ? PR_TRUE : PR_FALSE); + webFind->SetFindBackwards(inBackwards ? PR_TRUE : PR_FALSE); + PRUnichar* text = (PRUnichar*)nsMemory::Alloc(([inText length]+1)*sizeof(PRUnichar)); if ( text ) { [inText getCharacters:text]; @@ -1537,7 +1542,7 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq } return dragAccepted; -} +} @end diff --git a/camino/English.lproj/FindDialog.nib/objects.nib b/camino/English.lproj/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/camino/FindDialog.nib/objects.nib b/camino/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/camino/resources/localized/English.lproj/FindDialog.nib/objects.nib b/camino/resources/localized/English.lproj/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/camino/src/browser/BrowserWindowController.h b/camino/src/browser/BrowserWindowController.h index d2b0fa70e86..b57a076cbef 100644 --- a/camino/src/browser/BrowserWindowController.h +++ b/camino/src/browser/BrowserWindowController.h @@ -177,8 +177,6 @@ class nsIDOMNode; - (void)startThrobber; - (void)stopThrobber; -//- (BOOL)findInPage:(NSString*)text; - -(void) biggerTextSize; -(void) smallerTextSize; diff --git a/camino/src/browser/BrowserWindowController.mm b/camino/src/browser/BrowserWindowController.mm index 947a439a7cb..ab9446d0aab 100644 --- a/camino/src/browser/BrowserWindowController.mm +++ b/camino/src/browser/BrowserWindowController.mm @@ -224,8 +224,8 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; [self setupToolbar]; // 03/03/2002 mlj Changing strategy a bit here. The addTab: method was -// duplicating a lot of the code found here. I have moved it to that method. -// We now remove the IB tab, then add one of our own. +// duplicating a lot of the code found here. I have moved it to that method. +// We now remove the IB tab, then add one of our own. [mTabBrowser removeTabViewItem:[mTabBrowser tabViewItemAtIndex:0]]; [self newTab]; @@ -348,7 +348,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -367,7 +367,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -522,11 +522,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (void)beginLocationSheet { - [NSApp beginSheet: mLocationSheetWindow - modalForWindow: [self window] - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; + [NSApp beginSheet: mLocationSheetWindow + modalForWindow: [self window] + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; } - (IBAction)endLocationSheet:(id)sender @@ -701,9 +701,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; } -- (BOOL)findInPage:(NSString*)text +- (BOOL)findInPageWithPattern:(NSString*)text caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { - return [[mBrowserView getBrowserView] findInPage:text]; + return [[mBrowserView getBrowserView] findInPageWithPattern:text caseSensitive:inCaseSensitive + wrap:inWrap backwards:inBackwards]; } - (void)addBookmarkExtended: (BOOL)aIsFromMenu isFolder:(BOOL)aIsFolder @@ -764,7 +766,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; NSResponder* resp = [[self window] firstResponder]; [[self window] makeFirstResponder: nil]; - if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { + if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { // XXXHack to bypass sidebar crashes. [mSidebarDrawer openOnEdge: NSMaxXEdge]; } else { diff --git a/camino/src/embedding/CHBrowserView.h b/camino/src/embedding/CHBrowserView.h index e5c8ff5866a..017cf13a2f6 100644 --- a/camino/src/embedding/CHBrowserView.h +++ b/camino/src/embedding/CHBrowserView.h @@ -142,7 +142,8 @@ enum { - (void)printDocument; -- (BOOL)findInPage:(NSString*)inText; +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards; -(IBAction)cut:(id)aSender; -(IBAction)copy:(id)aSender; diff --git a/camino/src/embedding/CHBrowserView.mm b/camino/src/embedding/CHBrowserView.mm index 7a0acad2b4d..a9d9864a043 100644 --- a/camino/src/embedding/CHBrowserView.mm +++ b/camino/src/embedding/CHBrowserView.mm @@ -98,7 +98,7 @@ const char* dirServiceContractID = "@mozilla.org/file/directory_service;1"; class nsCocoaBrowserListener : public nsSupportsWeakReference, public nsIInterfaceRequestor, - public nsIWebBrowserChrome, + public nsIWebBrowserChrome, public nsIWindowCreator, public nsIEmbeddingSiteWindow2, public nsIWebProgressListener, @@ -148,12 +148,12 @@ nsCocoaBrowserListener::~nsCocoaBrowserListener() } NS_IMPL_ISUPPORTS9(nsCocoaBrowserListener, - nsIInterfaceRequestor, - nsIWebBrowserChrome, + nsIInterfaceRequestor, + nsIWebBrowserChrome, nsIWindowCreator, - nsIEmbeddingSiteWindow, + nsIEmbeddingSiteWindow, nsIEmbeddingSiteWindow2, - nsIWebProgressListener, + nsIWebProgressListener, nsISupportsWeakReference, nsIContextMenuListener, nsITooltipListener) @@ -218,14 +218,14 @@ nsCocoaBrowserListener::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const NSPoint where; where.x = aXCoords; where.y = aYCoords; [mContainer onShowTooltip:where withText:[NSString stringWithCharacters:aTipText length:nsCRT::strlen(aTipText)]]; - return NS_OK; + return NS_OK; } NS_IMETHODIMP nsCocoaBrowserListener::OnHideTooltip() { [mContainer onHideTooltip]; - return NS_OK; + return NS_OK; } // Implementation of nsIWebBrowserChrome @@ -363,7 +363,7 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) NS_IMETHODIMP nsCocoaBrowserListener::Blur() { - return NS_OK; + return NS_OK; } // Implementation of nsIEmbeddingSiteWindow @@ -890,11 +890,11 @@ void nsHeaderSniffer::PerformSave() /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */ NS_IMETHODIMP nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) + nsIRequest *aRequest, + PRInt32 aCurSelfProgress, + PRInt32 aMaxSelfProgress, + PRInt32 aCurTotalProgress, + PRInt32 aMaxTotalProgress) { return NS_OK; } @@ -902,8 +902,8 @@ nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */ NS_IMETHODIMP nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location) + nsIRequest *aRequest, + nsIURI *location) { return NS_OK; } @@ -911,9 +911,9 @@ nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */ NS_IMETHODIMP nsHeaderSniffer::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aMessage) + nsIRequest *aRequest, + nsresult aStatus, + const PRUnichar *aMessage) { return NS_OK; } @@ -1000,8 +1000,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { nsCOMPtr window = do_QueryInterface(_webBrowser); window->SetSize((PRInt32)frameRect.size.width, - (PRInt32)frameRect.size.height, - PR_TRUE); + (PRInt32)frameRect.size.height, + PR_TRUE); } } @@ -1173,14 +1173,14 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { // Set the container nsIWebBrowserChrome _webBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, - _listener)); + _listener)); NSRect frame = [self frame]; // Hook up the widget hierarchy with us as the parent nsCOMPtr baseWin = do_QueryInterface(_webBrowser); baseWin->InitWindow((NSView*)self, nsnull, 0, 0, - frame.size.width, frame.size.height); + frame.size.width, frame.size.height); baseWin->Create(); } @@ -1248,7 +1248,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq print->Print(nsnull, nsnull); } --(BOOL)findInPage:(NSString*)inText +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { PRBool found = PR_FALSE; @@ -1265,6 +1266,10 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq framesFind->SetRootSearchFrame(rootWindow); framesFind->SetCurrentSearchFrame(focusedWindow); + webFind->SetMatchCase(inCaseSensitive ? PR_TRUE : PR_FALSE); + webFind->SetWrapFind(inWrap ? PR_TRUE : PR_FALSE); + webFind->SetFindBackwards(inBackwards ? PR_TRUE : PR_FALSE); + PRUnichar* text = (PRUnichar*)nsMemory::Alloc(([inText length]+1)*sizeof(PRUnichar)); if ( text ) { [inText getCharacters:text]; @@ -1537,7 +1542,7 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq } return dragAccepted; -} +} @end diff --git a/chimera/BrowserWindowController.h b/chimera/BrowserWindowController.h index d2b0fa70e86..b57a076cbef 100644 --- a/chimera/BrowserWindowController.h +++ b/chimera/BrowserWindowController.h @@ -177,8 +177,6 @@ class nsIDOMNode; - (void)startThrobber; - (void)stopThrobber; -//- (BOOL)findInPage:(NSString*)text; - -(void) biggerTextSize; -(void) smallerTextSize; diff --git a/chimera/BrowserWindowController.mm b/chimera/BrowserWindowController.mm index 947a439a7cb..ab9446d0aab 100644 --- a/chimera/BrowserWindowController.mm +++ b/chimera/BrowserWindowController.mm @@ -224,8 +224,8 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; [self setupToolbar]; // 03/03/2002 mlj Changing strategy a bit here. The addTab: method was -// duplicating a lot of the code found here. I have moved it to that method. -// We now remove the IB tab, then add one of our own. +// duplicating a lot of the code found here. I have moved it to that method. +// We now remove the IB tab, then add one of our own. [mTabBrowser removeTabViewItem:[mTabBrowser tabViewItemAtIndex:0]]; [self newTab]; @@ -348,7 +348,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -367,7 +367,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -522,11 +522,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (void)beginLocationSheet { - [NSApp beginSheet: mLocationSheetWindow - modalForWindow: [self window] - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; + [NSApp beginSheet: mLocationSheetWindow + modalForWindow: [self window] + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; } - (IBAction)endLocationSheet:(id)sender @@ -701,9 +701,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; } -- (BOOL)findInPage:(NSString*)text +- (BOOL)findInPageWithPattern:(NSString*)text caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { - return [[mBrowserView getBrowserView] findInPage:text]; + return [[mBrowserView getBrowserView] findInPageWithPattern:text caseSensitive:inCaseSensitive + wrap:inWrap backwards:inBackwards]; } - (void)addBookmarkExtended: (BOOL)aIsFromMenu isFolder:(BOOL)aIsFolder @@ -764,7 +766,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; NSResponder* resp = [[self window] firstResponder]; [[self window] makeFirstResponder: nil]; - if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { + if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { // XXXHack to bypass sidebar crashes. [mSidebarDrawer openOnEdge: NSMaxXEdge]; } else { diff --git a/chimera/CHBrowserView.h b/chimera/CHBrowserView.h index e5c8ff5866a..017cf13a2f6 100644 --- a/chimera/CHBrowserView.h +++ b/chimera/CHBrowserView.h @@ -142,7 +142,8 @@ enum { - (void)printDocument; -- (BOOL)findInPage:(NSString*)inText; +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards; -(IBAction)cut:(id)aSender; -(IBAction)copy:(id)aSender; diff --git a/chimera/CHBrowserView.mm b/chimera/CHBrowserView.mm index 7a0acad2b4d..a9d9864a043 100644 --- a/chimera/CHBrowserView.mm +++ b/chimera/CHBrowserView.mm @@ -98,7 +98,7 @@ const char* dirServiceContractID = "@mozilla.org/file/directory_service;1"; class nsCocoaBrowserListener : public nsSupportsWeakReference, public nsIInterfaceRequestor, - public nsIWebBrowserChrome, + public nsIWebBrowserChrome, public nsIWindowCreator, public nsIEmbeddingSiteWindow2, public nsIWebProgressListener, @@ -148,12 +148,12 @@ nsCocoaBrowserListener::~nsCocoaBrowserListener() } NS_IMPL_ISUPPORTS9(nsCocoaBrowserListener, - nsIInterfaceRequestor, - nsIWebBrowserChrome, + nsIInterfaceRequestor, + nsIWebBrowserChrome, nsIWindowCreator, - nsIEmbeddingSiteWindow, + nsIEmbeddingSiteWindow, nsIEmbeddingSiteWindow2, - nsIWebProgressListener, + nsIWebProgressListener, nsISupportsWeakReference, nsIContextMenuListener, nsITooltipListener) @@ -218,14 +218,14 @@ nsCocoaBrowserListener::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const NSPoint where; where.x = aXCoords; where.y = aYCoords; [mContainer onShowTooltip:where withText:[NSString stringWithCharacters:aTipText length:nsCRT::strlen(aTipText)]]; - return NS_OK; + return NS_OK; } NS_IMETHODIMP nsCocoaBrowserListener::OnHideTooltip() { [mContainer onHideTooltip]; - return NS_OK; + return NS_OK; } // Implementation of nsIWebBrowserChrome @@ -363,7 +363,7 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) NS_IMETHODIMP nsCocoaBrowserListener::Blur() { - return NS_OK; + return NS_OK; } // Implementation of nsIEmbeddingSiteWindow @@ -890,11 +890,11 @@ void nsHeaderSniffer::PerformSave() /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */ NS_IMETHODIMP nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) + nsIRequest *aRequest, + PRInt32 aCurSelfProgress, + PRInt32 aMaxSelfProgress, + PRInt32 aCurTotalProgress, + PRInt32 aMaxTotalProgress) { return NS_OK; } @@ -902,8 +902,8 @@ nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */ NS_IMETHODIMP nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location) + nsIRequest *aRequest, + nsIURI *location) { return NS_OK; } @@ -911,9 +911,9 @@ nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */ NS_IMETHODIMP nsHeaderSniffer::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aMessage) + nsIRequest *aRequest, + nsresult aStatus, + const PRUnichar *aMessage) { return NS_OK; } @@ -1000,8 +1000,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { nsCOMPtr window = do_QueryInterface(_webBrowser); window->SetSize((PRInt32)frameRect.size.width, - (PRInt32)frameRect.size.height, - PR_TRUE); + (PRInt32)frameRect.size.height, + PR_TRUE); } } @@ -1173,14 +1173,14 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { // Set the container nsIWebBrowserChrome _webBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, - _listener)); + _listener)); NSRect frame = [self frame]; // Hook up the widget hierarchy with us as the parent nsCOMPtr baseWin = do_QueryInterface(_webBrowser); baseWin->InitWindow((NSView*)self, nsnull, 0, 0, - frame.size.width, frame.size.height); + frame.size.width, frame.size.height); baseWin->Create(); } @@ -1248,7 +1248,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq print->Print(nsnull, nsnull); } --(BOOL)findInPage:(NSString*)inText +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { PRBool found = PR_FALSE; @@ -1265,6 +1266,10 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq framesFind->SetRootSearchFrame(rootWindow); framesFind->SetCurrentSearchFrame(focusedWindow); + webFind->SetMatchCase(inCaseSensitive ? PR_TRUE : PR_FALSE); + webFind->SetWrapFind(inWrap ? PR_TRUE : PR_FALSE); + webFind->SetFindBackwards(inBackwards ? PR_TRUE : PR_FALSE); + PRUnichar* text = (PRUnichar*)nsMemory::Alloc(([inText length]+1)*sizeof(PRUnichar)); if ( text ) { [inText getCharacters:text]; @@ -1537,7 +1542,7 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq } return dragAccepted; -} +} @end diff --git a/chimera/English.lproj/FindDialog.nib/objects.nib b/chimera/English.lproj/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/chimera/FindDialog.nib/objects.nib b/chimera/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/chimera/resources/localized/English.lproj/FindDialog.nib/objects.nib b/chimera/resources/localized/English.lproj/FindDialog.nib/objects.nib index 5eda225871b13268ccd08e39a06621d65e9a3ec2..86771779f9138f00e64e0a811f4b836421352b38 100644 GIT binary patch delta 271 zcmZ1=^g?)oA?Gs&1_n+bIY zGe0jeMM0c2CMPEr z<)r567i8vTrxumu=jj10WCUTj+ZlK-OyJN53dt}4U6Y)hnF3^UF*E>4AYih;GJ`Lm UC_gJTxg@_x!6mUI5$IV30Im{5od5s; delta 71 zcmaDMyg+DzA*UPz0|O@rZM0g?4rD-p++;?MCzAy@_+%J?0w4?qAjJ?M!yxznKTweZ E0Dmh9*#H0l diff --git a/chimera/src/browser/BrowserWindowController.h b/chimera/src/browser/BrowserWindowController.h index d2b0fa70e86..b57a076cbef 100644 --- a/chimera/src/browser/BrowserWindowController.h +++ b/chimera/src/browser/BrowserWindowController.h @@ -177,8 +177,6 @@ class nsIDOMNode; - (void)startThrobber; - (void)stopThrobber; -//- (BOOL)findInPage:(NSString*)text; - -(void) biggerTextSize; -(void) smallerTextSize; diff --git a/chimera/src/browser/BrowserWindowController.mm b/chimera/src/browser/BrowserWindowController.mm index 947a439a7cb..ab9446d0aab 100644 --- a/chimera/src/browser/BrowserWindowController.mm +++ b/chimera/src/browser/BrowserWindowController.mm @@ -224,8 +224,8 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; [self setupToolbar]; // 03/03/2002 mlj Changing strategy a bit here. The addTab: method was -// duplicating a lot of the code found here. I have moved it to that method. -// We now remove the IB tab, then add one of our own. +// duplicating a lot of the code found here. I have moved it to that method. +// We now remove the IB tab, then add one of our own. [mTabBrowser removeTabViewItem:[mTabBrowser tabViewItemAtIndex:0]]; [self newTab]; @@ -348,7 +348,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -367,7 +367,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: BackToolbarItemIdentifier, + return [NSArray arrayWithObjects: BackToolbarItemIdentifier, ForwardToolbarItemIdentifier, ReloadToolbarItemIdentifier, StopToolbarItemIdentifier, @@ -522,11 +522,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; - (void)beginLocationSheet { - [NSApp beginSheet: mLocationSheetWindow - modalForWindow: [self window] - modalDelegate: nil - didEndSelector: nil - contextInfo: nil]; + [NSApp beginSheet: mLocationSheetWindow + modalForWindow: [self window] + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; } - (IBAction)endLocationSheet:(id)sender @@ -701,9 +701,11 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; } -- (BOOL)findInPage:(NSString*)text +- (BOOL)findInPageWithPattern:(NSString*)text caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { - return [[mBrowserView getBrowserView] findInPage:text]; + return [[mBrowserView getBrowserView] findInPageWithPattern:text caseSensitive:inCaseSensitive + wrap:inWrap backwards:inBackwards]; } - (void)addBookmarkExtended: (BOOL)aIsFromMenu isFolder:(BOOL)aIsFolder @@ -764,7 +766,7 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item"; NSResponder* resp = [[self window] firstResponder]; [[self window] makeFirstResponder: nil]; - if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { + if ( ([mSidebarDrawer state] == NSDrawerClosedState) || ([mSidebarDrawer state] == NSDrawerClosingState) ) { // XXXHack to bypass sidebar crashes. [mSidebarDrawer openOnEdge: NSMaxXEdge]; } else { diff --git a/chimera/src/embedding/CHBrowserView.h b/chimera/src/embedding/CHBrowserView.h index e5c8ff5866a..017cf13a2f6 100644 --- a/chimera/src/embedding/CHBrowserView.h +++ b/chimera/src/embedding/CHBrowserView.h @@ -142,7 +142,8 @@ enum { - (void)printDocument; -- (BOOL)findInPage:(NSString*)inText; +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards; -(IBAction)cut:(id)aSender; -(IBAction)copy:(id)aSender; diff --git a/chimera/src/embedding/CHBrowserView.mm b/chimera/src/embedding/CHBrowserView.mm index 7a0acad2b4d..a9d9864a043 100644 --- a/chimera/src/embedding/CHBrowserView.mm +++ b/chimera/src/embedding/CHBrowserView.mm @@ -98,7 +98,7 @@ const char* dirServiceContractID = "@mozilla.org/file/directory_service;1"; class nsCocoaBrowserListener : public nsSupportsWeakReference, public nsIInterfaceRequestor, - public nsIWebBrowserChrome, + public nsIWebBrowserChrome, public nsIWindowCreator, public nsIEmbeddingSiteWindow2, public nsIWebProgressListener, @@ -148,12 +148,12 @@ nsCocoaBrowserListener::~nsCocoaBrowserListener() } NS_IMPL_ISUPPORTS9(nsCocoaBrowserListener, - nsIInterfaceRequestor, - nsIWebBrowserChrome, + nsIInterfaceRequestor, + nsIWebBrowserChrome, nsIWindowCreator, - nsIEmbeddingSiteWindow, + nsIEmbeddingSiteWindow, nsIEmbeddingSiteWindow2, - nsIWebProgressListener, + nsIWebProgressListener, nsISupportsWeakReference, nsIContextMenuListener, nsITooltipListener) @@ -218,14 +218,14 @@ nsCocoaBrowserListener::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const NSPoint where; where.x = aXCoords; where.y = aYCoords; [mContainer onShowTooltip:where withText:[NSString stringWithCharacters:aTipText length:nsCRT::strlen(aTipText)]]; - return NS_OK; + return NS_OK; } NS_IMETHODIMP nsCocoaBrowserListener::OnHideTooltip() { [mContainer onHideTooltip]; - return NS_OK; + return NS_OK; } // Implementation of nsIWebBrowserChrome @@ -363,7 +363,7 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) NS_IMETHODIMP nsCocoaBrowserListener::Blur() { - return NS_OK; + return NS_OK; } // Implementation of nsIEmbeddingSiteWindow @@ -890,11 +890,11 @@ void nsHeaderSniffer::PerformSave() /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */ NS_IMETHODIMP nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) + nsIRequest *aRequest, + PRInt32 aCurSelfProgress, + PRInt32 aMaxSelfProgress, + PRInt32 aCurTotalProgress, + PRInt32 aMaxTotalProgress) { return NS_OK; } @@ -902,8 +902,8 @@ nsHeaderSniffer::OnProgressChange(nsIWebProgress *aWebProgress, /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */ NS_IMETHODIMP nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location) + nsIRequest *aRequest, + nsIURI *location) { return NS_OK; } @@ -911,9 +911,9 @@ nsHeaderSniffer::OnLocationChange(nsIWebProgress *aWebProgress, /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */ NS_IMETHODIMP nsHeaderSniffer::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aMessage) + nsIRequest *aRequest, + nsresult aStatus, + const PRUnichar *aMessage) { return NS_OK; } @@ -1000,8 +1000,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { nsCOMPtr window = do_QueryInterface(_webBrowser); window->SetSize((PRInt32)frameRect.size.width, - (PRInt32)frameRect.size.height, - PR_TRUE); + (PRInt32)frameRect.size.height, + PR_TRUE); } } @@ -1173,14 +1173,14 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq if (_webBrowser) { // Set the container nsIWebBrowserChrome _webBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, - _listener)); + _listener)); NSRect frame = [self frame]; // Hook up the widget hierarchy with us as the parent nsCOMPtr baseWin = do_QueryInterface(_webBrowser); baseWin->InitWindow((NSView*)self, nsnull, 0, 0, - frame.size.width, frame.size.height); + frame.size.width, frame.size.height); baseWin->Create(); } @@ -1248,7 +1248,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq print->Print(nsnull, nsnull); } --(BOOL)findInPage:(NSString*)inText +- (BOOL)findInPageWithPattern:(NSString*)inText caseSensitive:(BOOL)inCaseSensitive + wrap:(BOOL)inWrap backwards:(BOOL)inBackwards { PRBool found = PR_FALSE; @@ -1265,6 +1266,10 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq framesFind->SetRootSearchFrame(rootWindow); framesFind->SetCurrentSearchFrame(focusedWindow); + webFind->SetMatchCase(inCaseSensitive ? PR_TRUE : PR_FALSE); + webFind->SetWrapFind(inWrap ? PR_TRUE : PR_FALSE); + webFind->SetFindBackwards(inBackwards ? PR_TRUE : PR_FALSE); + PRUnichar* text = (PRUnichar*)nsMemory::Alloc(([inText length]+1)*sizeof(PRUnichar)); if ( text ) { [inText getCharacters:text]; @@ -1537,7 +1542,7 @@ nsHeaderSniffer::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aReq } return dragAccepted; -} +} @end