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

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: Addressing comments 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..6238dec1b3a4e29e818245c566e3a2406d1b4f33 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,17 +36,24 @@ class ResetSettingsHandler
: public SettingsPageUIHandler,
public base::SupportsWeakPtr<ResetSettingsHandler> {
public:
- explicit ResetSettingsHandler(
- content::WebUIDataSource* html_source, content::WebUI* web_ui);
~ResetSettingsHandler() override;
+ static ResetSettingsHandler* Create(
+ content::WebUIDataSource* html_source, Profile* profile);
+
// WebUIMessageHandler implementation.
void RegisterMessages() override;
- private:
+ protected:
+ ResetSettingsHandler(Profile* profile, bool allow_powerwash);
+
+ // Overriden in tests to substitute with a test version of ProfileResetter.
+ virtual ProfileResetter* GetResetter();
+
// Javascript callback to start clearing data.
void HandleResetProfileSettings(const base::ListValue* value);
+ private:
// Closes the dialog once all requested settings has been reset.
void OnResetProfileSettingsDone(bool send_feedback);
@@ -77,6 +85,8 @@ class ResetSettingsHandler
bool allow_powerwash_ = false;
#endif // defined(OS_CHROMEOS)
+ Profile* const profile_;
+
scoped_ptr<ProfileResetter> resetter_;
scoped_ptr<BrandcodeConfigFetcher> config_fetcher_;
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.cc ('k') | chrome/browser/ui/webui/settings/reset_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698