OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/prefs/pref_service.h" | 5 #include "components/prefs/pref_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 void PrefService::ClearMutableValues() { | 383 void PrefService::ClearMutableValues() { |
384 user_pref_store_->ClearMutableValues(); | 384 user_pref_store_->ClearMutableValues(); |
385 } | 385 } |
386 | 386 |
387 void PrefService::Set(const std::string& path, const base::Value& value) { | 387 void PrefService::Set(const std::string& path, const base::Value& value) { |
388 SetUserPrefValue(path, value.DeepCopy()); | 388 SetUserPrefValue(path, value.DeepCopy()); |
389 } | 389 } |
390 | 390 |
391 void PrefService::SetBoolean(const std::string& path, bool value) { | 391 void PrefService::SetBoolean(const std::string& path, bool value) { |
392 SetUserPrefValue(path, new base::FundamentalValue(value)); | 392 SetUserPrefValue(path, new base::Value(value)); |
393 } | 393 } |
394 | 394 |
395 void PrefService::SetInteger(const std::string& path, int value) { | 395 void PrefService::SetInteger(const std::string& path, int value) { |
396 SetUserPrefValue(path, new base::FundamentalValue(value)); | 396 SetUserPrefValue(path, new base::Value(value)); |
397 } | 397 } |
398 | 398 |
399 void PrefService::SetDouble(const std::string& path, double value) { | 399 void PrefService::SetDouble(const std::string& path, double value) { |
400 SetUserPrefValue(path, new base::FundamentalValue(value)); | 400 SetUserPrefValue(path, new base::Value(value)); |
401 } | 401 } |
402 | 402 |
403 void PrefService::SetString(const std::string& path, const std::string& value) { | 403 void PrefService::SetString(const std::string& path, const std::string& value) { |
404 SetUserPrefValue(path, new base::StringValue(value)); | 404 SetUserPrefValue(path, new base::StringValue(value)); |
405 } | 405 } |
406 | 406 |
407 void PrefService::SetFilePath(const std::string& path, | 407 void PrefService::SetFilePath(const std::string& path, |
408 const base::FilePath& value) { | 408 const base::FilePath& value) { |
409 SetUserPrefValue(path, base::CreateFilePathValue(value)); | 409 SetUserPrefValue(path, base::CreateFilePathValue(value)); |
410 } | 410 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 DCHECK(found_value->IsType(default_type)); | 613 DCHECK(found_value->IsType(default_type)); |
614 return found_value; | 614 return found_value; |
615 } else { | 615 } else { |
616 // Every registered preference has at least a default value. | 616 // Every registered preference has at least a default value. |
617 NOTREACHED() << "no valid value found for registered pref " << path; | 617 NOTREACHED() << "no valid value found for registered pref " << path; |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 return NULL; | 621 return NULL; |
622 } | 622 } |
OLD | NEW |