blob: 3e084d78f4c7d4d3a87c63819ed69332bec045a8 [file] [log] [blame]
[email protected]2dea5c02012-04-25 07:01:071// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]9a8c4022011-01-25 14:25:332// 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
[email protected]9a8c4022011-01-25 14:25:3311void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
12 CHECK(GetValue(key, NULL) == READ_NO_VALUE);
13 SetValue(key, value);
14}
15
[email protected]7a5f5932011-12-29 10:35:4916void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
17 CHECK(GetValue(key, NULL) == READ_OK);
18 RemoveValue(key);
19}
20
[email protected]bab1c13f2011-08-12 20:59:0221base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
[email protected]68bf41a2011-03-25 16:38:3122 const Value* value;
[email protected]bab1c13f2011-08-12 20:59:0223 return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL;
[email protected]9a8c4022011-01-25 14:25:3324}
[email protected]2dea5c02012-04-25 07:01:0725
26DefaultPrefStore::~DefaultPrefStore() {}