[email protected] | 2dea5c0 | 2012-04-25 07:01:07 | [diff] [blame^] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/prefs/default_pref_store.h" | ||||
6 | |||||
[email protected] | bab1c13f | 2011-08-12 20:59:02 | [diff] [blame] | 7 | using base::Value; |
8 | |||||
[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 9 | DefaultPrefStore::DefaultPrefStore() {} |
10 | |||||
[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 11 | void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) { |
12 | CHECK(GetValue(key, NULL) == READ_NO_VALUE); | ||||
13 | SetValue(key, value); | ||||
14 | } | ||||
15 | |||||
[email protected] | 7a5f593 | 2011-12-29 10:35:49 | [diff] [blame] | 16 | void DefaultPrefStore::RemoveDefaultValue(const std::string& key) { |
17 | CHECK(GetValue(key, NULL) == READ_OK); | ||||
18 | RemoveValue(key); | ||||
19 | } | ||||
20 | |||||
[email protected] | bab1c13f | 2011-08-12 20:59:02 | [diff] [blame] | 21 | base::Value::Type DefaultPrefStore::GetType(const std::string& key) const { |
[email protected] | 68bf41a | 2011-03-25 16:38:31 | [diff] [blame] | 22 | const Value* value; |
[email protected] | bab1c13f | 2011-08-12 20:59:02 | [diff] [blame] | 23 | return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL; |
[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 24 | } |
[email protected] | 2dea5c0 | 2012-04-25 07:01:07 | [diff] [blame^] | 25 | |
26 | DefaultPrefStore::~DefaultPrefStore() {} |