| 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/settings/reset_settings_handler.h" | 5 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 send_settings, request_origin)); | 150 send_settings, request_origin)); |
| 151 } else { | 151 } else { |
| 152 ResetProfile(callback_id, send_settings, request_origin); | 152 ResetProfile(callback_id, send_settings, request_origin); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void ResetSettingsHandler::OnResetProfileSettingsDone( | 156 void ResetSettingsHandler::OnResetProfileSettingsDone( |
| 157 std::string callback_id, | 157 std::string callback_id, |
| 158 bool send_feedback, | 158 bool send_feedback, |
| 159 reset_report::ChromeResetReport::ResetRequestOrigin request_origin) { | 159 reset_report::ChromeResetReport::ResetRequestOrigin request_origin) { |
| 160 ResolveJavascriptCallback(base::Value(callback_id), | 160 ResolveJavascriptCallback(base::Value(callback_id), base::Value()); |
| 161 *base::Value::CreateNullValue()); | |
| 162 if (send_feedback && setting_snapshot_) { | 161 if (send_feedback && setting_snapshot_) { |
| 163 ResettableSettingsSnapshot current_snapshot(profile_); | 162 ResettableSettingsSnapshot current_snapshot(profile_); |
| 164 int difference = setting_snapshot_->FindDifferentFields(current_snapshot); | 163 int difference = setting_snapshot_->FindDifferentFields(current_snapshot); |
| 165 if (difference) { | 164 if (difference) { |
| 166 setting_snapshot_->Subtract(current_snapshot); | 165 setting_snapshot_->Subtract(current_snapshot); |
| 167 std::unique_ptr<reset_report::ChromeResetReport> report_proto = | 166 std::unique_ptr<reset_report::ChromeResetReport> report_proto = |
| 168 SerializeSettingsReportToProto(*setting_snapshot_, difference); | 167 SerializeSettingsReportToProto(*setting_snapshot_, difference); |
| 169 if (report_proto) { | 168 if (report_proto) { |
| 170 report_proto->set_reset_request_origin(request_origin); | 169 report_proto->set_reset_request_origin(request_origin); |
| 171 SendSettingsFeedbackProto(*report_proto, profile_); | 170 SendSettingsFeedbackProto(*report_proto, profile_); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void ResetSettingsHandler::OnShowPowerwashDialog( | 301 void ResetSettingsHandler::OnShowPowerwashDialog( |
| 303 const base::ListValue* args) { | 302 const base::ListValue* args) { |
| 304 UMA_HISTOGRAM_ENUMERATION( | 303 UMA_HISTOGRAM_ENUMERATION( |
| 305 "Reset.ChromeOS.PowerwashDialogShown", | 304 "Reset.ChromeOS.PowerwashDialogShown", |
| 306 chromeos::reset::DIALOG_FROM_OPTIONS, | 305 chromeos::reset::DIALOG_FROM_OPTIONS, |
| 307 chromeos::reset::DIALOG_VIEW_TYPE_SIZE); | 306 chromeos::reset::DIALOG_VIEW_TYPE_SIZE); |
| 308 } | 307 } |
| 309 #endif // defined(OS_CHROMEOS) | 308 #endif // defined(OS_CHROMEOS) |
| 310 | 309 |
| 311 } // namespace settings | 310 } // namespace settings |
| OLD | NEW |