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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 2971183002: Enforces order for settings reset (Closed)
Patch Set: Add browser test for dependency 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 | chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_dependency_browsertest_win.cc » ('j') | 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..50373fed4f845b92fe2610b42223127c486b2b58 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -231,6 +231,16 @@ void SetupModuleDatabase(
base::Unretained(module_database)));
}
+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 +386,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 | chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_dependency_browsertest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698