Post-cleanup settings reset

Desktop / Chromium - ftirelo [chromium.org] - 19 June 2017 06:36 EDT

Tags the profile that accepted a cleanup and resets their settings once the cleanup is confirmed.

The following cases are handled: 1. cleanup finishes and doesn't require a reboot, the same browser session is still running: tagged profiles will be reset right away; 2. cleanup finishes and doesn't require a reboot, but browser session has finished: settings for a tagged profile will be reset next time the user launches the browser for that profile; 3. reboot required: settings for a tagged profile will be reset next time the user launches the browser for that profile, once a reboot is confirmed.

For case 1, cleanup is confirmed by means of the exit code of the cleaner process. Cases 2 and 3 rely on registry values written by the cleaner once a cleanup starts and once it confirms the cleanup. If a reboot is required, the registry value is written by a cleaner process scheduled to run post-reboot.

BUG=728136

Review-Url: https://codereview.chromium.org/2906103002 Cr-Commit-Position: refs/heads/master@{#480390}

46b3422 Post-cleanup settings reset.
chrome/browser/BUILD.gn | 2 +
chrome/browser/chrome_browser_main_win.cc | 17 ++
chrome/browser/prefs/browser_prefs.cc | 2 +
.../chrome_cleaner_controller_win.cc | 33 ++-
.../chrome_cleaner/chrome_cleaner_controller_win.h | 17 +-
.../chrome_cleaner_controller_win_unittest.cc | 82 ++++++-
.../settings_resetter_browsertest_win.cc | 228 +++++++++++++++++++
.../chrome_cleaner/settings_resetter_win.cc | 241 +++++++++++++++++++++
.../chrome_cleaner/settings_resetter_win.h | 80 +++++++
.../ui/webui/settings/chrome_cleanup_handler.cc | 6 +-
.../ui/webui/settings/chrome_cleanup_handler.h | 6 +-
chrome/browser/ui/webui/settings/md_settings_ui.cc | 2 +-
chrome/common/pref_names.cc | 4 +
chrome/common/pref_names.h | 1 +
chrome/test/BUILD.gn | 1 +
.../chrome_cleaner/public/constants/constants.cc | 1 +
.../chrome_cleaner/public/constants/constants.h | 3 +
17 files changed, 715 insertions(+), 11 deletions(-)

Upstream: git.chromium.org


  • Share