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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 2971183002: Enforces order for settings reset (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index c5ec45ea2ff2356559257401953568244747db76..75cb7e18a10c2668be31d9216188561a688af964 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -231,6 +231,18 @@ void SetupModuleDatabase(
base::Unretained(module_database)));
}
+// Posts the settings reset prompt to be shown after startup if feature
csharp 2017/07/06 17:09:01 nit: I'm not sure if this comment adds much, since
+// kSettingsResetPrompt is enabled.
+void MaybePostSettingsResetPrompt() {
+ if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) {
+ content::BrowserThread::PostAfterStartupTask(
+ FROM_HERE,
+ content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::UI),
+ base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay));
+ }
+}
+
} // namespace
void ShowCloseBrowserFirstMessageBox() {
@@ -376,24 +388,20 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() {
InitializeChromeElf();
// Reset settings for the current profile if it's tagged to be reset after a
- // complete run of the Chrome Cleanup tool.
+ // complete run of the Chrome Cleanup tool. If post-cleanup settings reset is
+ // enabled, we delay checks for settings reset prompt until the scheduled
+ // reset is finished.
if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) {
// Using last opened profiles, because we want to find reset the profile
// that was open in the last Chrome run, which may not be open yet in
// the current run.
safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles(
g_browser_process->profile_manager()->GetLastOpenedProfiles(),
- base::BindOnce(&base::DoNothing),
+ base::BindOnce(&MaybePostSettingsResetPrompt),
base::MakeUnique<
safe_browsing::PostCleanupSettingsResetter::Delegate>());
- }
-
- if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) {
- content::BrowserThread::PostAfterStartupTask(
- FROM_HERE,
- content::BrowserThread::GetTaskRunnerForThread(
- content::BrowserThread::UI),
- base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay));
+ } else {
+ MaybePostSettingsResetPrompt();
}
// Record UMA data about whether the fault-tolerant heap is enabled.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698