summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-06-07 18:05:37 +0100
committerKristian Monsen <kristianm@google.com>2011-06-14 20:31:33 -0700
commitc4becdd46e31d261b930e4b5a539cbc1d45c23a6 (patch)
tree8aef2c4a045a5ee2830205a21d7eb51e6075d51f /chrome
parent408e341a50962061e47be3d6a8f50ee299fae1ed (diff)
downloadexternal_chromium-c4becdd46e31d261b930e4b5a539cbc1d45c23a6.zip
external_chromium-c4becdd46e31d261b930e4b5a539cbc1d45c23a6.tar.gz
external_chromium-c4becdd46e31d261b930e4b5a539cbc1d45c23a6.tar.bz2
Reduce pref usage by autofill
Try to avoid using prefs in Android. We are not using the entire system, and we have significant local edits. Will try to remove the local edits in prefs and keep them in autofill. We should not loose any functionality as there is no way for the user to change the prefs. Change-Id: I5ee38228fa552127a0399390a617e1a324e75d86
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill/autofill_download.cc11
-rw-r--r--chrome/browser/autofill/personal_data_manager.cc4
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index 66d6459..091c0ec 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -32,6 +32,12 @@ struct AutoFillDownloadManager::FormRequestData {
AutoFillRequestType request_type;
};
+#ifdef ANDROID
+// Taken from autofill_manager.cc
+const double kAutoFillPositiveUploadRateDefaultValue = 0.01;
+const double kAutoFillNegativeUploadRateDefaultValue = 0.01;
+#endif
+
AutoFillDownloadManager::AutoFillDownloadManager(Profile* profile)
: profile_(profile),
observer_(NULL),
@@ -42,6 +48,10 @@ AutoFillDownloadManager::AutoFillDownloadManager(Profile* profile)
fetcher_id_for_unittest_(0),
is_testing_(false) {
// |profile_| could be NULL in some unit-tests.
+#ifdef ANDROID
+ positive_upload_rate_ = kAutoFillPositiveUploadRateDefaultValue;
+ negative_upload_rate_ = kAutoFillNegativeUploadRateDefaultValue;
+#else
if (profile_) {
PrefService* preferences = profile_->GetPrefs();
positive_upload_rate_ =
@@ -49,6 +59,7 @@ AutoFillDownloadManager::AutoFillDownloadManager(Profile* profile)
negative_upload_rate_ =
preferences->GetReal(prefs::kAutoFillNegativeUploadRate);
}
+#endif
}
AutoFillDownloadManager::~AutoFillDownloadManager() {
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 085ee53..cb70267 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -608,8 +608,12 @@ bool PersonalDataManager::IsDataLoaded() const {
const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() {
// |profile_| is NULL in AutoFillManagerTest.
+#ifdef ANDROID
+ bool auxiliary_profiles_enabled = false;
+#else
bool auxiliary_profiles_enabled = profile_ ? profile_->GetPrefs()->GetBoolean(
prefs::kAutoFillAuxiliaryProfilesEnabled) : false;
+#endif
if (!auxiliary_profiles_enabled)
return web_profiles();