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

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

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 #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 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // work if the delegate has a pointer to the AutofillManager, but 233 // work if the delegate has a pointer to the AutofillManager, but
234 // future directions may not need such a pointer. 234 // future directions may not need such a pointer.
235 external_delegate_ = delegate; 235 external_delegate_ = delegate;
236 autocomplete_history_manager_->SetExternalDelegate(delegate); 236 autocomplete_history_manager_->SetExternalDelegate(delegate);
237 } 237 }
238 238
239 void AutofillManager::ShowAutofillSettings() { 239 void AutofillManager::ShowAutofillSettings() {
240 manager_delegate_->ShowAutofillSettings(); 240 manager_delegate_->ShowAutofillSettings();
241 } 241 }
242 242
243 #if defined(OS_MACOSX)
244 bool AutofillManager::ShouldShowAccessAddressBookSuggestion(
245 const FormData& data,
246 const FormFieldData& field_data) {
247 if (!personal_data_)
248 return false;
249 return personal_data_->ShouldShowAccessAddressBookSuggestion(
250 data, field_data, form_structures_);
Ilya Sherman 2014/05/22 15:13:59 You should probably call GetCachedFormAndField(),
erikchen 2014/05/22 20:40:59 ah, good point. done.
251 }
252
253 bool AutofillManager::AccessAddressBook() {
254 if (!personal_data_)
255 return false;
256 return personal_data_->AccessAddressBook();
257 }
258 #endif // defined(OS_MACOSX)
259
243 bool AutofillManager::OnFormSubmitted(const FormData& form, 260 bool AutofillManager::OnFormSubmitted(const FormData& form,
244 const TimeTicks& timestamp) { 261 const TimeTicks& timestamp) {
245 if (!IsValidFormData(form)) 262 if (!IsValidFormData(form))
246 return false; 263 return false;
247 264
248 // Let Autocomplete know as well. 265 // Let Autocomplete know as well.
249 autocomplete_history_manager_->OnFormSubmitted(form); 266 autocomplete_history_manager_->OnFormSubmitted(form);
250 267
251 // Grab a copy of the form data. 268 // Grab a copy of the form data.
252 scoped_ptr<FormStructure> submitted_form(new FormStructure(form)); 269 scoped_ptr<FormStructure> submitted_form(new FormStructure(form));
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 return false; 1155 return false;
1139 1156
1140 // Disregard forms that we wouldn't ever autofill in the first place. 1157 // Disregard forms that we wouldn't ever autofill in the first place.
1141 if (!form.ShouldBeParsed(true)) 1158 if (!form.ShouldBeParsed(true))
1142 return false; 1159 return false;
1143 1160
1144 return true; 1161 return true;
1145 } 1162 }
1146 1163
1147 } // namespace autofill 1164 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698