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

Unified Diff: chrome/browser/profile_resetter/profile_resetter.h

Issue 23710022: Convert NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED to CallbackList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean-up Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profile_resetter/profile_resetter.h
diff --git a/chrome/browser/profile_resetter/profile_resetter.h b/chrome/browser/profile_resetter/profile_resetter.h
index 77e8a1c3387322885bff9f35bf34d3c4bd80e0c4..76432a5e339d9ae07ee9b3ff5b09b286a0cf7980 100644
--- a/chrome/browser/profile_resetter/profile_resetter.h
+++ b/chrome/browser/profile_resetter/profile_resetter.h
@@ -7,11 +7,11 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
Avi (use Gerrit) 2013/10/02 22:27:52 not used; remove.
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
#include "chrome/browser/profile_resetter/brandcoded_default_settings.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "chrome/browser/search_engines/template_url_service.h"
class Profile;
class TemplateURLService;
@@ -20,7 +20,6 @@ class TemplateURLService;
// It is used in case the profile has been damaged due to malware or bad user
// settings.
class ProfileResetter : public base::NonThreadSafe,
- public content::NotificationObserver,
public BrowsingDataRemover::Observer {
public:
// Flags indicating what aspects of a profile shall be reset.
@@ -69,14 +68,12 @@ class ProfileResetter : public base::NonThreadSafe,
void ResetStartupPages();
void ResetPinnedTabs();
- // content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
// BrowsingDataRemover::Observer:
virtual void OnBrowsingDataRemoverDone() OVERRIDE;
+ // Callback for when TemplateURLService has loaded.
+ void OnTemplateURLServiceLoaded();
+
Profile* const profile_;
scoped_ptr<BrandcodedDefaultSettings> master_settings_;
TemplateURLService* template_url_service_;
@@ -88,12 +85,12 @@ class ProfileResetter : public base::NonThreadSafe,
// Called on UI thread when reset has been completed.
base::Closure callback_;
- content::NotificationRegistrar registrar_;
-
// If non-null it means removal is in progress. BrowsingDataRemover takes care
// of deleting itself when done.
BrowsingDataRemover* cookies_remover_;
+ scoped_ptr<TemplateURLService::Subscription> template_url_service_sub_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileResetter);
};

Powered by Google App Engine
This is Rietveld 408576698