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

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

Issue 13928035: WIP Component build of autofill Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make windows compiling Created 7 years, 8 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"
(...skipping 26 matching lines...) Expand all
37 #include "chrome/browser/prerender/prerender_manager_factory.h" 37 #include "chrome/browser/prerender/prerender_manager_factory.h"
38 #include "chrome/browser/profiles/profile.h" 38 #include "chrome/browser/profiles/profile.h"
39 #include "chrome/browser/renderer_host/web_cache_manager.h" 39 #include "chrome/browser/renderer_host/web_cache_manager.h"
40 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 40 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
41 #include "chrome/browser/search_engines/template_url_service.h" 41 #include "chrome/browser/search_engines/template_url_service.h"
42 #include "chrome/browser/search_engines/template_url_service_factory.h" 42 #include "chrome/browser/search_engines/template_url_service_factory.h"
43 #include "chrome/browser/sessions/session_service.h" 43 #include "chrome/browser/sessions/session_service.h"
44 #include "chrome/browser/sessions/session_service_factory.h" 44 #include "chrome/browser/sessions/session_service_factory.h"
45 #include "chrome/browser/sessions/tab_restore_service.h" 45 #include "chrome/browser/sessions/tab_restore_service.h"
46 #include "chrome/browser/sessions/tab_restore_service_factory.h" 46 #include "chrome/browser/sessions/tab_restore_service_factory.h"
47 #include "chrome/browser/webdata/web_data_service_factory.h"
47 #include "chrome/common/chrome_notification_types.h" 48 #include "chrome/common/chrome_notification_types.h"
48 #include "chrome/common/pref_names.h" 49 #include "chrome/common/pref_names.h"
49 #include "chrome/common/url_constants.h" 50 #include "chrome/common/url_constants.h"
50 #include "components/autofill/browser/personal_data_manager.h" 51 #include "components/autofill/browser/personal_data_manager.h"
51 #include "components/autofill/browser/webdata/autofill_webdata_service.h" 52 #include "components/autofill/browser/webdata/autofill_webdata_service.h"
52 #include "content/public/browser/browser_thread.h" 53 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/dom_storage_context.h" 54 #include "content/public/browser/dom_storage_context.h"
54 #include "content/public/browser/download_manager.h" 55 #include "content/public/browser/download_manager.h"
55 #include "content/public/browser/notification_service.h" 56 #include "content/public/browser/notification_service.h"
56 #include "content/public/browser/plugin_data_remover.h" 57 #include "content/public/browser/plugin_data_remover.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( 437 PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
437 profile_, Profile::EXPLICIT_ACCESS); 438 profile_, Profile::EXPLICIT_ACCESS);
438 439
439 if (password_store) 440 if (password_store)
440 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); 441 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_);
441 } 442 }
442 443
443 if (remove_mask & REMOVE_FORM_DATA) { 444 if (remove_mask & REMOVE_FORM_DATA) {
444 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); 445 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill"));
445 scoped_refptr<autofill::AutofillWebDataService> web_data_service = 446 scoped_refptr<autofill::AutofillWebDataService> web_data_service =
446 autofill::AutofillWebDataService::FromBrowserContext(profile_); 447 WebDataServiceFactory::GetAutofillWebDataServiceForProfile(profile_);
447 448
448 if (web_data_service.get()) { 449 if (web_data_service.get()) {
449 waiting_for_clear_form_ = true; 450 waiting_for_clear_form_ = true;
450 web_data_service->RemoveFormElementsAddedBetween(delete_begin_, 451 web_data_service->RemoveFormElementsAddedBetween(delete_begin_,
451 delete_end_); 452 delete_end_);
452 web_data_service->RemoveAutofillDataModifiedBetween( 453 web_data_service->RemoveAutofillDataModifiedBetween(
453 delete_begin_, delete_end_); 454 delete_begin_, delete_end_);
454 // The above calls are done on the UI thread but do their work on the DB 455 // The above calls are done on the UI thread but do their work on the DB
455 // thread. So wait for it. 456 // thread. So wait for it.
456 BrowserThread::PostTask( 457 BrowserThread::PostTask(
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 BrowserThread::UI, FROM_HERE, 1076 BrowserThread::UI, FROM_HERE,
1076 base::Bind(&BrowsingDataRemover::OnClearedFormData, 1077 base::Bind(&BrowsingDataRemover::OnClearedFormData,
1077 base::Unretained(this))); 1078 base::Unretained(this)));
1078 } 1079 }
1079 1080
1080 void BrowsingDataRemover::OnClearedFormData() { 1081 void BrowsingDataRemover::OnClearedFormData() {
1081 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1082 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1082 waiting_for_clear_form_ = false; 1083 waiting_for_clear_form_ = false;
1083 NotifyAndDeleteIfDone(); 1084 NotifyAndDeleteIfDone();
1084 } 1085 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698