summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/options/autofill_options_handler.cc
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-01 17:27:37 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-01 17:27:37 +0000
commit012b8f33d4c442ee841d609fafee37942f97dfdf (patch)
tree732de07c55e262b0df339de623930c5157b0ed56 /chrome/browser/ui/webui/options/autofill_options_handler.cc
parenta1a66360e12c537e8a163d2d34954d0e24100543 (diff)
downloadchromium_src-012b8f33d4c442ee841d609fafee37942f97dfdf.zip
chromium_src-012b8f33d4c442ee841d609fafee37942f97dfdf.tar.gz
chromium_src-012b8f33d4c442ee841d609fafee37942f97dfdf.tar.bz2
[Autofill] Add a notion of "verified" profiles.
Each Autofill profile and credit card is now associated with an origin. For automatically aggregated profiles, this is the domain they were aggregated from. For manually entered profiles, this is something more like "chrome://settings/autofill". Profiles with unknown origin have an empty string as their origin. A profile is considered to be "verified" if its origin is a non-empty, non-web-URL string. When a user makes an edit to a profile via chrome://settings/autofill, it becomes verified. (If the user simply views the profile, but does not make any changes, it is not upgraded to verified status.) Once a profile is in the verified state, nothing can knock it back into the unverified state. The only way to add variants to a verified profile is to enter them directly via Chrome's settings UI. Any automatically aggregated profiles that would be merged to a verified profile are simply discarded, since we don't want to mess up profiles that users have directly edited, nor do we want to pollute the global namespace of profiles. We could instead keep track of verified/unverified state per variant, but this adds a relatively large amount of code complexity for relatively little gain. This CL is just the first part of the work. Follow-up CLs will: (1) Extend the WebDB to be origin-aware. (2) Extend Sync to be origin-aware (requires a Sync backend change). (3a) Write the origin to the WebDB. (3b) Ensure that web origins are cleared from the WebDB when users select to erase history. (4) Ensure that all clients of the PersonalDataManager are setting the origin correctly for any profiles they add. BUG=170401, 231029 TEST=TBD Review URL: https://chromiumcodereview.appspot.com/14427004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/options/autofill_options_handler.cc')
-rw-r--r--chrome/browser/ui/webui/options/autofill_options_handler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc
index 8177546..55bf141 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -38,6 +38,8 @@ using autofill::PersonalDataManager;
namespace {
+const char kSettingsOrigin[] = "Chrome settings";
+
// Sets data related to the country <select>.
void SetCountryData(DictionaryValue* localized_strings) {
std::string default_country_code = AutofillCountry::CountryCodeForLocale(
@@ -510,7 +512,7 @@ void AutofillOptionsHandler::SetAddress(const ListValue* args) {
return;
}
- AutofillProfile profile(guid);
+ AutofillProfile profile(guid, kSettingsOrigin);
std::string country_code;
string16 value;
@@ -564,7 +566,7 @@ void AutofillOptionsHandler::SetCreditCard(const ListValue* args) {
return;
}
- CreditCard credit_card(guid);
+ CreditCard credit_card(guid, kSettingsOrigin);
string16 value;
if (args->GetString(1, &value))