Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_ | |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fe tcher.h" | |
| 13 | |
| 14 class Profile; | |
| 15 class ProfileResetter; | |
| 16 | |
| 17 namespace user_prefs { | |
| 18 class PrefRegistrySyncable; | |
| 19 } // namespace user_prefs | |
| 20 | |
| 21 namespace safe_browsing { | |
| 22 | |
| 23 // Registers the settings reset pending tracked preference. | |
| 24 void RegisterChromeCleanerProfilePrefs( | |
| 25 user_prefs::PrefRegistrySyncable* registry); | |
| 26 | |
| 27 // Returns the post-cleanup reset pending prefs for |profile|. | |
| 28 bool PostCleanupSettingsResetPending(Profile* profile); | |
| 29 | |
| 30 // Updates the post-cleanup reset pending prefs for |profile|. | |
| 31 void RecordPostCleanupSettingsResetPending(bool value, Profile* profile); | |
| 32 | |
| 33 // Tags |profile| to have its settings reset once the current cleanup finishes, | |
| 34 // by means of ResetPostCleanupSettingsIfTagged(). If a cleanup doesn't | |
| 35 // require a reboot and the browser is still running once the cleanup finishes, | |
| 36 // then settings will be reset as soon as the cleaner process returns; if the | |
| 37 // user closes the browser while the cleanup is ongoing, then settings will be | |
| 38 // reset on the first browser restart that happens after the cleaner process | |
| 39 // ends. If the cleanup requires a reboot, then settings will be reset on the | |
| 40 // first browser restart that happens after reboot. | |
| 41 void TagProfileForResetting(Profile* profile); | |
| 42 | |
| 43 class SettingsResetterDelegate { | |
| 44 public: | |
| 45 SettingsResetterDelegate(); | |
| 46 virtual ~SettingsResetterDelegate(); | |
| 47 | |
| 48 virtual void FetchDefaultSettings( | |
| 49 DefaultSettingsFetcher::SettingsCallback callback); | |
| 50 | |
| 51 virtual std::unique_ptr<ProfileResetter> GetProfileResetter(Profile* profile); | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(SettingsResetterDelegate); | |
| 55 }; | |
| 56 | |
| 57 // Resets settings for the current profile if it's tagged for reset and a | |
|
alito
2017/06/02 05:32:42
The comment says "current profile" but a vector of
ftirelo
2017/06/02 21:20:57
Done.
| |
| 58 // cleanup has completed. | |
| 59 void ResetPostCleanupSettingsIfTagged( | |
| 60 std::vector<Profile*> profile, | |
| 61 base::OnceClosure continuation, | |
| 62 std::unique_ptr<SettingsResetterDelegate> delegate = nullptr); | |
| 63 | |
| 64 } // namespace safe_browsing | |
| 65 | |
| 66 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_ | |
| OLD | NEW |