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

Side by Side Diff: components/autofill/core/browser/personal_data_manager.h

Issue 286243002: Mac: Autofill should not immediately request access to address book. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address second round of comments from isherman. Created 6 years, 7 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // be associated with the user. More concretely, it checks if there are any 193 // be associated with the user. More concretely, it checks if there are any
194 // addresses with this country or if the user's system timezone is in the 194 // addresses with this country or if the user's system timezone is in the
195 // given country. 195 // given country.
196 virtual bool IsCountryOfInterest(const std::string& country_code) const; 196 virtual bool IsCountryOfInterest(const std::string& country_code) const;
197 197
198 // Returns our best guess for the country a user is likely to use when 198 // Returns our best guess for the country a user is likely to use when
199 // inputting a new address. The value is calculated once and cached, so it 199 // inputting a new address. The value is calculated once and cached, so it
200 // will only update when Chrome is restarted. 200 // will only update when Chrome is restarted.
201 virtual const std::string& GetDefaultCountryCodeForNewAddress() const; 201 virtual const std::string& GetDefaultCountryCodeForNewAddress() const;
202 202
203 #if defined(OS_MACOSX)
204 // If Chrome has not prompted for access to the user's address book, the
205 // method prompts the user for permission and blocks the process. Otherwise,
206 // this method has no effect. The return value reflects whether the user was
207 // prompted with a modal dialog.
208 bool AccessAddressBook();
209
210 // If Chrome has not prompted for access to the user's address book, the
211 // method prompts the user for permission and blocks the process. Otherwise,
212 // this method has no effect. The return value reflects whether the user was
213 // prompted with a modal dialog.
Ilya Sherman 2014/05/22 15:13:59 nit: Please update this comment.
erikchen 2014/05/22 20:40:59 Done.
214 bool ShouldShowAccessAddressBookSuggestion(
215 const FormData& data,
216 const FormFieldData& field_data,
217 const ScopedVector<FormStructure>& form_structures);
Ilya Sherman 2014/05/22 15:13:59 Note: It's generally better to pass the underlying
erikchen 2014/05/22 20:40:59 I've used your earlier suggestion of just passing
218 #endif // defined(OS_MACOSX)
219
203 protected: 220 protected:
204 // Only PersonalDataManagerFactory and certain tests can create instances of 221 // Only PersonalDataManagerFactory and certain tests can create instances of
205 // PersonalDataManager. 222 // PersonalDataManager.
206 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast); 223 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast);
207 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup); 224 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup);
208 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, 225 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
209 AggregateExistingAuxiliaryProfile); 226 AggregateExistingAuxiliaryProfile);
210 friend class autofill::AutofillInteractiveTest; 227 friend class autofill::AutofillInteractiveTest;
211 friend class autofill::AutofillTest; 228 friend class autofill::AutofillTest;
212 friend class autofill::PersonalDataManagerFactory; 229 friend class autofill::PersonalDataManagerFactory;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 361
345 // An observer to listen for changes to prefs::kAutofillEnabled. 362 // An observer to listen for changes to prefs::kAutofillEnabled.
346 scoped_ptr<BooleanPrefMember> enabled_pref_; 363 scoped_ptr<BooleanPrefMember> enabled_pref_;
347 364
348 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); 365 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager);
349 }; 366 };
350 367
351 } // namespace autofill 368 } // namespace autofill
352 369
353 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 370 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698