Diff for /chimera/MyBrowserView.mm between versions 1.30 and 1.33

version 1.30, 2002/04/12 09:56:34 version 1.33, 2002/04/20 00:02:55
Line 94  static const char* ioServiceContractID = Line 94  static const char* ioServiceContractID =
     [browserView setActive: NO];      [browserView setActive: NO];
 }  }
   
   -(id)initWithTab:(id)aTab andWindow: (NSWindow*)aWindow
   {
     mTab = aTab;
     mWindow = aWindow;
     return [self initWithFrame: NSZeroRect];
   }
   
 - (id)initWithFrame:(NSRect)frameRect  - (id)initWithFrame:(NSRect)frameRect
 {  {
     [super initWithFrame: frameRect];      [super initWithFrame: frameRect];
     browserView = [[[NSBrowserView alloc] initWithFrame:[self bounds]] autorelease];    browserView = [[[NSBrowserView alloc] initWithFrame:[self bounds] andWindow: [self getNativeWindow]] autorelease];
     [self addSubview:browserView];      [self addSubview:browserView];
     [browserView setContainer:self];      [browserView setContainer:self];
     [browserView addListener:self];      [browserView addListener:self];
Line 121  static const char* ioServiceContractID = Line 128  static const char* ioServiceContractID =
   mWindowController = aWindowController;    mWindowController = aWindowController;
       
   if (!mIsBusy)    if (!mIsBusy)
      [progress removeFromSuperview];    [progress removeFromSuperview];
       
   defaultStatus = NULL;    defaultStatus = NULL;
   loadingStatus = DOCUMENT_DONE_STRING;    loadingStatus = DOCUMENT_DONE_STRING;
Line 205  static const char* ioServiceContractID = Line 212  static const char* ioServiceContractID =
       
   if (mWindowController)    if (mWindowController)
     [mWindowController updateToolbarItems];      [mWindowController updateToolbarItems];
     else {
       printf("background load.\n");
     }
 }  }
   
 - (void)onLoadingCompleted:(BOOL)succeeded  - (void)onLoadingCompleted:(BOOL)succeeded
Line 317  static const char* ioServiceContractID = Line 327  static const char* ioServiceContractID =
   return [mWindowController getContextMenu];    return [mWindowController getContextMenu];
 }  }
   
   -(NSWindow*)getNativeWindow
   {
     NSWindow* window = [self window];
     if (window)
       return window;
   
     if (mWindow)
       return mWindow;
     
     return nil;
   }
   
 - (void)offlineModeChanged: (NSNotification*)aNotification  - (void)offlineModeChanged: (NSNotification*)aNotification
 {  {
     nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));      nsCOMPtr<nsIIOService> ioService(do_GetService(ioServiceContractID));
Line 350  static const char* ioServiceContractID = Line 372  static const char* ioServiceContractID =
 }  }
   
 #define NS_POPUP_BLOCK @"This Web site is attempting to open an unrequested popup window.  Navigator can \  #define NS_POPUP_BLOCK @"This Web site is attempting to open an unrequested popup window.  Navigator can \
automatically prevent Web sites from opening popup advertisements.  Would you like to turn on \automatically prevent Web sites from opening popup advertisements.  Click OK to prevent all \
popup blocking now?"unrequested popups (including this one) from opening."
   
 - (NSBrowserView*)createBrowserWindow:(unsigned int)aMask  - (NSBrowserView*)createBrowserWindow:(unsigned int)aMask
 {  {
Line 371  popup blocking now?" Line 393  popup blocking now?"
       // A popup is being opened while the page is currently loading.  Offer to block the        // A popup is being opened while the page is currently loading.  Offer to block the
       // popup.        // popup.
       nsAlertController* controller = nsCocoaBrowserService::GetAlertController();        nsAlertController* controller = nsCocoaBrowserService::GetAlertController();
      BOOL checkValue = YES;      BOOL confirm = [controller confirm: [self window] title: @"Unrequested Popup Detected"
      BOOL confirm = [controller confirmCheck: [self window] title: @"Unrequested Popup Detected"                                text: NS_POPUP_BLOCK];
                                text: NS_POPUP_BLOCK
                                checkMsg:@"Always ask before opening unrequested popups." checkValue: &checkValue];      // This is a one-time dialog.
      PRBool needToSave = PR_FALSE;      pref->SetBoolPref("browser.popups.showPopupBlocker", PR_FALSE);
      if (checkValue != showBlocker) { 
        needToSave = PR_TRUE; 
        pref->SetBoolPref("browser.popups.showPopupBlocker", checkValue); 
      } 
               
       if (confirm) {        if (confirm) {
         needToSave = PR_TRUE;  
         pref->SetBoolPref("dom.disable_open_during_load", PR_TRUE);          pref->SetBoolPref("dom.disable_open_during_load", PR_TRUE);
         pref->SetIntPref("dom.disable_open_click_delay", 1000);          pref->SetIntPref("dom.disable_open_click_delay", 1000);
       }        }
   
      if (needToSave) {      nsCOMPtr<nsIPrefService> prefService(do_QueryInterface(pref));
        nsCOMPtr<nsIPrefService> prefService(do_QueryInterface(pref));      prefService->SavePrefFile(nsnull);
        prefService->SavePrefFile(nsnull); 
      } 
               
       if (confirm)        if (confirm)
         return nil;          return nil;
Line 401  popup blocking now?" Line 416  popup blocking now?"
   [controller setChromeMask: aMask];    [controller setChromeMask: aMask];
   [controller disableAutosave]; // The Web page opened this window, so we don't ever use its settings.    [controller disableAutosave]; // The Web page opened this window, so we don't ever use its settings.
   [controller enterModalSession];    [controller enterModalSession];
     [[[controller getMyBrowserView] getBrowserView] setActive: YES];
   return [[controller getMyBrowserView] getBrowserView];    return [[controller getMyBrowserView] getBrowserView];
 }  }
   

Removed from v.1.30  
changed lines
  Added in v.1.33


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