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 #include <vector> | |
| 10 | |
| 11 #include "base/callback.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fe tcher.h" | |
| 14 | |
| 15 class Profile; | |
| 16 class ProfileResetter; | |
| 17 | |
| 18 namespace user_prefs { | |
| 19 class PrefRegistrySyncable; | |
| 20 } // namespace user_prefs | |
| 21 | |
| 22 namespace safe_browsing { | |
| 23 | |
| 24 // Registers the settings reset pending tracked preference. | |
| 25 void RegisterChromeCleanerProfilePrefs( | |
| 26 user_prefs::PrefRegistrySyncable* registry); | |
| 27 | |
| 28 // Returns the post-cleanup reset pending prefs for |profile|. | |
| 29 bool PostCleanupSettingsResetPending(Profile* profile); | |
|
alito
2017/06/07 19:54:03
Does this need to be in the public interface?
ftirelo
2017/06/08 21:54:11
Done.
| |
| 30 | |
| 31 // Updates the post-cleanup reset pending prefs for |profile|. | |
| 32 void RecordPostCleanupSettingsResetPending(bool value, Profile* profile); | |
|
alito
2017/06/07 19:54:03
Does this need to be in the public interface?
ftirelo
2017/06/08 21:54:12
Done.
| |
| 33 | |
| 34 // Tags |profile| to have its settings reset once the current cleanup finishes, | |
| 35 // by means of ResetPostCleanupSettingsIfTagged(). If a cleanup doesn't | |
| 36 // require a reboot and the browser is still running once the cleanup finishes, | |
| 37 // then settings will be reset as soon as the cleaner process returns; if the | |
| 38 // user closes the browser while the cleanup is ongoing, then settings will be | |
| 39 // reset on the first browser restart that happens after the cleaner process | |
| 40 // ends. If the cleanup requires a reboot, then settings will be reset on the | |
| 41 // first browser restart that happens after reboot. | |
| 42 void TagProfileForResetting(Profile* profile); | |
| 43 | |
| 44 class SettingsResetterDelegate { | |
| 45 public: | |
| 46 SettingsResetterDelegate(); | |
| 47 virtual ~SettingsResetterDelegate(); | |
| 48 | |
| 49 virtual void FetchDefaultSettings( | |
| 50 DefaultSettingsFetcher::SettingsCallback callback); | |
| 51 | |
| 52 virtual std::unique_ptr<ProfileResetter> GetProfileResetter(Profile* profile); | |
| 53 | |
| 54 private: | |
| 55 DISALLOW_COPY_AND_ASSIGN(SettingsResetterDelegate); | |
| 56 }; | |
| 57 | |
| 58 // Resets settings for the profiles in |profiles| there are tagged for | |
| 59 // resetting and a cleanup has completed. If a cleanup doesn't require a | |
| 60 // reboot and the session that started the cleanup is still alive, then | |
| 61 // the settings for all open profiles will be reset at once. Otherwise, | |
| 62 // for each profile that was open when the cleanup started, this will be | |
| 63 // called the next a browser is launched for the profile. | |
| 64 void ResetPostCleanupSettingsIfTagged( | |
| 65 std::vector<Profile*> profiles, | |
| 66 base::OnceClosure continuation, | |
| 67 std::unique_ptr<SettingsResetterDelegate> delegate = nullptr); | |
| 68 | |
| 69 } // namespace safe_browsing | |
| 70 | |
| 71 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_ | |
| OLD | NEW |