diff options
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r-- | chrome/browser/prefs/testing_pref_store.cc | 26 | ||||
-rw-r--r-- | chrome/browser/prefs/testing_pref_store.h | 14 |
2 files changed, 31 insertions, 9 deletions
diff --git a/chrome/browser/prefs/testing_pref_store.cc b/chrome/browser/prefs/testing_pref_store.cc index 39c20f2..89394bd 100644 --- a/chrome/browser/prefs/testing_pref_store.cc +++ b/chrome/browser/prefs/testing_pref_store.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,9 @@ TestingPrefStore::TestingPrefStore() : read_only_(true), prefs_written_(false), - init_complete_(false) { } + init_complete_(false) {} + +TestingPrefStore::~TestingPrefStore() {} PrefStore::ReadResult TestingPrefStore::GetValue(const std::string& key, Value** value) const { @@ -24,6 +26,10 @@ void TestingPrefStore::RemoveObserver(PrefStore::Observer* observer) { observers_.RemoveObserver(observer); } +bool TestingPrefStore::IsInitializationComplete() const { + return init_complete_; +} + void TestingPrefStore::SetValue(const std::string& key, Value* value) { if (prefs_.SetValue(key, value)) NotifyPrefValueChanged(key); @@ -38,6 +44,10 @@ void TestingPrefStore::RemoveValue(const std::string& key) { NotifyPrefValueChanged(key); } +bool TestingPrefStore::ReadOnly() const { + return read_only_; +} + PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() { prefs_.Clear(); return PersistentPrefStore::PREF_READ_ERROR_NONE; @@ -98,3 +108,15 @@ bool TestingPrefStore::GetBoolean(const std::string& key, bool* value) const { return stored_value->GetAsBoolean(value); } + +void TestingPrefStore::set_read_only(bool read_only) { + read_only_ = read_only; +} + +void TestingPrefStore::set_prefs_written(bool status) { + prefs_written_ = status; +} + +bool TestingPrefStore::get_prefs_written() { + return prefs_written_; +} diff --git a/chrome/browser/prefs/testing_pref_store.h b/chrome/browser/prefs/testing_pref_store.h index 555ee69..5502ad2 100644 --- a/chrome/browser/prefs/testing_pref_store.h +++ b/chrome/browser/prefs/testing_pref_store.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,19 +20,19 @@ class DictionaryValue; class TestingPrefStore : public PersistentPrefStore { public: TestingPrefStore(); - virtual ~TestingPrefStore() {} + virtual ~TestingPrefStore(); // Overriden from PrefStore. virtual ReadResult GetValue(const std::string& key, Value** result) const; virtual void AddObserver(PrefStore::Observer* observer); virtual void RemoveObserver(PrefStore::Observer* observer); - virtual bool IsInitializationComplete() const { return init_complete_; } + virtual bool IsInitializationComplete() const; // PersistentPrefStore overrides: virtual void SetValue(const std::string& key, Value* value); virtual void SetValueSilently(const std::string& key, Value* value); virtual void RemoveValue(const std::string& key); - virtual bool ReadOnly() const { return read_only_; } + virtual bool ReadOnly() const; virtual PersistentPrefStore::PrefReadError ReadPrefs(); virtual bool WritePrefs(); virtual void ScheduleWritePrefs() {} @@ -55,9 +55,9 @@ class TestingPrefStore : public PersistentPrefStore { // Getter and Setter methods for setting and getting the state of the // |TestingPrefStore|. - virtual void set_read_only(bool read_only) { read_only_ = read_only; } - virtual void set_prefs_written(bool status) { prefs_written_ = status; } - virtual bool get_prefs_written() { return prefs_written_; } + virtual void set_read_only(bool read_only); + virtual void set_prefs_written(bool status); + virtual bool get_prefs_written(); private: // Stores the preference values. |