Diff for /chimera/NSBrowserView.mm between versions 1.3 and 1.15

version 1.3, 2002/02/03 06:26:15 version 1.15, 2002/02/05 09:51:56
Line 37 Line 37
   
 #import "NSBrowserView.h"  #import "NSBrowserView.h"
 #import "ProgressDlgController.h"  #import "ProgressDlgController.h"
   #import "FindDlgController.h"
 #import "nsCocoaBrowserService.h"  #import "nsCocoaBrowserService.h"
   
 // Embedding includes  // Embedding includes
Line 56 Line 57
 #include "nsXPIDLString.h"  #include "nsXPIDLString.h"
 #include "nsCOMPtr.h"  #include "nsCOMPtr.h"
   
   // Printing
   #include "nsIWebBrowserPrint.h"
   #include "nsIPrintSettings.h"
   
   // Saving of links/images/docs
 #include "nsIWebBrowserFocus.h"  #include "nsIWebBrowserFocus.h"
 #include "nsIDOMHTMLDocument.h"  #include "nsIDOMHTMLDocument.h"
 #include "nsIDocument.h"  #include "nsIDocument.h"
Line 72 Line 78
 #include "nsIHistoryEntry.h"  #include "nsIHistoryEntry.h"
 #include "nsISHEntry.h"  #include "nsISHEntry.h"
   
   // Cut/copy/paste
   #include "nsIClipboardCommands.h"
   #include "nsIInterfaceRequestorUtils.h"
   
   const char* persistContractID = "@mozilla.org/embedding/browser/nsWebBrowserPersist;1";
   const char* dirServiceContractID = "@mozilla.org/file/directory_service;1";
   
 class nsCocoaBrowserListener : public nsSupportsWeakReference,  class nsCocoaBrowserListener : public nsSupportsWeakReference,
                                public nsIInterfaceRequestor,                                 public nsIInterfaceRequestor,
                                public nsIWebBrowserChrome,                                 public nsIWebBrowserChrome,
Line 602  public: Line 615  public:
         mFilterList = aFilterList;          mFilterList = aFilterList;
     }      }
                                       
    virtual ~nsHeaderSniffer() {};    virtual ~nsHeaderSniffer() 
     {
     };
   
     NS_DECL_ISUPPORTS      NS_DECL_ISUPPORTS
     NS_DECL_NSIWEBPROGRESSLISTENER      NS_DECL_NSIWEBPROGRESSLISTENER
Line 800  void nsHeaderSniffer::PerformSave() Line 815  void nsHeaderSniffer::PerformSave()
     else      else
         sourceData = do_QueryInterface(mURL);          sourceData = do_QueryInterface(mURL);
                   
       nsCOMPtr<nsIWebBrowserPersist> webPersist(do_CreateInstance(persistContractID));
     ProgressDlgController* progressDialog = [[ProgressDlgController alloc] initWithWindowNibName: @"ProgressDialog"];      ProgressDlgController* progressDialog = [[ProgressDlgController alloc] initWithWindowNibName: @"ProgressDialog"];
    [progressDialog setWebPersist: mPersist     [progressDialog setWebPersist: webPersist 
                     source: sourceData.get()                      source: sourceData.get()
                     destination: [savePanel filename]                      destination: [savePanel filename]
                     contentType: mContentType.get()                      contentType: mContentType.get()
Line 892  nsHeaderSniffer::OnSecurityChange(nsIWeb Line 908  nsHeaderSniffer::OnSecurityChange(nsIWeb
   return self;    return self;
 }  }
   
   - (void)destroyWebBrowser
   {
     nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(_webBrowser);
     baseWin->Destroy();
   }
   
 - (void)dealloc   - (void)dealloc 
 {  {
   NS_RELEASE(_listener);    NS_RELEASE(_listener);
   NS_IF_RELEASE(_webBrowser);    NS_IF_RELEASE(_webBrowser);
  nsCocoaBrowserService::TermEmbedding();  
  nsCocoaBrowserService::BrowserClosed();
   
   [super dealloc];    [super dealloc];
 }  }
   
Line 1089  nsHeaderSniffer::OnSecurityChange(nsIWeb Line 1112  nsHeaderSniffer::OnSecurityChange(nsIWeb
   
 }  }
   
 const char* persistContractID = "@mozilla.org/embedding/browser/nsWebBrowserPersist;1";  
 const char* dirServiceContractID = "@mozilla.org/file/directory_service;1";  
   
 -(void) saveInternal: (nsIURI*)aURI  -(void) saveInternal: (nsIURI*)aURI
         withDocument: (nsIDOMDocument*)aDocument          withDocument: (nsIDOMDocument*)aDocument
         bypassCache: (BOOL)aBypassCache          bypassCache: (BOOL)aBypassCache
Line 1140  const char* dirServiceContractID = "@moz Line 1160  const char* dirServiceContractID = "@moz
     webPersist->SaveURI(aURI, nsnull, tmpFile);      webPersist->SaveURI(aURI, nsnull, tmpFile);
 }  }
   
   -(void)printDocument
   {
       nsCOMPtr<nsIDOMWindow> domWindow;
       _webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
       nsCOMPtr<nsIInterfaceRequestor> ir(do_QueryInterface(domWindow));
       nsCOMPtr<nsIWebBrowserPrint> print;
       ir->GetInterface(NS_GET_IID(nsIWebBrowserPrint), getter_AddRefs(print));
       print->Print(nsnull, nsnull);
   }
   
   -(void)printPreview
   {
       nsCOMPtr<nsIDOMWindow> domWindow;
       _webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
       nsCOMPtr<nsIInterfaceRequestor> ir(do_QueryInterface(domWindow));
       nsCOMPtr<nsIWebBrowserPrint> print;
       ir->GetInterface(NS_GET_IID(nsIWebBrowserPrint), getter_AddRefs(print));
       print->PrintPreview(nsnull);
   }
   
   -(void)findInPage
   {
       NSLog(@"Got here?!");
       FindDlgController* findDialog = [[FindDlgController alloc] initWithWindowNibName: @"FindDialog"];
       [findDialog showWindow: findDialog];
   }
   
   -(void)findAgain
   {
   }
   
 -(void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList  -(void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
 {  {
     nsCOMPtr<nsIWebBrowserFocus> wbf(do_QueryInterface(_webBrowser));      nsCOMPtr<nsIWebBrowserFocus> wbf(do_QueryInterface(_webBrowser));
Line 1167  const char* dirServiceContractID = "@moz Line 1218  const char* dirServiceContractID = "@moz
           filterList: aFilterList];            filterList: aFilterList];
 }  }
   
   
   -(IBAction)cut:(id)aSender
   {
       nsCOMPtr<nsIClipboardCommands> clipboard(do_GetInterface(_webBrowser));
       clipboard->CutSelection();
   }
   
   -(IBAction)copy:(id)aSender
   {
       nsCOMPtr<nsIClipboardCommands> clipboard(do_GetInterface(_webBrowser));
       clipboard->CopySelection();
   }
   
   -(IBAction)paste:(id)aSender
   {
       nsCOMPtr<nsIClipboardCommands> clipboard(do_GetInterface(_webBrowser));
       clipboard->Paste();
   }
   
   -(IBAction)clear:(id)aSender
   {
       nsCOMPtr<nsIClipboardCommands> clipboard(do_GetInterface(_webBrowser));
       clipboard->SelectNone();
   }
   
   -(IBAction)selectAll:(id)aSender
   {
       nsCOMPtr<nsIClipboardCommands> clipboard(do_GetInterface(_webBrowser));
       clipboard->SelectAll();
   }
   
 @end  @end
   

Removed from v.1.3  
changed lines
  Added in v.1.15


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>