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 <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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ResetProfileSettingsHandler::~ResetProfileSettingsHandler() {} | 69 ResetProfileSettingsHandler::~ResetProfileSettingsHandler() {} |
70 | 70 |
71 void ResetProfileSettingsHandler::InitializeHandler() { | 71 void ResetProfileSettingsHandler::InitializeHandler() { |
72 Profile* profile = Profile::FromWebUI(web_ui()); | 72 Profile* profile = Profile::FromWebUI(web_ui()); |
73 resetter_.reset(new ProfileResetter(profile)); | 73 resetter_.reset(new ProfileResetter(profile)); |
74 } | 74 } |
75 | 75 |
76 void ResetProfileSettingsHandler::InitializePage() { | 76 void ResetProfileSettingsHandler::InitializePage() { |
77 web_ui()->CallJavascriptFunctionUnsafe( | 77 web_ui()->CallJavascriptFunctionUnsafe( |
78 "ResetProfileSettingsOverlay.setResettingState", | 78 "ResetProfileSettingsOverlay.setResettingState", |
79 base::FundamentalValue(resetter_->IsActive())); | 79 base::Value(resetter_->IsActive())); |
80 } | 80 } |
81 | 81 |
82 void ResetProfileSettingsHandler::GetLocalizedValues( | 82 void ResetProfileSettingsHandler::GetLocalizedValues( |
83 base::DictionaryValue* localized_strings) { | 83 base::DictionaryValue* localized_strings) { |
84 DCHECK(localized_strings); | 84 DCHECK(localized_strings); |
85 | 85 |
86 static OptionsStringResource resources[] = { | 86 static OptionsStringResource resources[] = { |
87 { "resetProfileSettingsCommit", IDS_RESET_PROFILE_SETTINGS_COMMIT_BUTTON }, | 87 { "resetProfileSettingsCommit", IDS_RESET_PROFILE_SETTINGS_COMMIT_BUTTON }, |
88 { "resetProfileSettingsExplanation", | 88 { "resetProfileSettingsExplanation", |
89 IDS_RESET_PROFILE_SETTINGS_EXPLANATION }, | 89 IDS_RESET_PROFILE_SETTINGS_EXPLANATION }, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 return; | 260 return; |
261 std::unique_ptr<base::ListValue> list = GetReadableFeedbackForSnapshot( | 261 std::unique_ptr<base::ListValue> list = GetReadableFeedbackForSnapshot( |
262 Profile::FromWebUI(web_ui()), *setting_snapshot_); | 262 Profile::FromWebUI(web_ui()), *setting_snapshot_); |
263 base::DictionaryValue feedback_info; | 263 base::DictionaryValue feedback_info; |
264 feedback_info.Set("feedbackInfo", list.release()); | 264 feedback_info.Set("feedbackInfo", list.release()); |
265 web_ui()->CallJavascriptFunctionUnsafe( | 265 web_ui()->CallJavascriptFunctionUnsafe( |
266 "ResetProfileSettingsOverlay.setFeedbackInfo", feedback_info); | 266 "ResetProfileSettingsOverlay.setFeedbackInfo", feedback_info); |
267 } | 267 } |
268 | 268 |
269 } // namespace options | 269 } // namespace options |
OLD | NEW |