context: function PROT_Controller(win, tabWatcher, phishingWarden) {  this.debugZone = "controller";  this.win_ = win;  this.phishingWarden_ = phishingWarden;  // Use this to query preferences  this.prefs_ = new G_Preferences();  // Read state: are we in advanced mode?  this.checkRemotePrefName_ = PROT_GlobalStore.getServerCheckEnabledPrefName();  this.checkRemote_ = this.prefs_.getPref(this.checkRemotePrefName_, null);  // Get notifications when the advanced mode preference changes  this.checkRemotePrefObserver = BindToObject(this.onCheckRemotePrefChanged,                                              this);  this.prefs_.addObserver(this.checkRemotePrefName_,                           this.checkRemotePrefObserver);  // Global preference to enable the phishing warden  this.phishWardenPrefName_ = PROT_GlobalStore.getPhishWardenEnabledPrefName();  this.phishWardenEnabled_ = this.prefs_.getPref(this.phishWardenPrefName_,                                                  null);  // Get notifications when the phishing warden enabled pref changes  this.phishWardenPrefObserver =     BindToObject(this.onPhishWardenEnabledPrefChanged, this);  this.prefs_.addObserver(this.phishWardenPrefName_,                           this.phishWardenPrefObserver);  // Set us up to receive the events we want.  this.tabWatcher_ = tabWatcher;  this.onShutdown_ = BindToObject(this.shutdown, this);  this.win_.addEventListener("unload", this.onShutdown_, false);  this.onTabSwitchCallback_ = BindToObject(this.onTabSwitch, this);  this.tabWatcher_.registerListener("tabswitch",                                    this.onTabSwitchCallback_);  // Install our command controllers. These commands are issued from  // various places in our UI, including our preferences dialog, the  // warning dialog, etc.  var commandHandlers = {     "safebrowsing-show-warning" :      BindToObject(this.onUserShowWarning, this),    "safebrowsing-accept-warning" :      BindToObject(this.onUserAcceptWarning, this),    "safebrowsing-decline-warning" :      BindToObject(this.onUserDeclineWarning, this),    "safebrowsing-submit-blacklist" :      BindToObject(this.onUserSubmitToBlacklist, this),    "safebrowsing-submit-generic-phishing" :      BindToObject(this.onUserSubmitToGenericPhish, this),    "safebrowsing-preferences" :      BindToObject(this.onUserPreferences, this),    "safebrowsing-test-link" :      BindToObject(this.showURL_, this, PROT_GlobalStore.getTestURLs()[0]),    "safebrowsing-preferences-home-link":      BindToObject(this.showURL_, this, PROT_GlobalStore.getHomePageURL()),    "safebrowsing-preferences-policy-link":      BindToObject(this.showURL_, this, PROT_GlobalStore.getPolicyURL()),    "safebrowsing-preferences-home-link-nochrome":      BindToObject(this.showURL_, this, PROT_GlobalStore.getHomePageURL(),                    true /* chromeless */),    "safebrowsing-preferences-policy-link-nochrome":      BindToObject(this.showURL_, this, PROT_GlobalStore.getPolicyURL(),                    true /* chromeless */),  };  this.commandController_ = new PROT_CommandController(commandHandlers);  this.win_.controllers.appendController(this.commandController_);  // This guy embodies the logic of when to display warnings  // (displayers embody the how).  this.browserView_ = new PROT_BrowserView(this.tabWatcher_,                                            this.win_.document);  // We need to let the phishing warden know about this browser view so it   // can be given the opportunity to handle problem documents. We also need  // to let the warden know when this window and hence this browser view  // is going away.  this.phishingWarden_.addBrowserView(this.browserView_);  this.windowWatcher_ =     Components.classes["@mozilla.org/embedcomp/window-watcher;1"]    .getService(Components.interfaces.nsIWindowWatcher);  G_Debug(this, "Controller initialized.");}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/8219c5d9d750a28e06ea1ca8d7aee25af0c64a0f/controller.js/clean/browser/components/safebrowsing/content/controller.js