Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 1582353006: CountryNames: Separate data creation from usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@571610_exposeCountryNamesToTesting
Patch Set: Just rebased Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 22 matching lines...) Expand all
33 #include "components/autofill/core/browser/autocomplete_history_manager.h" 33 #include "components/autofill/core/browser/autocomplete_history_manager.h"
34 #include "components/autofill/core/browser/autofill_client.h" 34 #include "components/autofill/core/browser/autofill_client.h"
35 #include "components/autofill/core/browser/autofill_data_model.h" 35 #include "components/autofill/core/browser/autofill_data_model.h"
36 #include "components/autofill/core/browser/autofill_experiments.h" 36 #include "components/autofill/core/browser/autofill_experiments.h"
37 #include "components/autofill/core/browser/autofill_external_delegate.h" 37 #include "components/autofill/core/browser/autofill_external_delegate.h"
38 #include "components/autofill/core/browser/autofill_field.h" 38 #include "components/autofill/core/browser/autofill_field.h"
39 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" 39 #include "components/autofill/core/browser/autofill_manager_test_delegate.h"
40 #include "components/autofill/core/browser/autofill_metrics.h" 40 #include "components/autofill/core/browser/autofill_metrics.h"
41 #include "components/autofill/core/browser/autofill_profile.h" 41 #include "components/autofill/core/browser/autofill_profile.h"
42 #include "components/autofill/core/browser/autofill_type.h" 42 #include "components/autofill/core/browser/autofill_type.h"
43 #include "components/autofill/core/browser/country_names.h"
43 #include "components/autofill/core/browser/credit_card.h" 44 #include "components/autofill/core/browser/credit_card.h"
44 #include "components/autofill/core/browser/field_types.h" 45 #include "components/autofill/core/browser/field_types.h"
45 #include "components/autofill/core/browser/form_structure.h" 46 #include "components/autofill/core/browser/form_structure.h"
46 #include "components/autofill/core/browser/personal_data_manager.h" 47 #include "components/autofill/core/browser/personal_data_manager.h"
47 #include "components/autofill/core/browser/phone_number.h" 48 #include "components/autofill/core/browser/phone_number.h"
48 #include "components/autofill/core/browser/phone_number_i18n.h" 49 #include "components/autofill/core/browser/phone_number_i18n.h"
49 #include "components/autofill/core/browser/popup_item_ids.h" 50 #include "components/autofill/core/browser/popup_item_ids.h"
50 #include "components/autofill/core/common/autofill_constants.h" 51 #include "components/autofill/core/common/autofill_constants.h"
51 #include "components/autofill/core/common/autofill_data_validation.h" 52 #include "components/autofill/core/common/autofill_data_validation.h"
52 #include "components/autofill/core/common/autofill_pref_names.h" 53 #include "components/autofill/core/common/autofill_pref_names.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 user_did_type_(false), 123 user_did_type_(false),
123 user_did_autofill_(false), 124 user_did_autofill_(false),
124 user_did_edit_autofilled_field_(false), 125 user_did_edit_autofilled_field_(false),
125 user_did_accept_upload_prompt_(false), 126 user_did_accept_upload_prompt_(false),
126 external_delegate_(NULL), 127 external_delegate_(NULL),
127 test_delegate_(NULL), 128 test_delegate_(NULL),
128 weak_ptr_factory_(this) { 129 weak_ptr_factory_(this) {
129 if (enable_download_manager == ENABLE_AUTOFILL_DOWNLOAD_MANAGER) { 130 if (enable_download_manager == ENABLE_AUTOFILL_DOWNLOAD_MANAGER) {
130 download_manager_.reset(new AutofillDownloadManager(driver, this)); 131 download_manager_.reset(new AutofillDownloadManager(driver, this));
131 } 132 }
133 CountryNames::SetLocaleString(app_locale_);
132 } 134 }
133 135
134 AutofillManager::~AutofillManager() {} 136 AutofillManager::~AutofillManager() {}
135 137
136 // static 138 // static
137 void AutofillManager::RegisterProfilePrefs( 139 void AutofillManager::RegisterProfilePrefs(
138 user_prefs::PrefRegistrySyncable* registry) { 140 user_prefs::PrefRegistrySyncable* registry) {
139 registry->RegisterBooleanPref( 141 registry->RegisterBooleanPref(
140 prefs::kAutofillEnabled, 142 prefs::kAutofillEnabled,
141 true, 143 true,
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 did_show_suggestions_(false), 1130 did_show_suggestions_(false),
1129 user_did_type_(false), 1131 user_did_type_(false),
1130 user_did_autofill_(false), 1132 user_did_autofill_(false),
1131 user_did_edit_autofilled_field_(false), 1133 user_did_edit_autofilled_field_(false),
1132 unmasking_query_id_(-1), 1134 unmasking_query_id_(-1),
1133 external_delegate_(NULL), 1135 external_delegate_(NULL),
1134 test_delegate_(NULL), 1136 test_delegate_(NULL),
1135 weak_ptr_factory_(this) { 1137 weak_ptr_factory_(this) {
1136 DCHECK(driver_); 1138 DCHECK(driver_);
1137 DCHECK(client_); 1139 DCHECK(client_);
1140 CountryNames::SetLocaleString(app_locale_);
1138 } 1141 }
1139 1142
1140 bool AutofillManager::RefreshDataModels() { 1143 bool AutofillManager::RefreshDataModels() {
1141 if (!IsAutofillEnabled()) 1144 if (!IsAutofillEnabled())
1142 return false; 1145 return false;
1143 1146
1144 // No autofill data to return if the profiles are empty. 1147 // No autofill data to return if the profiles are empty.
1145 const std::vector<AutofillProfile*>& profiles = 1148 const std::vector<AutofillProfile*>& profiles =
1146 personal_data_->GetProfiles(); 1149 personal_data_->GetProfiles();
1147 const std::vector<CreditCard*>& credit_cards = 1150 const std::vector<CreditCard*>& credit_cards =
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 if (i > 0) 1710 if (i > 0)
1708 fputs("Next oldest form:\n", file); 1711 fputs("Next oldest form:\n", file);
1709 } 1712 }
1710 fputs("\n", file); 1713 fputs("\n", file);
1711 1714
1712 fclose(file); 1715 fclose(file);
1713 } 1716 }
1714 #endif // ENABLE_FORM_DEBUG_DUMP 1717 #endif // ENABLE_FORM_DEBUG_DUMP
1715 1718
1716 } // namespace autofill 1719 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698