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

Unified Diff: chrome/browser/protector/protector_service_factory.cc

Issue 9620010: Added Protector backup for Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 8 years, 9 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
« no previous file with comments | « chrome/browser/protector/protector_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/protector/protector_service_factory.cc
diff --git a/chrome/browser/protector/protector_service_factory.cc b/chrome/browser/protector/protector_service_factory.cc
index 504673ce323e3e425f7c3064712679daa713f920..ceb487b912f4be35e4610395384ca862c0e9087d 100644
--- a/chrome/browser/protector/protector_service_factory.cc
+++ b/chrome/browser/protector/protector_service_factory.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "chrome/browser/protector/protected_prefs_watcher.h"
#include "chrome/browser/protector/protector_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -25,8 +26,13 @@ ProtectorServiceFactory* ProtectorServiceFactory::GetInstance() {
ProtectorServiceFactory::ProtectorServiceFactory()
: ProfileKeyedServiceFactory("ProtectorService",
ProfileDependencyManager::GetInstance()) {
+ // Dependencies for the correct service shutdown order.
DependsOn(GlobalErrorServiceFactory::GetInstance());
DependsOn(TemplateURLServiceFactory::GetInstance());
+ // BUG(ivankr): to be bullet-proof, ProtectorService must outlive the
+ // ExtensionService as well and be the second to last thing destroyed in
+ // ProfileImpl (the last being the PrefService itself). This cannot be
+ // accomplished with ProfileKeyedService implementation.
}
ProtectorServiceFactory::~ProtectorServiceFactory() {
@@ -37,6 +43,16 @@ ProfileKeyedService* ProtectorServiceFactory::BuildServiceInstanceFor(
return new ProtectorService(profile);
}
+void ProtectorServiceFactory::RegisterUserPrefs(PrefService* user_prefs) {
+ ProtectedPrefsWatcher::RegisterUserPrefs(user_prefs);
+}
+
+bool ProtectorServiceFactory::ServiceIsCreatedWithProfile() {
+ // ProtectorService watches changes for protected prefs so it must be started
+ // right with the profile creation.
+ return true;
+}
+
bool ProtectorServiceFactory::ServiceRedirectedInIncognito() {
return true;
}
« no previous file with comments | « chrome/browser/protector/protector_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698