Bug 1008620 - Clearing history should also clear jump list cache on Windows. r=bbondy

This commit is contained in:
Ashutosh Dhundhara 2014-09-23 20:57:40 -04:00
parent 5e7f3a1714
commit 3a42e94274
3 changed files with 10 additions and 0 deletions

View File

@ -383,6 +383,7 @@ var gAdvancedPane = {
cache.clear();
} catch(ex) {}
this.updateActualCacheSize();
Services.obs.notifyObservers(null, "clear-private-data", null);
},
/**
@ -395,6 +396,7 @@ var gAdvancedPane = {
this.updateActualAppCacheSize();
this.updateOfflineApps();
Services.obs.notifyObservers(null, "clear-private-data", null);
},
readOfflineNotify: function()

View File

@ -560,6 +560,7 @@ var gPrivacyPane = {
// reset the timeSpan pref
if (aClearEverything)
ts.value = timeSpanOrig;
Services.obs.notifyObservers(null, "clear-private-data", null);
},
/**

View File

@ -43,6 +43,7 @@ const char kPrefTaskbarEnabled[] = "browser.taskbar.lists.enabled";
NS_IMPL_ISUPPORTS(JumpListBuilder, nsIJumpListBuilder, nsIObserver)
#define TOPIC_PROFILE_BEFORE_CHANGE "profile-before-change"
#define TOPIC_CLEAR_PRIVATE_DATA "clear-private-data"
JumpListBuilder::JumpListBuilder() :
mMaxItems(0),
@ -63,6 +64,7 @@ JumpListBuilder::JumpListBuilder() :
do_GetService("@mozilla.org/observer-service;1");
if (observerService) {
observerService->AddObserver(this, TOPIC_PROFILE_BEFORE_CHANGE, false);
observerService->AddObserver(this, TOPIC_CLEAR_PRIVATE_DATA, false);
}
}
@ -537,6 +539,11 @@ NS_IMETHODIMP JumpListBuilder::Observe(nsISupports* aSubject,
new mozilla::widget::AsyncDeleteAllFaviconsFromDisk();
mIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
}
} else if (strcmp(aTopic, TOPIC_CLEAR_PRIVATE_DATA) == 0) {
// Delete JumpListCache icons from Disk, if any.
nsCOMPtr<nsIRunnable> event =
new mozilla::widget::AsyncDeleteAllFaviconsFromDisk(false);
mIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
}
return NS_OK;
}