summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-06-16 01:40:33 +0100
committerKristian Monsen <kristianm@google.com>2011-06-16 01:44:19 +0100
commit1671993f5bbda2f18558145bee503edbebcdc5ca (patch)
treecbc4dd8e76d98ec8866e45fc3726f390fe7c2844 /chrome
parent6e1a1d3242a4de2a633c62ba45948dd2d0620990 (diff)
downloadexternal_chromium-1671993f5bbda2f18558145bee503edbebcdc5ca.zip
external_chromium-1671993f5bbda2f18558145bee503edbebcdc5ca.tar.gz
external_chromium-1671993f5bbda2f18558145bee503edbebcdc5ca.tar.bz2
Removing local changes from chrome/browser/prefs
After this we are matching upstream Change-Id: Ifae1c3935157d49f95c271bf6a5e00b8ce434fe3
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/prefs/pref_service.cc44
-rw-r--r--chrome/browser/prefs/pref_service.h8
-rw-r--r--chrome/browser/prefs/pref_value_store.cc5
-rw-r--r--chrome/browser/prefs/pref_value_store.h2
4 files changed, 1 insertions, 58 deletions
diff --git a/chrome/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc
index 5534699..1df38ee 100644
--- a/chrome/browser/prefs/pref_service.cc
+++ b/chrome/browser/prefs/pref_service.cc
@@ -7,9 +7,7 @@
#include <algorithm>
#include <string>
-#ifndef ANDROID
#include "base/command_line.h"
-#endif
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
@@ -23,22 +21,16 @@
#include "build/build_config.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/extensions/extension_pref_store.h"
-#ifndef ANDROID
#include "chrome/browser/policy/configuration_policy_pref_store.h"
-#endif
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/default_pref_store.h"
#include "chrome/browser/prefs/overlay_persistent_pref_store.h"
#include "chrome/browser/prefs/pref_notifier_impl.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/common/json_pref_store.h"
-#ifndef ANDROID
-// Notifications do not compile on Android and are the cause
-// of most of the ANDROID guards in this file.
#include "chrome/common/notification_service.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
-#endif
#include "ui/base/l10n/l10n_util.h"
namespace {
@@ -47,7 +39,6 @@ namespace {
// the string value in the locale dll. Because we control the values in a
// locale dll, this should always return a Value of the appropriate type.
Value* CreateLocaleDefaultValue(Value::ValueType type, int message_id) {
-#ifndef ANDROID
std::string resource_string = l10n_util::GetStringUTF8(message_id);
DCHECK(!resource_string.empty());
switch (type) {
@@ -80,7 +71,6 @@ Value* CreateLocaleDefaultValue(Value::ValueType type, int message_id) {
"list and dictionary types cannot have default locale values";
}
}
-#endif
NOTREACHED();
return Value::CreateNullValue();
}
@@ -88,11 +78,9 @@ Value* CreateLocaleDefaultValue(Value::ValueType type, int message_id) {
// Forwards a notification after a PostMessage so that we can wait for the
// MessageLoop to run.
void NotifyReadError(PrefService* pref, int message_id) {
-#ifndef ANDROID
Source<PrefService> source(pref);
NotificationService::current()->Notify(NotificationType::PROFILE_ERROR,
source, Details<int>(&message_id));
-#endif
}
} // namespace
@@ -101,11 +89,9 @@ void NotifyReadError(PrefService* pref, int message_id) {
PrefService* PrefService::CreatePrefService(const FilePath& pref_filename,
PrefStore* extension_prefs,
Profile* profile) {
-#ifndef ANDROID
using policy::ConfigurationPolicyPrefStore;
-#endif
-#if defined(OS_LINUX) && !defined(ANDROID)
+#if defined(OS_LINUX)
// We'd like to see what fraction of our users have the preferences
// stored on a network file system, as we've had no end of troubles
// with NFS/AFS.
@@ -118,9 +104,6 @@ PrefService* PrefService::CreatePrefService(const FilePath& pref_filename,
}
#endif
-#ifdef ANDROID
- return new PrefService(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-#else
ConfigurationPolicyPrefStore* managed_platform =
ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore();
ConfigurationPolicyPrefStore* managed_cloud =
@@ -140,7 +123,6 @@ PrefService* PrefService::CreatePrefService(const FilePath& pref_filename,
return new PrefService(managed_platform, managed_cloud, extension_prefs,
command_line, user, recommended_platform,
recommended_cloud, default_pref_store);
-#endif
}
PrefService* PrefService::CreateIncognitoPrefService(
@@ -158,9 +140,7 @@ PrefService::PrefService(PrefStore* managed_platform_prefs,
DefaultPrefStore* default_store)
: user_pref_store_(user_prefs),
default_store_(default_store) {
-#ifndef ANDROID
pref_notifier_.reset(new PrefNotifierImpl(this));
-#endif
pref_value_store_.reset(
new PrefValueStore(managed_platform_prefs,
managed_cloud_prefs,
@@ -170,11 +150,7 @@ PrefService::PrefService(PrefStore* managed_platform_prefs,
recommended_platform_prefs,
recommended_cloud_prefs,
default_store,
-#ifdef ANDROID
- NULL));
-#else
pref_notifier_.get()));
-#endif
InitFromStorage();
}
@@ -183,9 +159,7 @@ PrefService::PrefService(const PrefService& original,
: user_pref_store_(
new OverlayPersistentPrefStore(original.user_pref_store_.get())),
default_store_(original.default_store_.get()){
-#ifndef ANDROID
pref_notifier_.reset(new PrefNotifierImpl(this));
-#endif
pref_value_store_.reset(original.pref_value_store_->CloneAndSpecialize(
NULL, // managed_platform_prefs
NULL, // managed_cloud_prefs
@@ -195,11 +169,7 @@ PrefService::PrefService(const PrefService& original,
NULL, // recommended_platform_prefs
NULL, // recommended_cloud_prefs
default_store_.get(),
-#ifdef ANDROID
- NULL));
-#else
pref_notifier_.get()));
-#endif
InitFromStorage();
}
@@ -215,7 +185,6 @@ PrefService::~PrefService() {
}
void PrefService::InitFromStorage() {
-#ifndef ANDROID
const PersistentPrefStore::PrefReadError error =
user_pref_store_->ReadPrefs();
if (error == PersistentPrefStore::PREF_READ_ERROR_NONE)
@@ -236,7 +205,6 @@ void PrefService::InitFromStorage() {
NewRunnableFunction(&NotifyReadError, this, message_id));
}
UMA_HISTOGRAM_ENUMERATION("PrefService.ReadError", error, 20);
-#endif
}
bool PrefService::ReloadPersistentPrefs() {
@@ -439,11 +407,7 @@ bool PrefService::ReadOnly() const {
}
PrefNotifier* PrefService::pref_notifier() const {
-#ifdef ANDROID
- return NULL;
-#else
return pref_notifier_.get();
-#endif
}
bool PrefService::IsManagedPreference(const char* pref_name) const {
@@ -483,7 +447,6 @@ const ListValue* PrefService::GetList(const char* path) const {
return static_cast<const ListValue*>(value);
}
-#ifndef ANDROID
void PrefService::AddPrefObserver(const char* path,
NotificationObserver* obs) {
pref_notifier_->AddPrefObserver(path, obs);
@@ -493,7 +456,6 @@ void PrefService::RemovePrefObserver(const char* path,
NotificationObserver* obs) {
pref_notifier_->RemovePrefObserver(path, obs);
}
-#endif
void PrefService::RegisterPreference(const char* path, Value* default_value) {
DCHECK(CalledOnValidThread());
@@ -522,9 +484,7 @@ void PrefService::ClearPref(const char* path) {
NOTREACHED() << "Trying to clear an unregistered pref: " << path;
return;
}
-#ifndef ANDROID
user_pref_store_->RemoveValue(path);
-#endif
}
void PrefService::Set(const char* path, const Value& value) {
@@ -677,9 +637,7 @@ void PrefService::SetUserPrefValue(const char* path, Value* new_value) {
return;
}
-#ifndef ANDROID
user_pref_store_->SetValue(path, new_value);
-#endif
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index d844739..3ec774c 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -229,10 +229,6 @@ class PrefService : public base::NonThreadSafe {
bool ReadOnly() const;
-#ifndef ANDROID
- PrefNotifier* pref_notifier() const { return pref_notifier_.get(); }
-#endif
-
// TODO(mnissler): This should not be public. Change client code to call a
// preference setter or use ScopedPrefUpdate.
PrefNotifier* pref_notifier() const;
@@ -250,12 +246,10 @@ class PrefService : public base::NonThreadSafe {
PrefStore* recommended_cloud_prefs,
DefaultPrefStore* default_store);
-#ifndef ANDROID
// The PrefNotifier handles registering and notifying preference observers.
// It is created and owned by this PrefService. Subclasses may access it for
// unit testing.
scoped_ptr<PrefNotifierImpl> pref_notifier_;
-#endif
private:
class PreferencePathComparator {
@@ -282,14 +276,12 @@ class PrefService : public base::NonThreadSafe {
PrefService(const PrefService& original,
PrefStore* incognito_extension_prefs);
-#ifndef ANDROID
// If the pref at the given path changes, we call the observer's Observe
// method with PREF_CHANGED. Note that observers should not call these methods
// directly but rather use a PrefChangeRegistrar to make sure the observer
// gets cleaned up properly.
virtual void AddPrefObserver(const char* path, NotificationObserver* obs);
virtual void RemovePrefObserver(const char* path, NotificationObserver* obs);
-#endif
// Registers a new preference at |path|. The |default_value| must not be
// NULL as it determines the preference value's type.
diff --git a/chrome/browser/prefs/pref_value_store.cc b/chrome/browser/prefs/pref_value_store.cc
index 7ebd532..80d3714 100644
--- a/chrome/browser/prefs/pref_value_store.cc
+++ b/chrome/browser/prefs/pref_value_store.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/prefs/pref_value_store.h"
-#include "base/logging.h"
#include "chrome/browser/prefs/pref_notifier.h"
PrefValueStore::PrefStoreKeeper::PrefStoreKeeper()
@@ -126,14 +125,12 @@ void PrefValueStore::NotifyPrefChanged(
const char* path,
PrefValueStore::PrefStoreType new_store) {
DCHECK(new_store != INVALID_STORE);
-#ifndef ANDROID
// If the pref is controlled by a higher-priority store, its effective value
// cannot have changed.
PrefStoreType controller = ControllingPrefStoreForPref(path);
if (controller == INVALID_STORE || controller >= new_store)
pref_notifier_->OnPreferenceChanged(path);
-#endif
}
bool PrefValueStore::PrefValueInManagedStore(const char* name) const {
@@ -251,7 +248,5 @@ void PrefValueStore::CheckInitializationCompleted() {
if (store && !store->IsInitializationComplete())
return;
}
-#ifndef ANDROID
pref_notifier_->OnInitializationCompleted();
-#endif
}
diff --git a/chrome/browser/prefs/pref_value_store.h b/chrome/browser/prefs/pref_value_store.h
index 0592989..7406654 100644
--- a/chrome/browser/prefs/pref_value_store.h
+++ b/chrome/browser/prefs/pref_value_store.h
@@ -14,9 +14,7 @@
#include "base/gtest_prod_util.h"
#include "base/ref_counted.h"
#include "base/values.h"
-#ifndef ANDROID
#include "chrome/browser/browser_thread.h"
-#endif
#include "chrome/common/pref_store.h"
class FilePath;