Bug 849819 - Enable thumbnails for HTTPS sites when disk_cache_ssl is true [r=ally]

This commit is contained in:
Matt Brubeck 2013-03-13 16:32:40 -07:00
parent 25c4961f4b
commit 59c40f9353

View File

@ -94,6 +94,7 @@ var BrowserUI = {
window.addEventListener("MozImprecisePointer", this, true);
Services.prefs.addObserver("browser.tabs.tabsOnly", this, false);
Services.prefs.addObserver("browser.cache.disk_cache_ssl", this, false);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
// Init core UI modules
@ -528,8 +529,14 @@ var BrowserUI = {
observe: function BrowserUI_observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
if (aData == "browser.tabs.tabsOnly")
this._updateTabsOnly();
switch (aData) {
case "browser.tabs.tabsOnly":
this._updateTabsOnly();
break;
case "browser.cache.disk_cache_ssl":
this._sslDiskCacheEnabled = Services.prefs.getBoolPref(aData);
break;
}
break;
case "metro_viewstate_changed":
this._adjustDOMforViewState();
@ -881,9 +888,8 @@ var BrowserUI = {
return false;
}
// Desktop has a pref that allows users to override this. We do not
// support that pref currently
if (uri.schemeIs("https")) {
// Don't capture HTTPS pages unless the user enabled it.
if (uri.schemeIs("https") && !this.sslDiskCacheEnabled) {
return false;
}
}
@ -891,6 +897,15 @@ var BrowserUI = {
return true;
},
_sslDiskCacheEnabled: null,
get sslDiskCacheEnabled() {
if (this._sslDiskCacheEnabled === null) {
this._sslDiskCacheEnabled = Services.prefs.getBoolPref("browser.cache.disk_cache_ssl");
}
return this._sslDiskCacheEnabled;
},
supportsCommand : function(cmd) {
var isSupported = false;
switch (cmd) {