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

Side by Side Diff: chrome/browser/ui/webui/options2/core_options_handler2.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 12 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/options2/core_options_handler2.h" 5 #include "chrome/browser/ui/webui/options2/core_options_handler2.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/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 case base::Value::TYPE_DOUBLE: 203 case base::Value::TYPE_DOUBLE:
204 case base::Value::TYPE_STRING: 204 case base::Value::TYPE_STRING:
205 pref_service->Set(pref_name.c_str(), *value); 205 pref_service->Set(pref_name.c_str(), *value);
206 break; 206 break;
207 207
208 default: 208 default:
209 NOTREACHED(); 209 NOTREACHED();
210 return; 210 return;
211 } 211 }
212 212
213 pref_service->ScheduleSavePersistentPrefs();
214
215 ProcessUserMetric(value, metric); 213 ProcessUserMetric(value, metric);
216 } 214 }
217 215
218 void CoreOptionsHandler::ClearPref(const std::string& pref_name, 216 void CoreOptionsHandler::ClearPref(const std::string& pref_name,
219 const std::string& metric) { 217 const std::string& metric) {
220 PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs(); 218 PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
221 pref_service->ClearPref(pref_name.c_str()); 219 pref_service->ClearPref(pref_name.c_str());
222 pref_service->ScheduleSavePersistentPrefs();
223 220
224 if (!metric.empty()) 221 if (!metric.empty())
225 content::RecordComputedAction(metric); 222 content::RecordComputedAction(metric);
226 } 223 }
227 224
228 void CoreOptionsHandler::ProcessUserMetric(const base::Value* value, 225 void CoreOptionsHandler::ProcessUserMetric(const base::Value* value,
229 const std::string& metric) { 226 const std::string& metric) {
230 if (metric.empty()) 227 if (metric.empty())
231 return; 228 return;
232 229
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 460
464 void CoreOptionsHandler::UpdateClearPluginLSOData() { 461 void CoreOptionsHandler::UpdateClearPluginLSOData() {
465 scoped_ptr<base::Value> enabled( 462 scoped_ptr<base::Value> enabled(
466 base::Value::CreateBooleanValue( 463 base::Value::CreateBooleanValue(
467 clear_plugin_lso_data_enabled_.GetValue())); 464 clear_plugin_lso_data_enabled_.GetValue()));
468 web_ui_->CallJavascriptFunction( 465 web_ui_->CallJavascriptFunction(
469 "OptionsPage.setClearPluginLSODataEnabled", *enabled); 466 "OptionsPage.setClearPluginLSODataEnabled", *enabled);
470 } 467 }
471 468
472 } // namespace options2 469 } // namespace options2
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/core_options_handler.cc ('k') | chrome/common/json_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698