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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 9748016: [protector] Added UI for invalid Preferences backup case. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge 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
Index: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 82cc3672f03614510822dfc79edfa2a139c1bf1f..d1aef78f8a3f3cd7437abe297cde5cf8f9c8b9e1 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -55,6 +55,7 @@
#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/protector/base_setting_change.h"
+#include "chrome/browser/protector/protected_prefs_watcher.h"
#include "chrome/browser/protector/protector_service.h"
#include "chrome/browser/protector/protector_service_factory.h"
#include "chrome/browser/search_engines/template_url.h"
@@ -945,6 +946,9 @@ bool BrowserInit::LaunchWithProfile::Launch(
KeystoneInfoBar::PromotionInfoBar(profile);
#endif
}
+
+ // Notify user if the Preferences backup is invalid.
+ CheckPreferencesBackup(profile);
}
#if defined(OS_WIN)
@@ -1647,6 +1651,17 @@ size_t BrowserInit::LaunchWithProfile::ShowSyncPromoDialog(
return std::string::npos;
}
+void BrowserInit::LaunchWithProfile::CheckPreferencesBackup(Profile* profile) {
+ protector::ProtectorService* protector_service =
+ protector::ProtectorServiceFactory::GetForProfile(profile);
+ protector::ProtectedPrefsWatcher* prefs_watcher =
+ protector_service->GetPrefsWatcher();
+ if (protector::IsEnabled() && !prefs_watcher->is_backup_valid()) {
+ prefs_watcher->UpdateBackupSignature();
whywhat 2012/03/20 16:06:01 What does this line do? It's not clear why it is h
Ivan Korotkov 2012/03/20 16:16:02 So that this dialog doesn't appear after Chrome re
+ protector_service->ShowChange(protector::CreatePrefsBackupInvalidChange());
+ }
+}
+
std::vector<GURL> BrowserInit::GetURLsFromCommandLine(
const CommandLine& command_line,
const FilePath& cur_dir,

Powered by Google App Engine
This is Rietveld 408576698