| Index: chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h
|
| diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c7ae1b1964a9e12943fcda0608cd750727cfcbb1
|
| --- /dev/null
|
| +++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h
|
| @@ -0,0 +1,70 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_
|
| +#define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/macros.h"
|
| +#include "chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fetcher.h"
|
| +
|
| +class Profile;
|
| +class ProfileResetter;
|
| +
|
| +namespace user_prefs {
|
| +class PrefRegistrySyncable;
|
| +} // namespace user_prefs
|
| +
|
| +namespace safe_browsing {
|
| +
|
| +// Registers the settings reset pending tracked preference.
|
| +void RegisterChromeCleanerProfilePrefs(
|
| + user_prefs::PrefRegistrySyncable* registry);
|
| +
|
| +// Returns the post-cleanup reset pending prefs for |profile|.
|
| +bool PostCleanupSettingsResetPending(Profile* profile);
|
| +
|
| +// Updates the post-cleanup reset pending prefs for |profile|.
|
| +void RecordPostCleanupSettingsResetPending(bool value, Profile* profile);
|
| +
|
| +// Tags |profile| to have its settings reset once the current cleanup finishes,
|
| +// by means of ResetPostCleanupSettingsIfTagged(). If a cleanup doesn't
|
| +// require a reboot and the browser is still running once the cleanup finishes,
|
| +// then settings will be reset as soon as the cleaner process returns; if the
|
| +// user closes the browser while the cleanup is ongoing, then settings will be
|
| +// reset on the first browser restart that happens after the cleaner process
|
| +// ends. If the cleanup requires a reboot, then settings will be reset on the
|
| +// first browser restart that happens after reboot.
|
| +void TagProfileForResetting(Profile* profile);
|
| +
|
| +class SettingsResetterDelegate {
|
| + public:
|
| + SettingsResetterDelegate();
|
| + virtual ~SettingsResetterDelegate();
|
| +
|
| + virtual void FetchDefaultSettings(
|
| + DefaultSettingsFetcher::SettingsCallback callback);
|
| +
|
| + virtual std::unique_ptr<ProfileResetter> GetProfileResetter(Profile* profile);
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(SettingsResetterDelegate);
|
| +};
|
| +
|
| +// Resets settings for the profiles in |profiles| there are tagged for
|
| +// resetting and a cleanup has completed. If a cleanup doesn't require a
|
| +// reboot and the session that started the cleanup is still alive, then
|
| +// the settings for all open profiles will be reset at once. Otherwise,
|
| +// for each profile that was open when the cleanup started, this will be
|
| +// called the next a browser is launched for the profile.
|
| +void ResetPostCleanupSettingsIfTagged(
|
| + std::vector<Profile*> profiles,
|
| + base::OnceClosure continuation,
|
| + std::unique_ptr<SettingsResetterDelegate> delegate = nullptr);
|
| +
|
| +} // namespace safe_browsing
|
| +
|
| +#endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_
|
|
|