summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_remover.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 18:13:33 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 18:13:33 +0000
commit8e5c89a5218b2cea6c19a0bbec74a6c51bdf1142 (patch)
tree969478be1a6f6bf4905f7a95c5bdef91a897b1eb /chrome/browser/browsing_data_remover.cc
parentce829a60f9df9ca9655f467cdb87dd4b1604fcc1 (diff)
downloadchromium_src-8e5c89a5218b2cea6c19a0bbec74a6c51bdf1142.zip
chromium_src-8e5c89a5218b2cea6c19a0bbec74a6c51bdf1142.tar.gz
chromium_src-8e5c89a5218b2cea6c19a0bbec74a6c51bdf1142.tar.bz2
Changes TemplateURLModel into TemplateURLService. Changes all access points to go through the newly made ProfileKeyedServiceFactory subclass.
In addition, makes further modifications to the unit testing stuff because the TemplateURL tests change the active TemplateURLService on a profile during the test. BUG=77155 TEST=unit tests R=mirandac Review URL: http://codereview.chromium.org/7056056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_remover.cc')
-rw-r--r--chrome/browser/browsing_data_remover.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
index ed9b014..74e294c9 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -23,7 +23,8 @@
#include "chrome/browser/plugin_data_remover.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_service.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service.h"
@@ -148,10 +149,11 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
// As part of history deletion we also delete the auto-generated keywords.
- TemplateURLModel* keywords_model = profile_->GetTemplateURLModel();
+ TemplateURLService* keywords_model =
+ TemplateURLServiceFactory::GetForProfile(profile_);
if (keywords_model && !keywords_model->loaded()) {
- registrar_.Add(this, NotificationType::TEMPLATE_URL_MODEL_LOADED,
- Source<TemplateURLModel>(keywords_model));
+ registrar_.Add(this, NotificationType::TEMPLATE_URL_SERVICE_LOADED,
+ Source<TemplateURLService>(keywords_model));
keywords_model->Load();
} else if (keywords_model) {
keywords_model->RemoveAutoGeneratedBetween(delete_begin_, delete_end_);
@@ -341,8 +343,8 @@ void BrowsingDataRemover::Observe(NotificationType type,
// TODO(brettw) bug 1139736: This should also observe session
// clearing (what about other things such as passwords, etc.?) and wait for
// them to complete before continuing.
- DCHECK(type == NotificationType::TEMPLATE_URL_MODEL_LOADED);
- TemplateURLModel* model = Source<TemplateURLModel>(source).ptr();
+ DCHECK(type == NotificationType::TEMPLATE_URL_SERVICE_LOADED);
+ TemplateURLService* model = Source<TemplateURLService>(source).ptr();
if (model->profile() == profile_->GetOriginalProfile()) {
registrar_.RemoveAll();
model->RemoveAutoGeneratedBetween(delete_begin_, delete_end_);