Diff for /chimera/BrowserWindowController.mm between versions 1.61 and 1.62

version 1.61, 2002/04/14 00:08:17 version 1.62, 2002/04/14 08:43:03
Line 447  static NSString *PrintToolbarItemIdentif Line 447  static NSString *PrintToolbarItemIdentif
   
 - (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList  - (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
 {  {
    [[mBrowserView getBrowserView] saveDocument: aFilterView filterList: aFilterList];  [[mBrowserView getBrowserView] saveDocument: aFilterView filterList: aFilterList];
 }
 
 - (void)saveURL: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
             url: (NSURL*)aURL suggestedFilename: (NSString*)aFilename
 {
   [[mBrowserView getBrowserView] saveURL: aFilterView filterList: aFilterList
                                      url: aURL suggestedFilename: aFilename];
 }  }
   
 - (void)printDocument  - (void)printDocument
Line 465  static NSString *PrintToolbarItemIdentif Line 472  static NSString *PrintToolbarItemIdentif
     return [[mBrowserView getBrowserView] findInPage:text];      return [[mBrowserView getBrowserView] findInPage:text];
 }  }
   
- (void)addBookmark- (void)addBookmarkExtended: (BOOL)aIsFromMenu
 {  {
    // XXXdwh Hack.  Just go to the sidebar for now until we get our  [mSidebarBookmarksDataSource ensureBookmarks];
    // menu data source going.  [mSidebarBookmarksDataSource addBookmark: self useSelection: !aIsFromMenu];
    [mSidebarBookmarksDataSource ensureBookmarks]; 
    [mSidebarBookmarksDataSource addBookmark: self]; 
 }  }
   
 - (IBAction)back:(id)aSender  - (IBAction)back:(id)aSender
Line 621  static NSString *PrintToolbarItemIdentif Line 626  static NSString *PrintToolbarItemIdentif
   [browser loadURL: aURL];    [browser loadURL: aURL];
   if (aLoadInBG)    if (aLoadInBG)
     [[browser window] orderWindow: NSWindowBelow relativeTo: [[self window] windowNumber]];      [[browser window] orderWindow: NSWindowBelow relativeTo: [[self window] windowNumber]];
  else  else {
     // Focus the content area and show the window.      // Focus the content area and show the window.
    [browser showWindow: self];    [browser enterModalSession];
     [[[browser getMyBrowserView] getBrowserView] setActive: YES];
   }
 }  }
   
 -(void)openNewTabWithURL: (NSURL*)aURL loadInBackground: (BOOL)aLoadInBG  -(void)openNewTabWithURL: (NSURL*)aURL loadInBackground: (BOOL)aLoadInBG
Line 744  static NSString *PrintToolbarItemIdentif Line 751  static NSString *PrintToolbarItemIdentif
     [self openNewTabWithURL: urlToLoad loadInBackground: loadInBackground];      [self openNewTabWithURL: urlToLoad loadInBackground: loadInBackground];
 }  }
   
   - (IBAction)savePageAs:(id)aSender
   {
     [self saveDocument: nil filterList: nil];
   }
   
 - (IBAction)saveLinkAs:(id)aSender  - (IBAction)saveLinkAs:(id)aSender
 {  {
     nsCOMPtr<nsIDOMElement> linkContent;
     nsAutoString href;
     GeckoUtils::GetEnclosingLinkElementAndHref(mContextMenuNode, getter_AddRefs(linkContent), href);
   
     // XXXdwh Handle simple XLINKs if we want to be compatible with Mozilla, but who
     // really uses these anyway? :)
     if (!linkContent || href.IsEmpty())
       return;
   
     NSString* hrefStr = [NSString stringWithCharacters: href.get() length:nsCRT::strlen(href.get())];
     NSURL* urlToSave = [NSURL URLWithString: hrefStr];
   
     // The user wants to save this link.
     nsAutoString text;
     GeckoUtils::GatherTextUnder(mContextMenuNode, text);
   
     [self saveURL: nil filterList: nil
               url: urlToSave suggestedFilename: [NSString stringWithCharacters: text.get()
                                                                         length:nsCRT::strlen(text.get())]];
 }  }
   
 - (IBAction)saveImageAs:(id)aSender  - (IBAction)saveImageAs:(id)aSender
 {  {
     nsCOMPtr<nsIDOMHTMLImageElement> imgElement(do_QueryInterface(mContextMenuNode));
     if (imgElement) {
         nsAutoString text;
         imgElement->GetAttribute(NS_LITERAL_STRING("src"), text);
         nsAutoString url;
         imgElement->GetSrc(url);
   
         NSString* hrefStr = [NSString stringWithCharacters: url.get() length:nsCRT::strlen(url.get())];
         NSURL* urlToSave = [NSURL URLWithString: hrefStr];
   
         [self saveURL: nil filterList: nil
                   url: urlToSave suggestedFilename: [NSString stringWithCharacters: text.get()
                                                                             length:nsCRT::strlen(text.get())]];
     }
   }
   
   - (IBAction)viewOnlyThisImage:(id)aSender
   {
     nsCOMPtr<nsIDOMHTMLImageElement> imgElement(do_QueryInterface(mContextMenuNode));
     if (imgElement) {
       nsAutoString url;
       imgElement->GetSrc(url);
   
       NSString* urlStr = [NSString stringWithCharacters: url.get() length:nsCRT::strlen(url.get())];
       NSURL* urlToView = [NSURL URLWithString: urlStr];
   
       [self loadURL: urlToView];
   
       // Focus and activate our content area.
       [[mBrowserView getBrowserView] setActive: YES];
     }  
 }  }
   
 @end  @end

Removed from v.1.61  
changed lines
  Added in v.1.62


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