Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: chrome/browser/browsing_data_remover.cc

Issue 7040015: Add a hook to clear Gears Plugin Data in the "Clear browsing data" tool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: shutdown hook Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browsing_data_remover.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data_remover.cc
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
index 12e1ef3e10db8300ccac55999ce51f05710bf60d..8ae410b83a756b2767d9f1b5382c8aa7e94ff5ec 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -8,6 +8,7 @@
#include <set>
#include "base/callback.h"
+#include "base/file_util.h"
#include "chrome/browser/autofill/personal_data_manager.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
@@ -72,7 +73,8 @@ BrowsingDataRemover::BrowsingDataRemover(Profile* profile,
waiting_for_clear_history_(false),
waiting_for_clear_networking_history_(false),
waiting_for_clear_cache_(false),
- waiting_for_clear_appcache_(false) {
+ waiting_for_clear_appcache_(false),
+ waiting_for_clear_gears_data_(false) {
DCHECK(profile);
}
@@ -101,7 +103,8 @@ BrowsingDataRemover::BrowsingDataRemover(Profile* profile,
waiting_for_clear_networking_history_(false),
waiting_for_clear_cache_(false),
waiting_for_clear_appcache_(false),
- waiting_for_clear_lso_data_(false) {
+ waiting_for_clear_lso_data_(false),
+ waiting_for_clear_gears_data_(false) {
DCHECK(profile);
}
@@ -201,6 +204,14 @@ void BrowsingDataRemover::Remove(int remove_mask) {
this,
&BrowsingDataRemover::ClearAppCacheOnIOThread));
+ waiting_for_clear_gears_data_ = true;
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ this,
+ &BrowsingDataRemover::ClearGearsDataOnFILEThread,
+ profile_->GetPath()));
+
// TODO(michaeln): delete temporary file system data too
BrowserThread::PostTask(
@@ -515,6 +526,34 @@ ChromeAppCacheService* BrowsingDataRemover::GetAppCacheService() {
: NULL;
}
+// static
+void BrowsingDataRemover::ClearGearsData(const FilePath& profile_dir) {
+ FilePath plugin_data = profile_dir.AppendASCII("Plugin Data");
+ if (file_util::DirectoryExists(plugin_data))
+ file_util::Delete(plugin_data, true);
+}
+
+void BrowsingDataRemover::OnClearedGearsData() {
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ bool result = BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &BrowsingDataRemover::OnClearedGearsData));
+ DCHECK(result);
+ return;
+ }
+ waiting_for_clear_gears_data_ = false;
+ NotifyAndDeleteIfDone();
+}
+
+void BrowsingDataRemover::ClearGearsDataOnFILEThread(
+ const FilePath& profile_dir) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK(waiting_for_clear_gears_data_);
+
+ ClearGearsData(profile_dir);
+ OnClearedGearsData();
+}
+
void BrowsingDataRemover::OnWaitableEventSignaled(
base::WaitableEvent* waitable_event) {
waiting_for_clear_lso_data_ = false;
« no previous file with comments | « chrome/browser/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698