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

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

Issue 15572002: Implemented 'Reset Search engines' feature. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reset Google search URL together with search engines 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 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 1030fb4da7bd989b717d0a9f60f3916a774bffdb..d8f5f5273faa5f8f4b47d42e44f07858f24370a5 100644
--- a/chrome/browser/profile_resetter/profile_resetter.h
+++ b/chrome/browser/profile_resetter/profile_resetter.h
@@ -8,13 +8,17 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/threading/non_thread_safe.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
class Profile;
+class TemplateURLService;
// This class allows resetting certain aspects of a profile to default values.
// It is used in case the profile has been damaged due to malware or bad user
// settings.
-class ProfileResetter : public base::NonThreadSafe {
+class ProfileResetter : public base::NonThreadSafe,
+ public content::NotificationObserver {
public:
// Flags indicating what aspects of a profile shall be reset.
enum Resettable {
@@ -43,7 +47,7 @@ class ProfileResetter : public base::NonThreadSafe {
type_ResettableFlags_doesnt_match_Resettable);
explicit ProfileResetter(Profile* profile);
- ~ProfileResetter();
+ virtual ~ProfileResetter();
// Resets |resettable_flags| and calls |callback| on the UI thread on
// completion. If |resettable_flags| contains EXTENSIONS, these are handled
@@ -66,7 +70,13 @@ class ProfileResetter : public base::NonThreadSafe {
void ResetExtensions(ExtensionHandling extension_handling);
void ResetStartPage();
+ // content::NotificationObserver implementation.
Peter Kasting 2013/05/29 04:04:41 Nit: Just "// BaseClassName:"
vasilii 2013/05/29 08:30:18 Done.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
Profile* profile_;
+ TemplateURLService* template_url_service_;
// Flags of a Resetable indicating which reset operations we are still waiting
// for.
@@ -75,6 +85,8 @@ class ProfileResetter : public base::NonThreadSafe {
// Called on UI thread when reset has been completed.
base::Closure callback_;
+ content::NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileResetter);
};

Powered by Google App Engine
This is Rietveld 408576698