| 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_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void InitializePage() override; | 39 void InitializePage() override; |
| 40 | 40 |
| 41 // WebUIMessageHandler implementation. | 41 // WebUIMessageHandler implementation. |
| 42 void RegisterMessages() override; | 42 void RegisterMessages() override; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 // Javascript callback to start clearing data. | 45 // Javascript callback to start clearing data. |
| 46 void HandleResetProfileSettings(const base::ListValue* value); | 46 void HandleResetProfileSettings(const base::ListValue* value); |
| 47 | 47 |
| 48 // Closes the dialog once all requested settings has been reset. | 48 // Closes the dialog once all requested settings has been reset. |
| 49 void OnResetProfileSettingsDone(bool send_feedback); | 49 void OnResetProfileSettingsDone(bool send_feedback, |
| 50 const std::string& reset_request_origin); |
| 50 | 51 |
| 51 // Called when the confirmation box appears. | 52 // Called when the confirmation box appears. |
| 52 void OnShowResetProfileDialog(const base::ListValue* value); | 53 void OnShowResetProfileDialog(const base::ListValue* value); |
| 53 | 54 |
| 54 // Called when the confirmation box disappears. | 55 // Called when the confirmation box disappears. |
| 55 void OnHideResetProfileDialog(const base::ListValue* value); | 56 void OnHideResetProfileDialog(const base::ListValue* value); |
| 56 | 57 |
| 57 // Called when BrandcodeConfigFetcher completed fetching settings. | 58 // Called when BrandcodeConfigFetcher completed fetching settings. |
| 58 void OnSettingsFetched(); | 59 void OnSettingsFetched(); |
| 59 | 60 |
| 60 // Resets profile settings to default values. |send_settings| is true if user | 61 // Resets profile settings to default values. |send_settings| is true if user |
| 61 // gave his consent to upload broken settings to Google for analysis. | 62 // gave his consent to upload broken settings to Google for analysis. |
| 62 void ResetProfile(bool send_settings); | 63 void ResetProfile(bool send_settings, |
| 64 const std::string& reset_request_origin); |
| 63 | 65 |
| 64 // Sets new values for the feedback area. | 66 // Sets new values for the feedback area. |
| 65 void UpdateFeedbackUI(); | 67 void UpdateFeedbackUI(); |
| 66 | 68 |
| 67 std::unique_ptr<ProfileResetter> resetter_; | 69 std::unique_ptr<ProfileResetter> resetter_; |
| 68 | 70 |
| 69 std::unique_ptr<BrandcodeConfigFetcher> config_fetcher_; | 71 std::unique_ptr<BrandcodeConfigFetcher> config_fetcher_; |
| 70 | 72 |
| 71 // Snapshot of settings before profile was reseted. | 73 // Snapshot of settings before profile was reseted. |
| 72 std::unique_ptr<ResettableSettingsSnapshot> setting_snapshot_; | 74 std::unique_ptr<ResettableSettingsSnapshot> setting_snapshot_; |
| 73 | 75 |
| 74 // Contains Chrome brand code; empty for organic Chrome. | 76 // Contains Chrome brand code; empty for organic Chrome. |
| 75 std::string brandcode_; | 77 std::string brandcode_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(ResetProfileSettingsHandler); | 79 DISALLOW_COPY_AND_ASSIGN(ResetProfileSettingsHandler); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace options | 82 } // namespace options |
| 81 | 83 |
| 82 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ | 84 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ |
| OLD | NEW |