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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 base::Unretained(this))); | 133 base::Unretained(this))); |
134 web_ui()->RegisterMessageCallback("onDismissedResetProfileSettingsBanner", | 134 web_ui()->RegisterMessageCallback("onDismissedResetProfileSettingsBanner", |
135 base::Bind(&ResetProfileSettingsHandler:: | 135 base::Bind(&ResetProfileSettingsHandler:: |
136 OnDismissedResetProfileSettingsBanner, | 136 OnDismissedResetProfileSettingsBanner, |
137 base::Unretained(this))); | 137 base::Unretained(this))); |
138 } | 138 } |
139 | 139 |
140 void ResetProfileSettingsHandler::HandleResetProfileSettings( | 140 void ResetProfileSettingsHandler::HandleResetProfileSettings( |
141 const base::ListValue* value) { | 141 const base::ListValue* value) { |
142 bool send_settings = false; | 142 bool send_settings = false; |
143 if (!value->GetBoolean(0, &send_settings)) | 143 bool success = value->GetBoolean(0, &send_settings); |
144 NOTREACHED(); | 144 DCHECK(success); |
145 | 145 |
146 DCHECK(brandcode_.empty() || config_fetcher_); | 146 DCHECK(brandcode_.empty() || config_fetcher_); |
147 if (config_fetcher_ && config_fetcher_->IsActive()) { | 147 if (config_fetcher_ && config_fetcher_->IsActive()) { |
148 // Reset once the prefs are fetched. | 148 // Reset once the prefs are fetched. |
149 config_fetcher_->SetCallback( | 149 config_fetcher_->SetCallback( |
150 base::Bind(&ResetProfileSettingsHandler::ResetProfile, | 150 base::Bind(&ResetProfileSettingsHandler::ResetProfile, |
151 Unretained(this), | 151 Unretained(this), |
152 send_settings)); | 152 send_settings)); |
153 } else { | 153 } else { |
154 ResetProfile(send_settings); | 154 ResetProfile(send_settings); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 Profile::FromWebUI(web_ui()), | 255 Profile::FromWebUI(web_ui()), |
256 *setting_snapshot_); | 256 *setting_snapshot_); |
257 base::DictionaryValue feedback_info; | 257 base::DictionaryValue feedback_info; |
258 feedback_info.Set("feedbackInfo", list.release()); | 258 feedback_info.Set("feedbackInfo", list.release()); |
259 web_ui()->CallJavascriptFunction( | 259 web_ui()->CallJavascriptFunction( |
260 "ResetProfileSettingsOverlay.setFeedbackInfo", | 260 "ResetProfileSettingsOverlay.setFeedbackInfo", |
261 feedback_info); | 261 feedback_info); |
262 } | 262 } |
263 | 263 |
264 } // namespace options | 264 } // namespace options |
OLD | NEW |