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

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

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 SessionServiceFactory::GetForProfile(profile_); 258 SessionServiceFactory::GetForProfile(profile_);
259 if (session_service) 259 if (session_service)
260 session_service->DeleteLastSession(); 260 session_service->DeleteLastSession();
261 #endif 261 #endif
262 } 262 }
263 } 263 }
264 264
265 if (remove_mask & REMOVE_DOWNLOADS) { 265 if (remove_mask & REMOVE_DOWNLOADS) {
266 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); 266 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"));
267 DownloadManager* download_manager = 267 DownloadManager* download_manager =
268 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); 268 BrowserContext::GetDownloadManager(profile_);
269 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); 269 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_);
270 download_manager->ClearLastDownloadPath(); 270 download_manager->ClearLastDownloadPath();
271 } 271 }
272 272
273 if (remove_mask & REMOVE_COOKIES) { 273 if (remove_mask & REMOVE_COOKIES) {
274 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); 274 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
275 // Since we are running on the UI thread don't call GetURLRequestContext(). 275 // Since we are running on the UI thread don't call GetURLRequestContext().
276 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext(); 276 net::URLRequestContextGetter* rq_context = profile_->GetRequestContext();
277 if (rq_context) { 277 if (rq_context) {
278 ++waiting_for_clear_cookies_count_; 278 ++waiting_for_clear_cookies_count_;
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 BrowserThread::UI, FROM_HERE, 782 BrowserThread::UI, FROM_HERE,
783 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, 783 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts,
784 base::Unretained(this))); 784 base::Unretained(this)));
785 } 785 }
786 786
787 void BrowsingDataRemover::OnClearedServerBoundCerts() { 787 void BrowsingDataRemover::OnClearedServerBoundCerts() {
788 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 788 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
789 waiting_for_clear_server_bound_certs_ = false; 789 waiting_for_clear_server_bound_certs_ = false;
790 NotifyAndDeleteIfDone(); 790 NotifyAndDeleteIfDone();
791 } 791 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698