OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_remover.h" | 5 #include "chrome/browser/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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
15 #include "chrome/browser/autofill/personal_data_manager.h" | 15 #include "chrome/browser/autofill/personal_data_manager.h" |
16 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 16 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/download/download_service.h" |
| 19 #include "chrome/browser/download/download_service_factory.h" |
18 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
19 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 21 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
20 #include "chrome/browser/history/history.h" | 22 #include "chrome/browser/history/history.h" |
21 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.h" |
22 #include "chrome/browser/net/chrome_net_log.h" | 24 #include "chrome/browser/net/chrome_net_log.h" |
23 #include "chrome/browser/net/chrome_url_request_context.h" | 25 #include "chrome/browser/net/chrome_url_request_context.h" |
24 #include "chrome/browser/net/predictor.h" | 26 #include "chrome/browser/net/predictor.h" |
25 #include "chrome/browser/password_manager/password_store.h" | 27 #include "chrome/browser/password_manager/password_store.h" |
26 #include "chrome/browser/plugin_data_remover.h" | 28 #include "chrome/browser/plugin_data_remover.h" |
27 #include "chrome/browser/prefs/pref_member.h" | 29 #include "chrome/browser/prefs/pref_member.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 profile_->GetPrerenderManager(); | 185 profile_->GetPrerenderManager(); |
184 if (prerender_manager) { | 186 if (prerender_manager) { |
185 prerender_manager->ClearData( | 187 prerender_manager->ClearData( |
186 prerender::PrerenderManager::CLEAR_PRERENDER_CONTENTS | | 188 prerender::PrerenderManager::CLEAR_PRERENDER_CONTENTS | |
187 prerender::PrerenderManager::CLEAR_PRERENDER_HISTORY); | 189 prerender::PrerenderManager::CLEAR_PRERENDER_HISTORY); |
188 } | 190 } |
189 } | 191 } |
190 | 192 |
191 if (remove_mask & REMOVE_DOWNLOADS) { | 193 if (remove_mask & REMOVE_DOWNLOADS) { |
192 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); | 194 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); |
193 DownloadManager* download_manager = profile_->GetDownloadManager(); | 195 DownloadManager* download_manager = |
| 196 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); |
194 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); | 197 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); |
195 download_manager->ClearLastDownloadPath(); | 198 download_manager->ClearLastDownloadPath(); |
196 } | 199 } |
197 | 200 |
198 if (remove_mask & REMOVE_COOKIES) { | 201 if (remove_mask & REMOVE_COOKIES) { |
199 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); | 202 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); |
200 // Since we are running on the UI thread don't call GetURLRequestContext(). | 203 // Since we are running on the UI thread don't call GetURLRequestContext(). |
201 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext(); | 204 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext(); |
202 if (rq_context) { | 205 if (rq_context) { |
203 waiting_for_clear_cookies_ = true; | 206 waiting_for_clear_cookies_ = true; |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 GetURLRequestContext()->cookie_store()->GetCookieMonster(); | 582 GetURLRequestContext()->cookie_store()->GetCookieMonster(); |
580 if (cookie_monster) { | 583 if (cookie_monster) { |
581 cookie_monster->DeleteAllCreatedBetweenAsync( | 584 cookie_monster->DeleteAllCreatedBetweenAsync( |
582 delete_begin_, delete_end_, | 585 delete_begin_, delete_end_, |
583 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 586 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
584 base::Unretained(this))); | 587 base::Unretained(this))); |
585 } else { | 588 } else { |
586 OnClearedCookies(0); | 589 OnClearedCookies(0); |
587 } | 590 } |
588 } | 591 } |
OLD | NEW |