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

Side by Side Diff: chrome/browser/browsing_data_remover.cc

Issue 10704052: Download filename determination refactor (3/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowsingDataRemover calls CDMD directly Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/file_util.h" 13 #include "base/file_util.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/platform_file.h" 15 #include "base/platform_file.h"
16 #include "chrome/browser/autofill/personal_data_manager.h" 16 #include "chrome/browser/autofill/personal_data_manager.h"
17 #include "chrome/browser/autofill/personal_data_manager_factory.h" 17 #include "chrome/browser/autofill/personal_data_manager_factory.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/browsing_data_helper.h" 19 #include "chrome/browser/browsing_data_helper.h"
20 #include "chrome/browser/download/chrome_download_manager_delegate.h"
20 #include "chrome/browser/download/download_service.h" 21 #include "chrome/browser/download/download_service.h"
21 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
22 #include "chrome/browser/extensions/extension_service.h" 23 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/extensions/extension_special_storage_policy.h" 24 #include "chrome/browser/extensions/extension_special_storage_policy.h"
24 #include "chrome/browser/history/history.h" 25 #include "chrome/browser/history/history.h"
25 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
26 #include "chrome/browser/nacl_host/nacl_browser.h" 27 #include "chrome/browser/nacl_host/nacl_browser.h"
27 #include "chrome/browser/net/chrome_url_request_context.h" 28 #include "chrome/browser/net/chrome_url_request_context.h"
28 #include "chrome/browser/net/predictor.h" 29 #include "chrome/browser/net/predictor.h"
29 #include "chrome/browser/password_manager/password_store.h" 30 #include "chrome/browser/password_manager/password_store.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 session_service->DeleteLastSession(); 288 session_service->DeleteLastSession();
288 #endif 289 #endif
289 } 290 }
290 } 291 }
291 292
292 if (remove_mask & REMOVE_DOWNLOADS) { 293 if (remove_mask & REMOVE_DOWNLOADS) {
293 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); 294 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"));
294 DownloadManager* download_manager = 295 DownloadManager* download_manager =
295 BrowserContext::GetDownloadManager(profile_); 296 BrowserContext::GetDownloadManager(profile_);
296 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); 297 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_);
297 download_manager->ClearLastDownloadPath(); 298 DownloadService* download_service =
299 DownloadServiceFactory::GetForProfile(profile_);
300 ChromeDownloadManagerDelegate* download_manager_delegate =
301 static_cast<ChromeDownloadManagerDelegate*>(
302 download_service->GetDownloadManagerDelegate());
asanka 2012/07/11 20:03:32 Changing DownloadService::GetDownloadManagerDelega
Randy Smith (Not in Mondays) 2012/07/12 17:01:22 [Sorry, didn't see this in responding to your firs
asanka 2012/07/18 21:50:56 Done.
303 download_manager_delegate->ClearLastDownloadPath();
298 } 304 }
299 305
300 if (remove_mask & REMOVE_COOKIES) { 306 if (remove_mask & REMOVE_COOKIES) {
301 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); 307 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
302 // Since we are running on the UI thread don't call GetURLRequestContext(). 308 // Since we are running on the UI thread don't call GetURLRequestContext().
303 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext(); 309 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext();
304 if (rq_context) { 310 if (rq_context) {
305 ++waiting_for_clear_cookies_count_; 311 ++waiting_for_clear_cookies_count_;
306 BrowserThread::PostTask( 312 BrowserThread::PostTask(
307 BrowserThread::IO, FROM_HERE, 313 BrowserThread::IO, FROM_HERE,
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 BrowserThread::UI, FROM_HERE, 869 BrowserThread::UI, FROM_HERE,
864 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, 870 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts,
865 base::Unretained(this))); 871 base::Unretained(this)));
866 } 872 }
867 873
868 void BrowsingDataRemover::OnClearedServerBoundCerts() { 874 void BrowsingDataRemover::OnClearedServerBoundCerts() {
869 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
870 waiting_for_clear_server_bound_certs_ = false; 876 waiting_for_clear_server_bound_certs_ = false;
871 NotifyAndDeleteIfDone(); 877 NotifyAndDeleteIfDone();
872 } 878 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698