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 #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 DCHECK(brandcode_.empty()); | 191 DCHECK(brandcode_.empty()); |
192 } | 192 } |
193 | 193 |
194 // If failed to fetch BrandcodedDefaultSettings or this is an organic | 194 // If failed to fetch BrandcodedDefaultSettings or this is an organic |
195 // installation, use default settings. | 195 // installation, use default settings. |
196 if (!default_settings) | 196 if (!default_settings) |
197 default_settings.reset(new BrandcodedDefaultSettings); | 197 default_settings.reset(new BrandcodedDefaultSettings); |
198 resetter_->Reset( | 198 resetter_->Reset( |
199 ProfileResetter::ALL, | 199 ProfileResetter::ALL, |
200 default_settings.Pass(), | 200 default_settings.Pass(), |
| 201 send_settings, |
201 base::Bind(&ResetProfileSettingsHandler::OnResetProfileSettingsDone, | 202 base::Bind(&ResetProfileSettingsHandler::OnResetProfileSettingsDone, |
202 AsWeakPtr(), | 203 AsWeakPtr(), |
203 send_settings)); | 204 send_settings)); |
204 content::RecordAction(base::UserMetricsAction("ResetProfile")); | 205 content::RecordAction(base::UserMetricsAction("ResetProfile")); |
205 UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings); | 206 UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings); |
206 } | 207 } |
207 | 208 |
208 void ResetProfileSettingsHandler::UpdateFeedbackUI() { | 209 void ResetProfileSettingsHandler::UpdateFeedbackUI() { |
209 if (!setting_snapshot_) | 210 if (!setting_snapshot_) |
210 return; | 211 return; |
211 scoped_ptr<base::ListValue> list = GetReadableFeedbackForSnapshot( | 212 scoped_ptr<base::ListValue> list = GetReadableFeedbackForSnapshot( |
212 Profile::FromWebUI(web_ui()), | 213 Profile::FromWebUI(web_ui()), |
213 *setting_snapshot_); | 214 *setting_snapshot_); |
214 base::DictionaryValue feedback_info; | 215 base::DictionaryValue feedback_info; |
215 feedback_info.Set("feedbackInfo", list.release()); | 216 feedback_info.Set("feedbackInfo", list.release()); |
216 web_ui()->CallJavascriptFunction( | 217 web_ui()->CallJavascriptFunction( |
217 "ResetProfileSettingsOverlay.setFeedbackInfo", | 218 "ResetProfileSettingsOverlay.setFeedbackInfo", |
218 feedback_info); | 219 feedback_info); |
219 } | 220 } |
220 | 221 |
221 } // namespace options | 222 } // namespace options |
OLD | NEW |