B2G/gecko/browser/base/content/browser-fullZoom.js
/**
   * Called when the location of a tab changes.
   * When that happens, we need to update the current zoom level if appropriate.
   *
   * @param aURI
   *        A URI object representing the new location.
   * @param aIsTabSwitch
   *        Whether this location change has happened because of a tab switch.
   * @param aBrowser
   *        (optional) browser object displaying the document
   */
Called when the location of a tab changes.
When that happens, we need to update the current zoom level if appropriate.

@param aURI
A URI object representing the new location.
@param aIsTabSwitch
Whether this location change has happened because of a tab switch.
@param aBrowser
(optional) browser object displaying the document
Called when the location of a tab changes . When that happens we need to update the current zoom level if appropriate . @param aURI A URI object representing the new location . @param aIsTabSwitch Whether this location change has happened because of a tab switch . @param aBrowser ( optional ) browser object displaying the document
function FullZoom_onLocationChange(aURI, aIsTabSwitch, aBrowser) {
    if (!aURI || (aIsTabSwitch && !this.siteSpecific))
      return;
    if (aURI.spec == "about:blank") {
      this._applyPrefToSetting(undefined, aBrowser);
      return;
    }
    let browser = aBrowser || gBrowser.selectedBrowser;
    if (!aIsTabSwitch && browser.contentDocument.mozSyntheticDocument) {
      ZoomManager.setZoomForBrowser(browser, 1);
      return;
    }
    if (Services.contentPrefs.hasCachedPref(aURI, this.name)) {
      let zoomValue = Services.contentPrefs.getPref(aURI, this.name);
      this._applyPrefToSetting(zoomValue, browser);
    } else {
      var self = this;
      Services.contentPrefs.getPref(aURI, this.name, function (aResult) {
        if (browser.currentURI && aURI.equals(browser.currentURI)) {
          self._applyPrefToSetting(aResult, browser);
        }
      });
    }
  }
function FullZoom_onLocationChange ( aURI , aIsTabSwitch , aBrowser ) { if ( ! aURI || ( aIsTabSwitch && ! this . siteSpecific ) ) return ; if ( aURI . spec == "about:blank" ) { this . _applyPrefToSetting ( undefined , aBrowser ) ; return ; } let browser = aBrowser || gBrowser . selectedBrowser ; if ( ! aIsTabSwitch && browser . contentDocument . mozSyntheticDocument ) { ZoomManager . setZoomForBrowser ( browser , 1 ) ; return ; } if ( Services . contentPrefs . hasCachedPref ( aURI , this . name ) ) { let zoomValue = Services . contentPrefs . getPref ( aURI , this . name ) ; this . _applyPrefToSetting ( zoomValue , browser ) ; } else { var self = this ; Services . contentPrefs . getPref ( aURI , this . name , function ( aResult ) { if ( browser . currentURI && aURI . equals ( browser . currentURI ) ) { self . _applyPrefToSetting ( aResult , browser ) ; } } ) ; } }
Called when the location of a tab changes.
Called when the location of a tab changes .
// Avoid the cps roundtrip and apply the default/global pref. // Media documents should always start at 1, and are not affected by prefs. // Check that we're still where we expect to be in case this took a while. // Null check currentURI, since the window may have been destroyed before // we were called.