| 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 profiles in |profiles| there are tagged for |
| 58 // resetting and a cleanup has completed. If a cleanup doesn't require a |
| 59 // reboot and the session that started the cleanup is still alive, then |
| 60 // the settings for all open profiles will be reset at once. Otherwise, |
| 61 // for each profile that was open when the cleanup started, this will be |
| 62 // called the next a browser is launched for the profile. |
| 63 void ResetPostCleanupSettingsIfTagged( |
| 64 std::vector<Profile*> profiles, |
| 65 base::OnceClosure continuation, |
| 66 std::unique_ptr<SettingsResetterDelegate> delegate = nullptr); |
| 67 |
| 68 } // namespace safe_browsing |
| 69 |
| 70 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_ |
| OLD | NEW |