Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/browser/ui/webui/options/reset_profile_settings_handler.cc

Issue 1418803004: MD Settings: Migrating C++ handlers for profile reset page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renaming handler to to fix GN build Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/reset_page/reset_page.js ('k') | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698