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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // check the origin_set_mask_ to prevent unintended deletion. | 411 // check the origin_set_mask_ to prevent unintended deletion. |
412 if (remove_mask & REMOVE_PLUGIN_DATA && | 412 if (remove_mask & REMOVE_PLUGIN_DATA && |
413 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { | 413 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { |
414 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); | 414 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); |
415 | 415 |
416 waiting_for_clear_plugin_data_ = true; | 416 waiting_for_clear_plugin_data_ = true; |
417 if (!plugin_data_remover_.get()) | 417 if (!plugin_data_remover_.get()) |
418 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_)); | 418 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_)); |
419 base::WaitableEvent* event = | 419 base::WaitableEvent* event = |
420 plugin_data_remover_->StartRemoving(delete_begin_); | 420 plugin_data_remover_->StartRemoving(delete_begin_); |
421 | 421 watcher_.StartWatching(event, this); |
422 base::WaitableEventWatcher::EventCallback watcher_callback = | |
423 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled, | |
424 base::Unretained(this)); | |
425 watcher_.StartWatching(event, watcher_callback); | |
426 } | 422 } |
427 #endif | 423 #endif |
428 | 424 |
429 if (remove_mask & REMOVE_PASSWORDS) { | 425 if (remove_mask & REMOVE_PASSWORDS) { |
430 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 426 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
431 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( | 427 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( |
432 profile_, Profile::EXPLICIT_ACCESS); | 428 profile_, Profile::EXPLICIT_ACCESS); |
433 | 429 |
434 if (password_store) | 430 if (password_store) |
435 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); | 431 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 BrowserThread::UI, FROM_HERE, | 1022 BrowserThread::UI, FROM_HERE, |
1027 base::Bind(&BrowsingDataRemover::OnClearedFormData, | 1023 base::Bind(&BrowsingDataRemover::OnClearedFormData, |
1028 base::Unretained(this))); | 1024 base::Unretained(this))); |
1029 } | 1025 } |
1030 | 1026 |
1031 void BrowsingDataRemover::OnClearedFormData() { | 1027 void BrowsingDataRemover::OnClearedFormData() { |
1032 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1028 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1033 waiting_for_clear_form_ = false; | 1029 waiting_for_clear_form_ = false; |
1034 NotifyAndDeleteIfDone(); | 1030 NotifyAndDeleteIfDone(); |
1035 } | 1031 } |
OLD | NEW |