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

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

Issue 184103016: Autofill: Refactoring to support fetching password after a username is selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually fix compile failure. Created 6 years, 8 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 | Annotate | Revision Log
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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 const std::vector<FormStructure*>& AutofillManager::GetFormStructures() { 644 const std::vector<FormStructure*>& AutofillManager::GetFormStructures() {
645 return form_structures_.get(); 645 return form_structures_.get();
646 } 646 }
647 647
648 void AutofillManager::SetTestDelegate( 648 void AutofillManager::SetTestDelegate(
649 autofill::AutofillManagerTestDelegate* delegate) { 649 autofill::AutofillManagerTestDelegate* delegate) {
650 test_delegate_ = delegate; 650 test_delegate_ = delegate;
651 } 651 }
652 652
653 void AutofillManager::OnAddPasswordFormMapping(
654 const FormFieldData& username_field,
655 const PasswordFormFillData& fill_data) {
656 if (!IsValidFormFieldData(username_field) ||
657 !IsValidPasswordFormFillData(fill_data))
658 return;
659
660 external_delegate_->AddPasswordFormMapping(username_field, fill_data);
661 }
662
663 void AutofillManager::OnShowPasswordSuggestions(
664 const FormFieldData& field,
665 const gfx::RectF& bounds,
666 const std::vector<base::string16>& suggestions,
667 const std::vector<base::string16>& realms) {
668 if (!IsValidString16Vector(suggestions) ||
669 !IsValidString16Vector(realms) ||
670 suggestions.size() != realms.size())
671 return;
672
673 external_delegate_->OnShowPasswordSuggestions(suggestions,
674 realms,
675 field,
676 bounds);
677 }
678
679 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, 653 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values,
680 const std::vector<base::string16>& labels) { 654 const std::vector<base::string16>& labels) {
681 if (!IsValidString16Vector(values) || 655 if (!IsValidString16Vector(values) ||
682 !IsValidString16Vector(labels) || 656 !IsValidString16Vector(labels) ||
683 values.size() != labels.size()) 657 values.size() != labels.size())
684 return; 658 return;
685 659
686 external_delegate_->SetCurrentDataListValues(values, labels); 660 external_delegate_->SetCurrentDataListValues(values, labels);
687 } 661 }
688 662
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 return false; 1141 return false;
1168 1142
1169 // Disregard forms that we wouldn't ever autofill in the first place. 1143 // Disregard forms that we wouldn't ever autofill in the first place.
1170 if (!form.ShouldBeParsed(true)) 1144 if (!form.ShouldBeParsed(true))
1171 return false; 1145 return false;
1172 1146
1173 return true; 1147 return true;
1174 } 1148 }
1175 1149
1176 } // namespace autofill 1150 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/password_autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698