OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ | 5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ |
6 #define CHROME_BROWSER_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ | 6 #define CHROME_BROWSER_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 bool shortcuts_determined_; | 104 bool shortcuts_determined_; |
105 | 105 |
106 // The flag to cancel shortcuts retrieving. | 106 // The flag to cancel shortcuts retrieving. |
107 scoped_refptr<SharedCancellationFlag> cancellation_flag_; | 107 scoped_refptr<SharedCancellationFlag> cancellation_flag_; |
108 | 108 |
109 base::WeakPtrFactory<ResettableSettingsSnapshot> weak_ptr_factory_; | 109 base::WeakPtrFactory<ResettableSettingsSnapshot> weak_ptr_factory_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(ResettableSettingsSnapshot); | 111 DISALLOW_COPY_AND_ASSIGN(ResettableSettingsSnapshot); |
112 }; | 112 }; |
113 | 113 |
114 // The caller of ResettableSettingsSnapshot. | |
115 enum SnapshotCaller { | |
116 PROFILE_RESET_WEBUI = 0, | |
117 PROFILE_RESET_PROMPT, | |
118 }; | |
119 | |
120 // Serializes specified |snapshot| members to JSON format. |field_mask| is a bit | 114 // Serializes specified |snapshot| members to JSON format. |field_mask| is a bit |
121 // mask of ResettableSettingsSnapshot::Field values. | 115 // mask of ResettableSettingsSnapshot::Field values. |
122 std::string SerializeSettingsReport(const ResettableSettingsSnapshot& snapshot, | 116 std::string SerializeSettingsReport(const ResettableSettingsSnapshot& snapshot, |
123 int field_mask); | 117 int field_mask); |
124 | 118 |
125 // Sends |report| as a feedback. |report| is supposed to be result of | 119 // Sends |report| as a feedback. |report| is supposed to be result of |
126 // SerializeSettingsReport(). | 120 // SerializeSettingsReport(). |
127 void SendSettingsFeedback(const std::string& report, | 121 void SendSettingsFeedback(const std::string& report, |
128 Profile* profile, | 122 Profile* profile); |
129 SnapshotCaller caller); | |
130 | 123 |
131 // Returns list of key/value pairs for all available reported information | 124 // Returns list of key/value pairs for all available reported information |
132 // from the |profile| and some additional fields. | 125 // from the |profile| and some additional fields. |
133 scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot( | 126 scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot( |
134 Profile* profile, | 127 Profile* profile, |
135 const ResettableSettingsSnapshot& snapshot); | 128 const ResettableSettingsSnapshot& snapshot); |
136 | 129 |
137 #endif // CHROME_BROWSER_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ | 130 #endif // CHROME_BROWSER_PROFILE_RESETTER_RESETTABLE_SETTINGS_SNAPSHOT_H_ |
OLD | NEW |