[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 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 | ||||
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 | |||||
11 | DefaultPrefStore::~DefaultPrefStore() {} | ||||
12 | |||||
13 | void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) { | ||||
14 | CHECK(GetValue(key, NULL) == READ_NO_VALUE); | ||||
15 | SetValue(key, value); | ||||
16 | } | ||||
17 | |||||
[email protected] | 7a5f593 | 2011-12-29 10:35:49 | [diff] [blame^] | 18 | void DefaultPrefStore::RemoveDefaultValue(const std::string& key) { |
19 | CHECK(GetValue(key, NULL) == READ_OK); | ||||
20 | RemoveValue(key); | ||||
21 | } | ||||
22 | |||||
[email protected] | bab1c13f | 2011-08-12 20:59:02 | [diff] [blame] | 23 | base::Value::Type DefaultPrefStore::GetType(const std::string& key) const { |
[email protected] | 68bf41a | 2011-03-25 16:38:31 | [diff] [blame] | 24 | const Value* value; |
[email protected] | bab1c13f | 2011-08-12 20:59:02 | [diff] [blame] | 25 | return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL; |
[email protected] | 9a8c402 | 2011-01-25 14:25:33 | [diff] [blame] | 26 | } |