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

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: Incorporated Vaclav's review comments. 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
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/content/renderer/form_autofill_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 WebInputElement* node) { 732 WebInputElement* node) {
733 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); 733 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true);
734 node->setEditingValue(value.substr(0, node->maxLength())); 734 node->setEditingValue(value.substr(0, node->maxLength()));
735 } 735 }
736 736
737 void AutofillAgent::PreviewFieldWithValue(const base::string16& value, 737 void AutofillAgent::PreviewFieldWithValue(const base::string16& value,
738 WebInputElement* node) { 738 WebInputElement* node) {
739 was_query_node_autofilled_ = element_.isAutofilled(); 739 was_query_node_autofilled_ = element_.isAutofilled();
740 node->setSuggestedValue(value.substr(0, node->maxLength())); 740 node->setSuggestedValue(value.substr(0, node->maxLength()));
741 node->setAutofilled(true); 741 node->setAutofilled(true);
742 node->setSelectionRange(node->value().length(), 742 PreviewSuggestion(node->suggestedValue(), node->value(), node);
743 node->suggestedValue().length());
744 } 743 }
745 744
746 void AutofillAgent::ProcessForms() { 745 void AutofillAgent::ProcessForms() {
747 // Record timestamp of when the forms are first seen. This is used to 746 // Record timestamp of when the forms are first seen. This is used to
748 // measure the overhead of the Autofill feature. 747 // measure the overhead of the Autofill feature.
749 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); 748 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now();
750 749
751 WebLocalFrame* frame = render_frame()->GetWebFrame(); 750 WebLocalFrame* frame = render_frame()->GetWebFrame();
752 std::vector<FormData> forms = form_cache_.ExtractNewForms(); 751 std::vector<FormData> forms = form_cache_.ExtractNewForms();
753 752
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 803
805 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 804 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
806 // No-op. Don't delete |this|. 805 // No-op. Don't delete |this|.
807 } 806 }
808 807
809 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { 808 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
810 agent_->FocusChangeComplete(); 809 agent_->FocusChangeComplete();
811 } 810 }
812 811
813 } // namespace autofill 812 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/content/renderer/form_autofill_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698