| Index: chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h
|
| diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h
|
| index 7ac123f0cdac364039debe61afa79e8fcccacc09..e866a6993cf34818e0702ff12accbe160fdce906 100644
|
| --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h
|
| +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h
|
| @@ -53,21 +53,11 @@ class SettingsResetPromptModel {
|
|
|
| using ExtensionMap =
|
| std::unordered_map<extensions::ExtensionId, ExtensionInfo>;
|
| - using CreateCallback =
|
| - base::Callback<void(std::unique_ptr<SettingsResetPromptModel>)>;
|
| -
|
| - // Creates a new |SettingsResetPromptModel| and passes it to |callback|. This
|
| - // function should be called on the UI thread.
|
| - static void Create(Profile* profile,
|
| - std::unique_ptr<SettingsResetPromptConfig> prompt_config,
|
| - CreateCallback callback);
|
| - static std::unique_ptr<SettingsResetPromptModel> CreateForTesting(
|
| +
|
| + SettingsResetPromptModel(
|
| Profile* profile,
|
| std::unique_ptr<SettingsResetPromptConfig> prompt_config,
|
| - std::unique_ptr<ResettableSettingsSnapshot> settings_snapshot,
|
| - std::unique_ptr<BrandcodedDefaultSettings> default_settings,
|
| std::unique_ptr<ProfileResetter> profile_resetter);
|
| -
|
| virtual ~SettingsResetPromptModel();
|
|
|
| Profile* profile() const;
|
| @@ -81,7 +71,9 @@ class SettingsResetPromptModel {
|
| // operation has been completed.
|
| //
|
| // NOTE: Can only be called once during the lifetime of this object.
|
| - virtual void PerformReset(const base::Closure& done_callback);
|
| + virtual void PerformReset(
|
| + std::unique_ptr<BrandcodedDefaultSettings> default_settings,
|
| + const base::Closure& done_callback);
|
| // To be called when the reset prompt dialog has been shown so that
|
| // preferences can be updated.
|
| virtual void DialogShown();
|
| @@ -106,22 +98,7 @@ class SettingsResetPromptModel {
|
|
|
| void ReportUmaMetrics() const;
|
|
|
| - protected:
|
| - // Exposed for mocking in tests.
|
| - SettingsResetPromptModel(
|
| - Profile* profile,
|
| - std::unique_ptr<SettingsResetPromptConfig> prompt_config,
|
| - std::unique_ptr<ResettableSettingsSnapshot> settings_snapshot,
|
| - std::unique_ptr<BrandcodedDefaultSettings> default_settings,
|
| - std::unique_ptr<ProfileResetter> profile_resetter);
|
| -
|
| private:
|
| - static void OnSettingsFetched(
|
| - Profile* profile,
|
| - std::unique_ptr<SettingsResetPromptConfig> prompt_config,
|
| - SettingsResetPromptModel::CreateCallback callback,
|
| - std::unique_ptr<BrandcodedDefaultSettings> default_settings);
|
| -
|
| // Functions to be called by the constructor to initialize the model
|
| // object. These functions should be called in the order in which they are
|
| // declared here so that the correct setting is chosen for the prompt when
|
| @@ -147,9 +124,6 @@ class SettingsResetPromptModel {
|
| SettingsResetPromptPrefsManager prefs_manager_;
|
| std::unique_ptr<SettingsResetPromptConfig> prompt_config_;
|
| std::unique_ptr<ResettableSettingsSnapshot> settings_snapshot_;
|
| - // |default_settings_| should only be accessed on the UI thread after
|
| - // construction.
|
| - std::unique_ptr<BrandcodedDefaultSettings> default_settings_;
|
| std::unique_ptr<ProfileResetter> profile_resetter_;
|
|
|
| // A single timestamp to be used by all initialization functions to determine
|
|
|