Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h

Issue 2906103002: Post-cleanup settings reset. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1a8e57eaefbd0bcad4829a6ce48a2c5b545df855
--- /dev/null
+++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h
@@ -0,0 +1,51 @@
+// 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 safe_browsing {
+
+// Tags the last active profile to be reset once the current cleanup finishes,
+// by means of ResetCurrentProfilePostCleanupIfTagged(). 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 TagCurrentProfileForResetting();
+
+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 current profile if it's tagged for reset and a
+// cleanup has completed.
+void ResetCurrentProfilePostCleanupIfTagged(
+ base::OnceClosure continuation,
+ std::unique_ptr<SettingsResetterDelegate> delegate = nullptr);
+
+} // namespace safe_browsing
+
+#endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_SETTINGS_RESETTER_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698