OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 BrowserContext::GetDefaultStoragePartition(profile_)-> | 399 BrowserContext::GetDefaultStoragePartition(profile_)-> |
400 GetQuotaManager(); | 400 GetQuotaManager(); |
401 } | 401 } |
402 waiting_for_clear_quota_managed_data_ = true; | 402 waiting_for_clear_quota_managed_data_ = true; |
403 BrowserThread::PostTask( | 403 BrowserThread::PostTask( |
404 BrowserThread::IO, FROM_HERE, | 404 BrowserThread::IO, FROM_HERE, |
405 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, | 405 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, |
406 base::Unretained(this))); | 406 base::Unretained(this))); |
407 } | 407 } |
408 | 408 |
| 409 #if defined(ENABLE_PLUGINS) |
409 // Plugin is data not separated for protected and unprotected web origins. We | 410 // Plugin is data not separated for protected and unprotected web origins. We |
410 // check the origin_set_mask_ to prevent unintended deletion. | 411 // check the origin_set_mask_ to prevent unintended deletion. |
411 if (remove_mask & REMOVE_PLUGIN_DATA && | 412 if (remove_mask & REMOVE_PLUGIN_DATA && |
412 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { | 413 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { |
413 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); | 414 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); |
414 | 415 |
415 waiting_for_clear_plugin_data_ = true; | 416 waiting_for_clear_plugin_data_ = true; |
416 if (!plugin_data_remover_.get()) | 417 if (!plugin_data_remover_.get()) |
417 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_)); | 418 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_)); |
418 base::WaitableEvent* event = | 419 base::WaitableEvent* event = |
419 plugin_data_remover_->StartRemoving(delete_begin_); | 420 plugin_data_remover_->StartRemoving(delete_begin_); |
420 watcher_.StartWatching(event, this); | 421 watcher_.StartWatching(event, this); |
421 } | 422 } |
| 423 #endif |
422 | 424 |
423 if (remove_mask & REMOVE_PASSWORDS) { | 425 if (remove_mask & REMOVE_PASSWORDS) { |
424 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 426 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
425 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( | 427 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( |
426 profile_, Profile::EXPLICIT_ACCESS); | 428 profile_, Profile::EXPLICIT_ACCESS); |
427 | 429 |
428 if (password_store) | 430 if (password_store) |
429 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); | 431 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); |
430 } | 432 } |
431 | 433 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 BrowserThread::UI, FROM_HERE, | 1010 BrowserThread::UI, FROM_HERE, |
1009 base::Bind(&BrowsingDataRemover::OnClearedFormData, | 1011 base::Bind(&BrowsingDataRemover::OnClearedFormData, |
1010 base::Unretained(this))); | 1012 base::Unretained(this))); |
1011 } | 1013 } |
1012 | 1014 |
1013 void BrowsingDataRemover::OnClearedFormData() { | 1015 void BrowsingDataRemover::OnClearedFormData() { |
1014 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1016 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1015 waiting_for_clear_form_ = false; | 1017 waiting_for_clear_form_ = false; |
1016 NotifyAndDeleteIfDone(); | 1018 NotifyAndDeleteIfDone(); |
1017 } | 1019 } |
OLD | NEW |