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

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

Issue 12662032: Merge SavePackageFilePicker{,ChromeOS} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r197032 Created 7 years, 7 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/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"
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 "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.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/browsing_data_helper.h" 19 #include "chrome/browser/browsing_data/browsing_data_helper.h"
20 #include "chrome/browser/download/chrome_download_manager_delegate.h"
21 #include "chrome/browser/download/download_service.h"
22 #include "chrome/browser/download/download_service_factory.h" 20 #include "chrome/browser/download/download_service_factory.h"
23 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
24 #include "chrome/browser/extensions/extension_special_storage_policy.h" 22 #include "chrome/browser/extensions/extension_special_storage_policy.h"
25 #include "chrome/browser/history/history_service.h" 23 #include "chrome/browser/history/history_service.h"
26 #include "chrome/browser/history/history_service_factory.h" 24 #include "chrome/browser/history/history_service_factory.h"
27 #include "chrome/browser/io_thread.h" 25 #include "chrome/browser/io_thread.h"
28 #include "chrome/browser/nacl_host/nacl_browser.h" 26 #include "chrome/browser/nacl_host/nacl_browser.h"
29 #include "chrome/browser/net/chrome_url_request_context.h" 27 #include "chrome/browser/net/chrome_url_request_context.h"
30 #include "chrome/browser/net/predictor.h" 28 #include "chrome/browser/net/predictor.h"
31 #include "chrome/browser/password_manager/password_store.h" 29 #include "chrome/browser/password_manager/password_store.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 session_service->DeleteLastSession(); 310 session_service->DeleteLastSession();
313 #endif 311 #endif
314 } 312 }
315 } 313 }
316 314
317 if ((remove_mask & REMOVE_DOWNLOADS) && may_delete_history) { 315 if ((remove_mask & REMOVE_DOWNLOADS) && may_delete_history) {
318 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); 316 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"));
319 DownloadManager* download_manager = 317 DownloadManager* download_manager =
320 BrowserContext::GetDownloadManager(profile_); 318 BrowserContext::GetDownloadManager(profile_);
321 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); 319 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_);
322 DownloadService* download_service =
323 DownloadServiceFactory::GetForProfile(profile_);
324 ChromeDownloadManagerDelegate* download_manager_delegate =
325 download_service->GetDownloadManagerDelegate();
326 download_manager_delegate->ClearLastDownloadPath();
asanka 2013/05/07 15:15:12 Why aren't you resetting kSaveFileDefaultDirectory
benjhayden 2013/05/17 20:31:54 See latest patchset.
327 } 320 }
328 321
329 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set, 322 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set,
330 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB 323 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB
331 // don't accidentally remove the cookies that are associated with the 324 // don't accidentally remove the cookies that are associated with the
332 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated 325 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated
333 // between UNPROTECTED_WEB and PROTECTED_WEB. 326 // between UNPROTECTED_WEB and PROTECTED_WEB.
334 if (remove_mask & REMOVE_COOKIES && 327 if (remove_mask & REMOVE_COOKIES &&
335 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { 328 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) {
336 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); 329 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 BrowserThread::UI, FROM_HERE, 1068 BrowserThread::UI, FROM_HERE,
1076 base::Bind(&BrowsingDataRemover::OnClearedFormData, 1069 base::Bind(&BrowsingDataRemover::OnClearedFormData,
1077 base::Unretained(this))); 1070 base::Unretained(this)));
1078 } 1071 }
1079 1072
1080 void BrowsingDataRemover::OnClearedFormData() { 1073 void BrowsingDataRemover::OnClearedFormData() {
1081 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1074 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1082 waiting_for_clear_form_ = false; 1075 waiting_for_clear_form_ = false;
1083 NotifyAndDeleteIfDone(); 1076 NotifyAndDeleteIfDone();
1084 } 1077 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/preferences_unittest.cc » ('j') | chrome/browser/download/save_package_file_picker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698