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

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 962673004: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments in autocomplete_history_manager.cc. Created 5 years, 5 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/content/renderer/autofill_agent.h" 5 #include "components/autofill/content/renderer/autofill_agent.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 WebInputElement* node) { 733 WebInputElement* node) {
734 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); 734 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true);
735 node->setEditingValue(value.substr(0, node->maxLength())); 735 node->setEditingValue(value.substr(0, node->maxLength()));
736 } 736 }
737 737
738 void AutofillAgent::PreviewFieldWithValue(const base::string16& value, 738 void AutofillAgent::PreviewFieldWithValue(const base::string16& value,
739 WebInputElement* node) { 739 WebInputElement* node) {
740 was_query_node_autofilled_ = element_.isAutofilled(); 740 was_query_node_autofilled_ = element_.isAutofilled();
741 node->setSuggestedValue(value.substr(0, node->maxLength())); 741 node->setSuggestedValue(value.substr(0, node->maxLength()));
742 node->setAutofilled(true); 742 node->setAutofilled(true);
743 node->setSelectionRange(node->value().length(), 743 PreviewSuggestion(value, node);
744 node->suggestedValue().length());
745 } 744 }
746 745
747 void AutofillAgent::ProcessForms() { 746 void AutofillAgent::ProcessForms() {
748 // Record timestamp of when the forms are first seen. This is used to 747 // Record timestamp of when the forms are first seen. This is used to
749 // measure the overhead of the Autofill feature. 748 // measure the overhead of the Autofill feature.
750 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); 749 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now();
751 750
752 WebLocalFrame* frame = render_frame()->GetWebFrame(); 751 WebLocalFrame* frame = render_frame()->GetWebFrame();
753 std::vector<FormData> forms = form_cache_.ExtractNewForms(); 752 std::vector<FormData> forms = form_cache_.ExtractNewForms();
754 753
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 804
806 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 805 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
807 // No-op. Don't delete |this|. 806 // No-op. Don't delete |this|.
808 } 807 }
809 808
810 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { 809 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
811 agent_->FocusChangeComplete(); 810 agent_->FocusChangeComplete();
812 } 811 }
813 812
814 } // namespace autofill 813 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698