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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/ui/webui/options/options_ui.h" | 10 #include "chrome/browser/ui/webui/options/options_ui.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class DictionaryValue; | 13 class DictionaryValue; |
14 class ListValue; | 14 class ListValue; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
| 17 class AutomaticProfileResetter; |
17 class BrandcodeConfigFetcher; | 18 class BrandcodeConfigFetcher; |
18 class ProfileResetter; | 19 class ProfileResetter; |
19 class ResettableSettingsSnapshot; | 20 class ResettableSettingsSnapshot; |
20 | 21 |
21 namespace options { | 22 namespace options { |
22 | 23 |
23 // Reset Profile Settings handler page UI handler. | 24 // Reset Profile Settings handler page UI handler. |
24 class ResetProfileSettingsHandler | 25 class ResetProfileSettingsHandler |
25 : public OptionsPageUIHandler, | 26 : public OptionsPageUIHandler, |
26 public base::SupportsWeakPtr<ResetProfileSettingsHandler> { | 27 public base::SupportsWeakPtr<ResetProfileSettingsHandler> { |
(...skipping 20 matching lines...) Expand all Loading... |
47 // Called when the confirmation box appears. | 48 // Called when the confirmation box appears. |
48 void OnShowResetProfileDialog(const base::ListValue* value); | 49 void OnShowResetProfileDialog(const base::ListValue* value); |
49 | 50 |
50 // Called when BrandcodeConfigFetcher completed fetching settings. | 51 // Called when BrandcodeConfigFetcher completed fetching settings. |
51 void OnSettingsFetched(); | 52 void OnSettingsFetched(); |
52 | 53 |
53 // Resets profile settings to default values. |send_settings| is true if user | 54 // Resets profile settings to default values. |send_settings| is true if user |
54 // gave his consent to upload broken settings to Google for analysis. | 55 // gave his consent to upload broken settings to Google for analysis. |
55 void ResetProfile(bool send_settings); | 56 void ResetProfile(bool send_settings); |
56 | 57 |
| 58 // Destroyed with the Profile, thus it should outlive us. |
| 59 AutomaticProfileResetter* automatic_profile_resetter_; |
| 60 |
57 scoped_ptr<ProfileResetter> resetter_; | 61 scoped_ptr<ProfileResetter> resetter_; |
58 | 62 |
59 scoped_ptr<BrandcodeConfigFetcher> config_fetcher_; | 63 scoped_ptr<BrandcodeConfigFetcher> config_fetcher_; |
60 | 64 |
61 // Snapshot of settings before profile was reseted. | 65 // Snapshot of settings before profile was reseted. |
62 scoped_ptr<ResettableSettingsSnapshot> setting_snapshot_; | 66 scoped_ptr<ResettableSettingsSnapshot> setting_snapshot_; |
63 | 67 |
64 // Contains Chrome brand code; empty for organic Chrome. | 68 // Contains Chrome brand code; empty for organic Chrome. |
65 std::string brandcode_; | 69 std::string brandcode_; |
66 | 70 |
67 DISALLOW_COPY_AND_ASSIGN(ResetProfileSettingsHandler); | 71 DISALLOW_COPY_AND_ASSIGN(ResetProfileSettingsHandler); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace options | 74 } // namespace options |
71 | 75 |
72 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ | 76 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_ |
OLD | NEW |