Diff for /chimera/BrowserWindowController.mm between versions 1.63 and 1.67

version 1.63, 2002/04/14 21:41:21 version 1.67, 2002/04/17 10:30:13
Line 44 Line 44
 #include "nsIDOMEvent.h"  #include "nsIDOMEvent.h"
 #include "nsIPrefBranch.h"  #include "nsIPrefBranch.h"
 #include "nsIContextMenuListener.h"  #include "nsIContextMenuListener.h"
   #include "nsIDOMWindow.h"
   #include "nsIScriptGlobalObject.h"
   #include "nsIDocShell.h"
   #include "nsIMarkupDocumentViewer.h"
   #include "nsIContentViewer.h"
 #include "nsCocoaBrowserService.h"  #include "nsCocoaBrowserService.h"
 #include "nsString.h"  #include "nsString.h"
 #include "GeckoUtils.h"  #include "GeckoUtils.h"
Line 155  static NSString *PrintToolbarItemIdentif Line 160  static NSString *PrintToolbarItemIdentif
 {  {
     [super windowDidLoad];      [super windowDidLoad];
   
     [[mURLBar cell] setImage: [NSImage imageNamed:@"smallbookmark"]];
     
     // Get our saved dimensions.      // Get our saved dimensions.
     [[self window] setFrameUsingName: @"NavigatorWindow"];      [[self window] setFrameUsingName: @"NavigatorWindow"];
           
Line 173  static NSString *PrintToolbarItemIdentif Line 180  static NSString *PrintToolbarItemIdentif
     [[self window] setAcceptsMouseMovedEvents: YES];      [[self window] setAcceptsMouseMovedEvents: YES];
           
     [self setupToolbar];      [self setupToolbar];
    
 //  03/03/2002 mlj Changing strategy a bit here.  The addTab: method was  //  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.  //      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.  //      We now remove the IB tab, then add one of our own.
Line 189  static NSString *PrintToolbarItemIdentif Line 196  static NSString *PrintToolbarItemIdentif
     [mSidebarDrawer setDelegate: self];      [mSidebarDrawer setDelegate: self];
   
     [self setupSidebarTabs];      [self setupSidebarTabs];
   
       [mPersonalToolbar initializeToolbar];
 }  }
   
 - (void)drawerWillOpen: (NSNotification*)aNotification  - (void)drawerWillOpen: (NSNotification*)aNotification
Line 196  static NSString *PrintToolbarItemIdentif Line 205  static NSString *PrintToolbarItemIdentif
   [mSidebarBookmarksDataSource ensureBookmarks];    [mSidebarBookmarksDataSource ensureBookmarks];
   
   // Force the window to shrink and move if necessary in order to accommodate the sidebar.    // Force the window to shrink and move if necessary in order to accommodate the sidebar.
  NSRect screenFrame = [[[self window] screen] frame];  NSRect screenFrame = [[[self window] screen] visibleFrame];
   NSRect windowFrame = [[self window] frame];    NSRect windowFrame = [[self window] frame];
   NSSize drawerSize = [mSidebarDrawer contentSize];    NSSize drawerSize = [mSidebarDrawer contentSize];
   int fudgeFactor = 12; // Not sure how to get the drawer's border info, so we fudge it for now.    int fudgeFactor = 12; // Not sure how to get the drawer's border info, so we fudge it for now.
Line 714  static NSString *PrintToolbarItemIdentif Line 723  static NSString *PrintToolbarItemIdentif
   mChromeMask = aMask;    mChromeMask = aMask;
 }  }
   
   -(void) biggerTextSize
   {
     nsCOMPtr<nsIDOMWindow> contentWindow = getter_AddRefs([[mBrowserView getBrowserView] getContentWindow]);
     nsCOMPtr<nsIScriptGlobalObject> global(do_QueryInterface(contentWindow));
     if (!global)
       return;
     nsCOMPtr<nsIDocShell> docShell;
     global->GetDocShell(getter_AddRefs(docShell));
     if (!docShell)
       return;
     nsCOMPtr<nsIContentViewer> cv;
     docShell->GetContentViewer(getter_AddRefs(cv));
     nsCOMPtr<nsIMarkupDocumentViewer> markupViewer(do_QueryInterface(cv));
     if (!markupViewer)
       return;
     float zoom;
     markupViewer->GetTextZoom(&zoom);
     if (zoom >= 20)
       return;
     
     zoom += 0.25;
     if (zoom > 20)
       zoom = 20;
     
     markupViewer->SetTextZoom(zoom);
   }
   
   -(void) smallerTextSize
   {
     nsCOMPtr<nsIDOMWindow> contentWindow = getter_AddRefs([[mBrowserView getBrowserView] getContentWindow]);
     nsCOMPtr<nsIScriptGlobalObject> global(do_QueryInterface(contentWindow));
     if (!global)
       return;
     nsCOMPtr<nsIDocShell> docShell;
     global->GetDocShell(getter_AddRefs(docShell));
     if (!docShell)
       return;
     nsCOMPtr<nsIContentViewer> cv;
     docShell->GetContentViewer(getter_AddRefs(cv));
     nsCOMPtr<nsIMarkupDocumentViewer> markupViewer(do_QueryInterface(cv));
     if (!markupViewer)
       return;
     float zoom;
     markupViewer->GetTextZoom(&zoom);
     if (zoom <= 0.01)
       return;
   
     zoom -= 0.25;
     if (zoom < 0.01)
       zoom = 0.01;
   
     markupViewer->SetTextZoom(zoom);
   }
   
 -(id)getAddBookmarkSheetWindow  -(id)getAddBookmarkSheetWindow
 {  {
   return mAddBookmarkSheetWindow;    return mAddBookmarkSheetWindow;

Removed from v.1.63  
changed lines
  Added in v.1.67


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