Diff for /chimera/ContentClickListener.mm between versions 1.3 and 1.6

version 1.3, 2002/03/08 01:43:01 version 1.6, 2002/03/09 03:34:51
Line 49 Line 49
 #include "nsIDOMHTMLAnchorElement.h"  #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLAreaElement.h"  #include "nsIDOMHTMLAreaElement.h"
 #include "nsIDOMHTMLLinkElement.h"  #include "nsIDOMHTMLLinkElement.h"
   #include "nsIDOMHTMLImageElement.h"
   #include "nsIDOMCharacterData.h"
   
   // Common helper routines (also used by the context menu code)
   #include "GeckoUtils.h"
   
 NS_IMPL_ISUPPORTS2(ContentClickListener, nsIDOMMouseListener, nsIDOMEventListener);  NS_IMPL_ISUPPORTS2(ContentClickListener, nsIDOMMouseListener, nsIDOMEventListener);
   
Line 147  ContentClickListener::MouseClick(nsIDOME Line 152  ContentClickListener::MouseClick(nsIDOME
   mouseEvent->GetButton(&button);    mouseEvent->GetButton(&button);
   switch (button) {    switch (button) {
     case 0: {      case 0: {
      PRBool metaKey, shiftKey;      PRBool metaKey, shiftKey, altKey;
       mouseEvent->GetMetaKey(&metaKey);        mouseEvent->GetMetaKey(&metaKey);
       mouseEvent->GetShiftKey(&shiftKey);        mouseEvent->GetShiftKey(&shiftKey);
         mouseEvent->GetAltKey(&altKey);
       if (metaKey) {        if (metaKey) {
         // The command key is down.  Open the link in a new window or tab.          // The command key is down.  Open the link in a new window or tab.
         PRBool useTab;          PRBool useTab;
Line 158  ContentClickListener::MouseClick(nsIDOME Line 164  ContentClickListener::MouseClick(nsIDOME
         pref->GetBoolPref("browser.tabs.loadInBackground", &loadInBackground);          pref->GetBoolPref("browser.tabs.loadInBackground", &loadInBackground);
         if (shiftKey)          if (shiftKey)
           loadInBackground = !loadInBackground;            loadInBackground = !loadInBackground;
        if (useTab) {        if (useTab)
                    [mBrowserController openNewTabWithURL: urlToLoad loadInBackground: loadInBackground];
        } 
         else          else
           [mBrowserController openNewWindowWithURL: urlToLoad loadInBackground: loadInBackground];            [mBrowserController openNewWindowWithURL: urlToLoad loadInBackground: loadInBackground];
       }        }
         else if (altKey) {
           // The user wants to save this link.
           nsAutoString text;
           GeckoUtils::GatherTextUnder(content, text);
           
         }
     }      }
   }    }
           

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


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