OLD | NEW |
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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 WebInputElement* node) { | 737 WebInputElement* node) { |
738 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); | 738 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); |
739 node->setEditingValue(value.substr(0, node->maxLength())); | 739 node->setEditingValue(value.substr(0, node->maxLength())); |
740 } | 740 } |
741 | 741 |
742 void AutofillAgent::PreviewFieldWithValue(const base::string16& value, | 742 void AutofillAgent::PreviewFieldWithValue(const base::string16& value, |
743 WebInputElement* node) { | 743 WebInputElement* node) { |
744 was_query_node_autofilled_ = element_.isAutofilled(); | 744 was_query_node_autofilled_ = element_.isAutofilled(); |
745 node->setSuggestedValue(value.substr(0, node->maxLength())); | 745 node->setSuggestedValue(value.substr(0, node->maxLength())); |
746 node->setAutofilled(true); | 746 node->setAutofilled(true); |
747 node->setSelectionRange(node->value().length(), | 747 PreviewSuggestion(node->suggestedValue(), node->value(), node); |
748 node->suggestedValue().length()); | |
749 } | 748 } |
750 | 749 |
751 void AutofillAgent::ProcessForms() { | 750 void AutofillAgent::ProcessForms() { |
752 // Record timestamp of when the forms are first seen. This is used to | 751 // Record timestamp of when the forms are first seen. This is used to |
753 // measure the overhead of the Autofill feature. | 752 // measure the overhead of the Autofill feature. |
754 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); | 753 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); |
755 | 754 |
756 WebLocalFrame* frame = render_frame()->GetWebFrame(); | 755 WebLocalFrame* frame = render_frame()->GetWebFrame(); |
757 std::vector<FormData> forms = form_cache_.ExtractNewForms(); | 756 std::vector<FormData> forms = form_cache_.ExtractNewForms(); |
758 | 757 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 808 |
810 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 809 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
811 // No-op. Don't delete |this|. | 810 // No-op. Don't delete |this|. |
812 } | 811 } |
813 | 812 |
814 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 813 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
815 agent_->FocusChangeComplete(); | 814 agent_->FocusChangeComplete(); |
816 } | 815 } |
817 | 816 |
818 } // namespace autofill | 817 } // namespace autofill |
OLD | NEW |