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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // The PrerenderManager may have a page actively being prerendered, which | 481 // The PrerenderManager may have a page actively being prerendered, which |
482 // is essentially a preemptively cached page. | 482 // is essentially a preemptively cached page. |
483 prerender::PrerenderManager* prerender_manager = | 483 prerender::PrerenderManager* prerender_manager = |
484 prerender::PrerenderManagerFactory::GetForProfile(profile_); | 484 prerender::PrerenderManagerFactory::GetForProfile(profile_); |
485 if (prerender_manager) { | 485 if (prerender_manager) { |
486 prerender_manager->ClearData( | 486 prerender_manager->ClearData( |
487 prerender::PrerenderManager::CLEAR_PRERENDER_CONTENTS); | 487 prerender::PrerenderManager::CLEAR_PRERENDER_CONTENTS); |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
| 491 #if defined(ENABLE_PLUGINS) |
491 if (remove_mask & REMOVE_CONTENT_LICENSES) { | 492 if (remove_mask & REMOVE_CONTENT_LICENSES) { |
492 content::RecordAction( | 493 content::RecordAction( |
493 UserMetricsAction("ClearBrowsingData_ContentLicenses")); | 494 UserMetricsAction("ClearBrowsingData_ContentLicenses")); |
494 | 495 |
495 waiting_for_clear_content_licenses_ = true; | 496 waiting_for_clear_content_licenses_ = true; |
496 if (!pepper_flash_settings_manager_.get()) { | 497 if (!pepper_flash_settings_manager_.get()) { |
497 pepper_flash_settings_manager_.reset( | 498 pepper_flash_settings_manager_.reset( |
498 new PepperFlashSettingsManager(this, profile_)); | 499 new PepperFlashSettingsManager(this, profile_)); |
499 } | 500 } |
500 deauthorize_content_licenses_request_id_ = | 501 deauthorize_content_licenses_request_id_ = |
501 pepper_flash_settings_manager_->DeauthorizeContentLicenses(); | 502 pepper_flash_settings_manager_->DeauthorizeContentLicenses(); |
502 } | 503 } |
| 504 #endif |
503 | 505 |
504 // Always wipe accumulated network related data (TransportSecurityState and | 506 // Always wipe accumulated network related data (TransportSecurityState and |
505 // HttpServerPropertiesManager data). | 507 // HttpServerPropertiesManager data). |
506 waiting_for_clear_networking_history_ = true; | 508 waiting_for_clear_networking_history_ = true; |
507 profile_->ClearNetworkingHistorySince( | 509 profile_->ClearNetworkingHistorySince( |
508 delete_begin_, | 510 delete_begin_, |
509 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, | 511 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, |
510 base::Unretained(this))); | 512 base::Unretained(this))); |
511 } | 513 } |
512 | 514 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 waiting_for_clear_quota_managed_data_ = false; | 939 waiting_for_clear_quota_managed_data_ = false; |
938 NotifyAndDeleteIfDone(); | 940 NotifyAndDeleteIfDone(); |
939 } | 941 } |
940 | 942 |
941 void BrowsingDataRemover::OnWaitableEventSignaled( | 943 void BrowsingDataRemover::OnWaitableEventSignaled( |
942 base::WaitableEvent* waitable_event) { | 944 base::WaitableEvent* waitable_event) { |
943 waiting_for_clear_plugin_data_ = false; | 945 waiting_for_clear_plugin_data_ = false; |
944 NotifyAndDeleteIfDone(); | 946 NotifyAndDeleteIfDone(); |
945 } | 947 } |
946 | 948 |
| 949 #if defined(ENABLE_PLUGINS) |
947 void BrowsingDataRemover::OnDeauthorizeContentLicensesCompleted( | 950 void BrowsingDataRemover::OnDeauthorizeContentLicensesCompleted( |
948 uint32 request_id, | 951 uint32 request_id, |
949 bool /* success */) { | 952 bool /* success */) { |
950 DCHECK(waiting_for_clear_content_licenses_); | 953 DCHECK(waiting_for_clear_content_licenses_); |
951 DCHECK_EQ(request_id, deauthorize_content_licenses_request_id_); | 954 DCHECK_EQ(request_id, deauthorize_content_licenses_request_id_); |
952 | 955 |
953 waiting_for_clear_content_licenses_ = false; | 956 waiting_for_clear_content_licenses_ = false; |
954 NotifyAndDeleteIfDone(); | 957 NotifyAndDeleteIfDone(); |
955 } | 958 } |
| 959 #endif |
956 | 960 |
957 void BrowsingDataRemover::OnClearedCookies(int num_deleted) { | 961 void BrowsingDataRemover::OnClearedCookies(int num_deleted) { |
958 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 962 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
959 BrowserThread::PostTask( | 963 BrowserThread::PostTask( |
960 BrowserThread::UI, FROM_HERE, | 964 BrowserThread::UI, FROM_HERE, |
961 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 965 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
962 base::Unretained(this), num_deleted)); | 966 base::Unretained(this), num_deleted)); |
963 return; | 967 return; |
964 } | 968 } |
965 | 969 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 BrowserThread::UI, FROM_HERE, | 1008 BrowserThread::UI, FROM_HERE, |
1005 base::Bind(&BrowsingDataRemover::OnClearedFormData, | 1009 base::Bind(&BrowsingDataRemover::OnClearedFormData, |
1006 base::Unretained(this))); | 1010 base::Unretained(this))); |
1007 } | 1011 } |
1008 | 1012 |
1009 void BrowsingDataRemover::OnClearedFormData() { | 1013 void BrowsingDataRemover::OnClearedFormData() { |
1010 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1014 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1011 waiting_for_clear_form_ = false; | 1015 waiting_for_clear_form_ = false; |
1012 NotifyAndDeleteIfDone(); | 1016 NotifyAndDeleteIfDone(); |
1013 } | 1017 } |
OLD | NEW |