Chromium Code Reviews| Index: components/autofill/content/renderer/autofill_agent.cc |
| diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc |
| index a0908e15a3356355328311dc95c46df2ab973222..00baf457fb6cf3289152d87931689157c6c5d2e9 100644 |
| --- a/components/autofill/content/renderer/autofill_agent.cc |
| +++ b/components/autofill/content/renderer/autofill_agent.cc |
| @@ -42,7 +42,6 @@ |
| #include "content/public/common/url_constants.h" |
| #include "content/public/renderer/render_frame.h" |
| #include "content/public/renderer/render_view.h" |
| -#include "mojo/common/common_type_converters.h" |
| #include "net/cert/cert_status_flags.h" |
| #include "services/shell/public/cpp/interface_provider.h" |
| #include "services/shell/public/cpp/interface_registry.h" |
| @@ -514,7 +513,7 @@ void AutofillAgent::OnPing() { |
| } |
| void AutofillAgent::FieldTypePredictionsAvailable( |
| - mojo::Array<FormDataPredictions> forms) { |
| + const std::vector<FormDataPredictions>& forms) { |
| for (const auto& form : forms) { |
| form_cache_.ShowPredictions(form); |
| } |
| @@ -541,35 +540,35 @@ void AutofillAgent::ClearPreviewedForm() { |
| } |
| } |
| -void AutofillAgent::FillFieldWithValue(const mojo::String& value) { |
| +void AutofillAgent::FillFieldWithValue(const std::string& value) { |
| WebInputElement* input_element = toWebInputElement(&element_); |
| if (input_element) { |
| - DoFillFieldWithValue(value.To<base::string16>(), input_element); |
| + DoFillFieldWithValue(base::UTF8ToUTF16(value), input_element); |
| input_element->setAutofilled(true); |
| } |
| } |
| -void AutofillAgent::PreviewFieldWithValue(const mojo::String& value) { |
| +void AutofillAgent::PreviewFieldWithValue(const std::string& value) { |
| WebInputElement* input_element = toWebInputElement(&element_); |
| if (input_element) |
| - DoPreviewFieldWithValue(value.To<base::string16>(), input_element); |
| + DoPreviewFieldWithValue(base::UTF8ToUTF16(value), input_element); |
| } |
| -void AutofillAgent::AcceptDataListSuggestion(const mojo::String& value) { |
| - DoAcceptDataListSuggestion(value.To<base::string16>()); |
| +void AutofillAgent::AcceptDataListSuggestion(const std::string& value) { |
| + DoAcceptDataListSuggestion(base::UTF8ToUTF16(value)); |
| } |
| -void AutofillAgent::FillPasswordSuggestion(const mojo::String& username, |
| - const mojo::String& password) { |
| +void AutofillAgent::FillPasswordSuggestion(const std::string& username, |
| + const std::string& password) { |
| bool handled = password_autofill_agent_->FillSuggestion( |
| - element_, username.To<base::string16>(), password.To<base::string16>()); |
| + element_, base::UTF8ToUTF16(username), base::UTF8ToUTF16(password)); |
| DCHECK(handled); |
| } |
| -void AutofillAgent::PreviewPasswordSuggestion(const mojo::String& username, |
| - const mojo::String& password) { |
| +void AutofillAgent::PreviewPasswordSuggestion(const std::string& username, |
| + const std::string& password) { |
| bool handled = password_autofill_agent_->PreviewSuggestion( |
| - element_, username.To<base::string16>(), password.To<base::string16>()); |
| + element_, base::UTF8ToUTF16(username), base::UTF8ToUTF16(password)); |
| DCHECK(handled); |
| } |
| @@ -735,9 +734,13 @@ void AutofillAgent::QueryAutofillSuggestions( |
| is_popup_possibly_visible_ = true; |
| - GetAutofillDriver()->SetDataList( |
| - mojo::Array<mojo::String>::From(data_list_values), |
| - mojo::Array<mojo::String>::From(data_list_labels)); |
| + std::vector<std::string> values; |
|
yzshen1
2016/07/26 16:45:36
Please reserve space.
leonhsl(Using Gerrit)
2016/07/27 02:50:26
Acknowledged.
leonhsl(Using Gerrit)
2016/07/27 09:25:32
Done. Use base::string16 typemap now, removed thes
|
| + for (auto& i : data_list_values) |
| + values.emplace_back(base::UTF16ToUTF8(i)); |
| + std::vector<std::string> labels; |
| + for (auto& i : data_list_labels) |
| + labels.emplace_back(base::UTF16ToUTF8(i)); |
| + GetAutofillDriver()->SetDataList(values, labels); |
| GetAutofillDriver()->QueryFormFieldAutofill( |
| autofill_query_id_, form, field, |
| render_frame()->GetRenderView()->ElementBoundsInWindow(element_)); |
| @@ -767,7 +770,7 @@ void AutofillAgent::ProcessForms() { |
| // Always communicate to browser process for topmost frame. |
| if (!forms.empty() || !frame->parent()) { |
| - GetAutofillDriver()->FormsSeen(std::move(forms), forms_seen_timestamp); |
| + GetAutofillDriver()->FormsSeen(forms, forms_seen_timestamp); |
| } |
| } |