OLD | NEW |
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/service/service_process_prefs.h" | 5 #include "chrome/service/service_process_prefs.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 | 8 |
9 ServiceProcessPrefs::ServiceProcessPrefs( | 9 ServiceProcessPrefs::ServiceProcessPrefs( |
10 const FilePath& pref_filename, | 10 const FilePath& pref_filename, |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 void ServiceProcessPrefs::SetBoolean(const std::string& key, bool value) { | 43 void ServiceProcessPrefs::SetBoolean(const std::string& key, bool value) { |
44 prefs_->SetValue(key, Value::CreateBooleanValue(value)); | 44 prefs_->SetValue(key, Value::CreateBooleanValue(value)); |
45 } | 45 } |
46 | 46 |
47 void ServiceProcessPrefs::GetDictionary(const std::string& key, | 47 void ServiceProcessPrefs::GetDictionary(const std::string& key, |
48 const DictionaryValue** result) { | 48 const DictionaryValue** result) { |
49 const Value* value; | 49 const Value* value; |
50 if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK || | 50 if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK || |
51 !value->IsType(Value::TYPE_DICTIONARY)) { | 51 !value->IsDictionary()) { |
52 return; | 52 return; |
53 } | 53 } |
54 | 54 |
55 *result = static_cast<const DictionaryValue*>(value); | 55 *result = static_cast<const DictionaryValue*>(value); |
56 } | 56 } |
57 | 57 |
58 void ServiceProcessPrefs::RemovePref(const std::string& key) { | 58 void ServiceProcessPrefs::RemovePref(const std::string& key) { |
59 prefs_->RemoveValue(key); | 59 prefs_->RemoveValue(key); |
60 } | 60 } |
OLD | NEW |