blob: 06168bce879805ba0fcbb2d6eaf759b64510affc [file] [log] [blame]
[email protected]9a8c4022011-01-25 14:25:331// 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]bab1c13f2011-08-12 20:59:027using base::Value;
8
[email protected]9a8c4022011-01-25 14:25:339DefaultPrefStore::DefaultPrefStore() {}
10
11DefaultPrefStore::~DefaultPrefStore() {}
12
13void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
14 CHECK(GetValue(key, NULL) == READ_NO_VALUE);
15 SetValue(key, value);
16}
17
[email protected]7a5f5932011-12-29 10:35:4918void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
19 CHECK(GetValue(key, NULL) == READ_OK);
20 RemoveValue(key);
21}
22
[email protected]bab1c13f2011-08-12 20:59:0223base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
[email protected]68bf41a2011-03-25 16:38:3124 const Value* value;
[email protected]bab1c13f2011-08-12 20:59:0225 return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL;
[email protected]9a8c4022011-01-25 14:25:3326}