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

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: Whitespace. 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/ui/browser_init.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/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 82cc3672f03614510822dfc79edfa2a139c1bf1f..6cdf7e7dc1876e85ee3b2f75ba6791fbdc9d2786 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);
sky 2012/03/20 17:23:18 Don't we only want to do this once per profile?
Ivan Korotkov 2012/03/20 17:40:59 Hm, right, thanks -- I'll update the CL tomorrow t
Ivan Korotkov 2012/03/21 10:02:06 It actually works with multiprofiles as well -- th
}
#if defined(OS_WIN)
@@ -1647,6 +1651,18 @@ 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()) {
+ // Sign the backup so that the bubble won't be shown on next browser start.
+ prefs_watcher->UpdateBackupSignature();
+ protector_service->ShowChange(protector::CreatePrefsBackupInvalidChange());
+ }
+}
+
std::vector<GURL> BrowserInit::GetURLsFromCommandLine(
const CommandLine& command_line,
const FilePath& cur_dir,
« no previous file with comments | « chrome/browser/ui/browser_init.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698