| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 protected: | 46 protected: |
| 47 ResetSettingsHandler(Profile* profile, bool allow_powerwash); | 47 ResetSettingsHandler(Profile* profile, bool allow_powerwash); |
| 48 | 48 |
| 49 // Overriden in tests to substitute with a test version of ProfileResetter. | 49 // Overriden in tests to substitute with a test version of ProfileResetter. |
| 50 virtual ProfileResetter* GetResetter(); | 50 virtual ProfileResetter* GetResetter(); |
| 51 | 51 |
| 52 // Javascript callback to start clearing data. | 52 // Javascript callback to start clearing data. |
| 53 void HandleResetProfileSettings(const base::ListValue* args); | 53 void HandleResetProfileSettings(const base::ListValue* args); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // Retrieves the settings that will be reported, called from Javascript. |
| 57 void HandleGetReportedSettings(const base::ListValue* args); |
| 58 |
| 59 // Called once the settings that will be reported have been retrieved. |
| 60 void OnGetReportedSettingsDone(std::string callback_id); |
| 61 |
| 56 // Called when the reset profile dialog is shown. | 62 // Called when the reset profile dialog is shown. |
| 57 void OnShowResetProfileDialog(const base::ListValue* args); | 63 void OnShowResetProfileDialog(const base::ListValue* args); |
| 58 | 64 |
| 59 // Called when the reset profile dialog is hidden. | 65 // Called when the reset profile dialog is hidden. |
| 60 void OnHideResetProfileDialog(const base::ListValue* args); | 66 void OnHideResetProfileDialog(const base::ListValue* args); |
| 61 | 67 |
| 62 // Called when the reset profile banner is shown. | 68 // Called when the reset profile banner is shown. |
| 63 void OnHideResetProfileBanner(const base::ListValue* args); | 69 void OnHideResetProfileBanner(const base::ListValue* args); |
| 64 | 70 |
| 65 // Called when BrandcodeConfigFetcher completed fetching settings. | 71 // Called when BrandcodeConfigFetcher completed fetching settings. |
| 66 void OnSettingsFetched(); | 72 void OnSettingsFetched(); |
| 67 | 73 |
| 68 // Resets profile settings to default values. |send_settings| is true if user | 74 // Resets profile settings to default values. |send_settings| is true if user |
| 69 // gave his consent to upload broken settings to Google for analysis. | 75 // gave his consent to upload broken settings to Google for analysis. |
| 70 void ResetProfile(std::string callback_id, bool send_settings); | 76 void ResetProfile(std::string callback_id, bool send_settings); |
| 71 | 77 |
| 72 // Closes the dialog once all requested settings has been reset. | 78 // Closes the dialog once all requested settings has been reset. |
| 73 void OnResetProfileSettingsDone(std::string callback_id, | 79 void OnResetProfileSettingsDone(std::string callback_id, |
| 74 bool send_feedback); | 80 bool send_feedback); |
| 75 | 81 |
| 76 // Sets new values for the feedback area. | |
| 77 void UpdateFeedbackUI(); | |
| 78 | |
| 79 #if defined(OS_CHROMEOS) | 82 #if defined(OS_CHROMEOS) |
| 80 // Will be called when powerwash dialog is shown. | 83 // Will be called when powerwash dialog is shown. |
| 81 void OnShowPowerwashDialog(const base::ListValue* args); | 84 void OnShowPowerwashDialog(const base::ListValue* args); |
| 82 | 85 |
| 83 // Sets a pref indicating that a factory reset is requested and then requests | 86 // Sets a pref indicating that a factory reset is requested and then requests |
| 84 // a restart. | 87 // a restart. |
| 85 void HandleFactoryResetRestart(const base::ListValue* args); | 88 void HandleFactoryResetRestart(const base::ListValue* args); |
| 86 | 89 |
| 87 // Whether factory reset can be performed. | 90 // Whether factory reset can be performed. |
| 88 bool allow_powerwash_ = false; | 91 bool allow_powerwash_ = false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 std::string brandcode_; | 104 std::string brandcode_; |
| 102 | 105 |
| 103 base::WeakPtrFactory<ResetSettingsHandler> weak_ptr_factory_; | 106 base::WeakPtrFactory<ResetSettingsHandler> weak_ptr_factory_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(ResetSettingsHandler); | 108 DISALLOW_COPY_AND_ASSIGN(ResetSettingsHandler); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace settings | 111 } // namespace settings |
| 109 | 112 |
| 110 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ | 113 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_RESET_SETTINGS_HANDLER_H_ |
| OLD | NEW |