| OLD | NEW |
| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 476 } |
| 477 if (profile_->GetNetworkPredictor()) { | 477 if (profile_->GetNetworkPredictor()) { |
| 478 // TODO(dmurph): Support all backends with filter (crbug.com/113621). | 478 // TODO(dmurph): Support all backends with filter (crbug.com/113621). |
| 479 waiting_for_clear_network_predictor_ = true; | 479 waiting_for_clear_network_predictor_ = true; |
| 480 BrowserThread::PostTaskAndReply( | 480 BrowserThread::PostTaskAndReply( |
| 481 BrowserThread::IO, FROM_HERE, | 481 BrowserThread::IO, FROM_HERE, |
| 482 base::Bind(&ClearNetworkPredictorOnIOThread, | 482 base::Bind(&ClearNetworkPredictorOnIOThread, |
| 483 profile_->GetNetworkPredictor()), | 483 profile_->GetNetworkPredictor()), |
| 484 base::Bind(&BrowsingDataRemover::OnClearedNetworkPredictor, | 484 base::Bind(&BrowsingDataRemover::OnClearedNetworkPredictor, |
| 485 weak_ptr_factory_.GetWeakPtr())); | 485 weak_ptr_factory_.GetWeakPtr())); |
| 486 profile_->GetNetworkPredictor()->ClearPrefsOnUIThread(); |
| 486 } | 487 } |
| 487 | 488 |
| 488 // As part of history deletion we also delete the auto-generated keywords. | 489 // As part of history deletion we also delete the auto-generated keywords. |
| 489 TemplateURLService* keywords_model = | 490 TemplateURLService* keywords_model = |
| 490 TemplateURLServiceFactory::GetForProfile(profile_); | 491 TemplateURLServiceFactory::GetForProfile(profile_); |
| 491 | 492 |
| 492 if (keywords_model && !keywords_model->loaded()) { | 493 if (keywords_model && !keywords_model->loaded()) { |
| 493 template_url_sub_ = keywords_model->RegisterOnLoadedCallback( | 494 template_url_sub_ = keywords_model->RegisterOnLoadedCallback( |
| 494 base::Bind(&BrowsingDataRemover::OnKeywordsLoaded, | 495 base::Bind(&BrowsingDataRemover::OnKeywordsLoaded, |
| 495 weak_ptr_factory_.GetWeakPtr())); | 496 weak_ptr_factory_.GetWeakPtr())); |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 waiting_for_clear_domain_reliability_monitor_ = false; | 1337 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1337 NotifyIfDone(); | 1338 NotifyIfDone(); |
| 1338 } | 1339 } |
| 1339 | 1340 |
| 1340 // static | 1341 // static |
| 1341 BrowsingDataRemover::CallbackSubscription | 1342 BrowsingDataRemover::CallbackSubscription |
| 1342 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1343 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 1343 const BrowsingDataRemover::Callback& callback) { | 1344 const BrowsingDataRemover::Callback& callback) { |
| 1344 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1345 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 1345 } | 1346 } |
| OLD | NEW |