summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 10:48:50 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 10:48:50 +0000
commit39d9f62c3dd20996550db303739668936e9cad9c (patch)
tree202358544ed0ad0f6a71135e48ee04503665aa2d /chrome/browser/prefs
parenta7313dfd4f5d9b3ea2fd44afb046b9d9a9fd0eb3 (diff)
downloadchromium_src-39d9f62c3dd20996550db303739668936e9cad9c.zip
chromium_src-39d9f62c3dd20996550db303739668936e9cad9c.tar.gz
chromium_src-39d9f62c3dd20996550db303739668936e9cad9c.tar.bz2
Reduce the include footprint of pref_service.h
This removes the pref_value_store.h header from the pref_service.h include list and cleans up any users that were getting the MessageLoop and BrowserThread definitions indirectly through pref_service.h BUG=64893 TEST=compiles and passes tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67997 Review URL: http://codereview.chromium.org/5461001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r--chrome/browser/prefs/pref_change_registrar.cc1
-rw-r--r--chrome/browser/prefs/pref_change_registrar_unittest.cc1
-rw-r--r--chrome/browser/prefs/pref_service.cc6
-rw-r--r--chrome/browser/prefs/pref_service.h5
-rw-r--r--chrome/browser/prefs/pref_value_store_unittest.cc6
-rw-r--r--chrome/browser/prefs/scoped_pref_update.cc1
6 files changed, 15 insertions, 5 deletions
diff --git a/chrome/browser/prefs/pref_change_registrar.cc b/chrome/browser/prefs/pref_change_registrar.cc
index 05372b1..5655a8e 100644
--- a/chrome/browser/prefs/pref_change_registrar.cc
+++ b/chrome/browser/prefs/pref_change_registrar.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/prefs/pref_change_registrar.h"
+#include "base/logging.h"
#include "chrome/browser/prefs/pref_service.h"
PrefChangeRegistrar::PrefChangeRegistrar() : service_(NULL) {}
diff --git a/chrome/browser/prefs/pref_change_registrar_unittest.cc b/chrome/browser/prefs/pref_change_registrar_unittest.cc
index 8096ee6..31c513b 100644
--- a/chrome/browser/prefs/pref_change_registrar_unittest.cc
+++ b/chrome/browser/prefs/pref_change_registrar_unittest.cc
@@ -6,6 +6,7 @@
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_source.h"
+#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/testing_pref_service.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc
index a59cb33..fda53a7 100644
--- a/chrome/browser/prefs/pref_service.cc
+++ b/chrome/browser/prefs/pref_service.cc
@@ -21,6 +21,8 @@
#include "base/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/prefs/pref_notifier.h"
+#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/notification_service.h"
#include "grit/chromium_strings.h"
@@ -353,6 +355,10 @@ const ListValue* PrefService::GetList(const char* path) const {
return static_cast<const ListValue*>(value);
}
+bool PrefService::ReadOnly() const {
+ return pref_value_store_->ReadOnly();
+}
+
void PrefService::AddPrefObserver(const char* path,
NotificationObserver* obs) {
pref_notifier_->AddPrefObserver(path, obs);
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index f1128a22..632bc84 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -12,15 +12,16 @@
#include <string>
#include "base/non_thread_safe.h"
+#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/values.h"
-#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/common/pref_store.h"
class FilePath;
class NotificationObserver;
class PrefChangeObserver;
class PrefNotifier;
+class PrefValueStore;
class Profile;
namespace subtle {
@@ -218,7 +219,7 @@ class PrefService : public NonThreadSafe {
// preference is not registered.
const Preference* FindPreference(const char* pref_name) const;
- bool read_only() const { return pref_value_store_->ReadOnly(); }
+ bool ReadOnly() const;
PrefNotifier* pref_notifier() const { return pref_notifier_.get(); }
diff --git a/chrome/browser/prefs/pref_value_store_unittest.cc b/chrome/browser/prefs/pref_value_store_unittest.cc
index cbf7ccc..b67fc05 100644
--- a/chrome/browser/prefs/pref_value_store_unittest.cc
+++ b/chrome/browser/prefs/pref_value_store_unittest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/prefs/dummy_pref_store.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/common/pref_names.h"
-#include "chrome/test/testing_pref_service.h"
+#include "chrome/test/testing_pref_value_store.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -113,7 +113,7 @@ class PrefValueStoreTest : public testing::Test {
default_pref_store_->set_prefs(default_prefs_);
// Create a new pref-value-store.
- pref_value_store_ = new TestingPrefService::TestingPrefValueStore(
+ pref_value_store_ = new TestingPrefValueStore(
managed_platform_pref_store_,
device_management_pref_store_,
extension_pref_store_,
@@ -262,7 +262,7 @@ class PrefValueStoreTest : public testing::Test {
MessageLoop loop_;
- scoped_refptr<TestingPrefService::TestingPrefValueStore> pref_value_store_;
+ scoped_refptr<TestingPrefValueStore> pref_value_store_;
// |PrefStore|s are owned by the |PrefValueStore|.
DummyPrefStore* managed_platform_pref_store_;
diff --git a/chrome/browser/prefs/scoped_pref_update.cc b/chrome/browser/prefs/scoped_pref_update.cc
index bc77b28..05a607c 100644
--- a/chrome/browser/prefs/scoped_pref_update.cc
+++ b/chrome/browser/prefs/scoped_pref_update.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/prefs/scoped_pref_update.h"
+#include "chrome/browser/prefs/pref_notifier.h"
#include "chrome/browser/prefs/pref_service.h"
ScopedPrefUpdate::ScopedPrefUpdate(PrefService* service, const char* path)