Chromium Code Reviews| 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. |