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

Unified Diff: chrome/browser/ui/webui/settings/reset_settings_handler.h

Issue 1490503002: MD Settings: Adding unit test for ResetSettingsHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years 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/ui/webui/settings/reset_settings_handler.h
diff --git a/chrome/browser/ui/webui/settings/reset_settings_handler.h b/chrome/browser/ui/webui/settings/reset_settings_handler.h
index 04079471a24444503c1efc49a24841d2d9cb3d4c..a0e42070b856b1de387fc9c821ac0132735f2f24 100644
--- a/chrome/browser/ui/webui/settings/reset_settings_handler.h
+++ b/chrome/browser/ui/webui/settings/reset_settings_handler.h
@@ -23,6 +23,7 @@ class WebUIDataSource;
}
class BrandcodeConfigFetcher;
+class Profile;
class ProfileResetter;
class ResettableSettingsSnapshot;
@@ -35,26 +36,32 @@ class ResetSettingsHandler
: public SettingsPageUIHandler,
public base::SupportsWeakPtr<ResetSettingsHandler> {
public:
- explicit ResetSettingsHandler(
- content::WebUIDataSource* html_source, content::WebUI* web_ui);
+ explicit ResetSettingsHandler(Profile* profile, bool allow_powerwash);
Dan Beam 2015/12/01 04:27:37 drop explicit, make private or protected
dpapad 2015/12/01 19:06:04 Done.
~ResetSettingsHandler() override;
+ static ResetSettingsHandler* Create(
+ content::WebUIDataSource* html_source, Profile* profile);
+
// WebUIMessageHandler implementation.
void RegisterMessages() override;
- private:
+ // Overriden in tests to substitute with a test version of ProfileResetter.
+ virtual ProfileResetter* GetResetter();
Dan Beam 2015/12/01 04:27:37 protected
dpapad 2015/12/01 19:06:04 Done.
+
+ protected:
// Javascript callback to start clearing data.
void HandleResetProfileSettings(const base::ListValue* value);
- // Closes the dialog once all requested settings has been reset.
- void OnResetProfileSettingsDone(bool send_feedback);
-
+ private:
// Called when the confirmation box appears.
void OnShowResetProfileDialog(const base::ListValue* value);
// Called when the confirmation box disappears.
void OnHideResetProfileDialog(const base::ListValue* value);
+ // Closes the dialog once all requested settings has been reset.
+ void OnResetProfileSettingsDone(bool send_feedback);
+
// Called when BrandcodeConfigFetcher completed fetching settings.
void OnSettingsFetched();
@@ -77,6 +84,8 @@ class ResetSettingsHandler
bool allow_powerwash_ = false;
#endif // defined(OS_CHROMEOS)
+ Profile* profile_;
+
scoped_ptr<ProfileResetter> resetter_;
scoped_ptr<BrandcodeConfigFetcher> config_fetcher_;

Powered by Google App Engine
This is Rietveld 408576698