summaryrefslogtreecommitdiffstats
path: root/components/webdata
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-05 20:13:23 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-05 20:13:23 +0000
commit0b2f513b8e24956466fcb04fad1d912ff8cfe65b (patch)
treeaa76fe9bd680e19131a54aadd6c43732f62ec785 /components/webdata
parent33959607f032668f0da22f9332e7f95c5f037121 (diff)
downloadchromium_src-0b2f513b8e24956466fcb04fad1d912ff8cfe65b.zip
chromium_src-0b2f513b8e24956466fcb04fad1d912ff8cfe65b.tar.gz
chromium_src-0b2f513b8e24956466fcb04fad1d912ff8cfe65b.tar.bz2
Remove application locale cache in autofill code (AutofillCountry::ApplicationLOcale).
This is in preparation for removing content::GetContentClient calls outside of content. BUG=227047 Review URL: https://codereview.chromium.org/13488009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192622 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/webdata')
-rw-r--r--components/webdata/autofill/autofill_table.cc8
-rw-r--r--components/webdata/autofill/autofill_table.h2
-rw-r--r--components/webdata/autofill/autofill_table_unittest.cc2
-rw-r--r--components/webdata/autofill/web_data_service_unittest.cc2
-rw-r--r--components/webdata/autofill/web_database_migration_unittest.cc2
5 files changed, 8 insertions, 8 deletions
diff --git a/components/webdata/autofill/autofill_table.cc b/components/webdata/autofill/autofill_table.cc
index 8218d14..318458d 100644
--- a/components/webdata/autofill/autofill_table.cc
+++ b/components/webdata/autofill/autofill_table.cc
@@ -333,8 +333,8 @@ WebDatabaseTable::TypeKey GetKey() {
// The maximum length allowed for form data.
const size_t AutofillTable::kMaxDataLength = 1024;
-AutofillTable::AutofillTable()
- : app_locale_(AutofillCountry::ApplicationLocale()) {
+AutofillTable::AutofillTable(const std::string& app_locale)
+ : app_locale_(app_locale) {
}
AutofillTable::~AutofillTable() {
@@ -1991,10 +1991,10 @@ bool AutofillTable::MigrateToVersion37MergeAndCullOlderProfiles() {
scoped_ptr<AutofillProfile> p(profile);
- if (PersonalDataManager::IsValidLearnableProfile(*p)) {
+ if (PersonalDataManager::IsValidLearnableProfile(*p, app_locale_)) {
std::vector<AutofillProfile> merged_profiles;
bool merged = PersonalDataManager::MergeProfile(
- *p, accumulated_profiles_p, &merged_profiles);
+ *p, accumulated_profiles_p, app_locale_, &merged_profiles);
std::swap(accumulated_profiles, merged_profiles);
diff --git a/components/webdata/autofill/autofill_table.h b/components/webdata/autofill/autofill_table.h
index 22991d4..c0c24bb 100644
--- a/components/webdata/autofill/autofill_table.h
+++ b/components/webdata/autofill/autofill_table.h
@@ -115,7 +115,7 @@ class Time;
//
class AutofillTable : public WebDatabaseTable {
public:
- AutofillTable();
+ explicit AutofillTable(const std::string& app_locale);
virtual ~AutofillTable();
// Retrieves the AutofillTable* owned by |database|.
diff --git a/components/webdata/autofill/autofill_table_unittest.cc b/components/webdata/autofill/autofill_table_unittest.cc
index 6ce6d57..34be794 100644
--- a/components/webdata/autofill/autofill_table_unittest.cc
+++ b/components/webdata/autofill/autofill_table_unittest.cc
@@ -98,7 +98,7 @@ class AutofillTableTest : public testing::Test {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
file_ = temp_dir_.path().AppendASCII("TestWebDatabase");
- table_.reset(new AutofillTable);
+ table_.reset(new AutofillTable("en-US"));
db_.reset(new WebDatabase);
db_->AddTable(table_.get());
ASSERT_EQ(sql::INIT_OK, db_->Init(file_));
diff --git a/components/webdata/autofill/web_data_service_unittest.cc b/components/webdata/autofill/web_data_service_unittest.cc
index b7124ac..0f74612 100644
--- a/components/webdata/autofill/web_data_service_unittest.cc
+++ b/components/webdata/autofill/web_data_service_unittest.cc
@@ -71,7 +71,7 @@ class WebDataServiceTest : public testing::Test {
base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB");
wdbs_ = new WebDatabaseService(path);
- wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable()));
+ wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US")));
wdbs_->LoadDatabase(WebDatabaseService::InitCallback());
wds_ = new AutofillWebDataService(
diff --git a/components/webdata/autofill/web_database_migration_unittest.cc b/components/webdata/autofill/web_database_migration_unittest.cc
index 8a715a5..8c3bb1c 100644
--- a/components/webdata/autofill/web_database_migration_unittest.cc
+++ b/components/webdata/autofill/web_database_migration_unittest.cc
@@ -175,7 +175,7 @@ class WebDatabaseMigrationTest : public testing::Test {
// for now, as it needs to know about all the different table
// types. Once all webdata datatypes have been componentized, this
// could move to components_unittests.
- AutofillTable autofill_table;
+ AutofillTable autofill_table("en-US");
KeywordTable keyword_table;
LoginsTable logins_table;
TokenServiceTable token_service_table;