Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: chrome/browser/prefs/default_pref_store.cc

Issue 8879016: Add more per-tab preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CHECK -> DCHECK Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/prefs/default_pref_store.h" 5 #include "chrome/browser/prefs/default_pref_store.h"
6 6
7 using base::Value; 7 using base::Value;
8 8
9 DefaultPrefStore::DefaultPrefStore() {} 9 DefaultPrefStore::DefaultPrefStore() {}
10 10
11 DefaultPrefStore::~DefaultPrefStore() {} 11 DefaultPrefStore::~DefaultPrefStore() {}
12 12
13 void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) { 13 void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
14 CHECK(GetValue(key, NULL) == READ_NO_VALUE); 14 CHECK(GetValue(key, NULL) == READ_NO_VALUE);
15 SetValue(key, value); 15 SetValue(key, value);
16 } 16 }
17 17
18 void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
19 CHECK(GetValue(key, NULL) == READ_OK);
20 RemoveValue(key);
21 }
22
18 base::Value::Type DefaultPrefStore::GetType(const std::string& key) const { 23 base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
19 const Value* value; 24 const Value* value;
20 return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL; 25 return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL;
21 } 26 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/default_pref_store.h ('k') | chrome/browser/prefs/per_tab_user_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698