Commit 5e58cfda authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Removing "using namespace" in a global scope in autofill

"using namespace" in a global scope breaks jumbo builds (and
are not allowed in the code style guide). This patch replaces them
with explicit namespaces.

Bug: 771153
Change-Id: Ic45f740d8081b9f4e531b30ac05f6578a404de11
Reviewed-on: https://chromium-review.googlesource.com/697371
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506367}
parent ef62bce2
...@@ -10,40 +10,39 @@ ...@@ -10,40 +10,39 @@
#include "url/mojo/origin_struct_traits.h" #include "url/mojo/origin_struct_traits.h"
#include "url/mojo/url_gurl_struct_traits.h" #include "url/mojo/url_gurl_struct_traits.h"
using namespace autofill;
namespace mojo { namespace mojo {
// static // static
mojom::CheckStatus autofill::mojom::CheckStatus
EnumTraits<mojom::CheckStatus, FormFieldData::CheckStatus>::ToMojom( EnumTraits<autofill::mojom::CheckStatus, autofill::FormFieldData::CheckStatus>::
FormFieldData::CheckStatus input) { ToMojom(autofill::FormFieldData::CheckStatus input) {
switch (input) { switch (input) {
case FormFieldData::CheckStatus::NOT_CHECKABLE: case autofill::FormFieldData::CheckStatus::NOT_CHECKABLE:
return mojom::CheckStatus::NOT_CHECKABLE; return autofill::mojom::CheckStatus::NOT_CHECKABLE;
case FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED: case autofill::FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED:
return mojom::CheckStatus::CHECKABLE_BUT_UNCHECKED; return autofill::mojom::CheckStatus::CHECKABLE_BUT_UNCHECKED;
case FormFieldData::CheckStatus::CHECKED: case autofill::FormFieldData::CheckStatus::CHECKED:
return mojom::CheckStatus::CHECKED; return autofill::mojom::CheckStatus::CHECKED;
} }
NOTREACHED(); NOTREACHED();
return mojom::CheckStatus::NOT_CHECKABLE; return autofill::mojom::CheckStatus::NOT_CHECKABLE;
} }
// static // static
bool EnumTraits<mojom::CheckStatus, FormFieldData::CheckStatus>::FromMojom( bool EnumTraits<autofill::mojom::CheckStatus,
mojom::CheckStatus input, autofill::FormFieldData::CheckStatus>::
FormFieldData::CheckStatus* output) { FromMojom(autofill::mojom::CheckStatus input,
autofill::FormFieldData::CheckStatus* output) {
switch (input) { switch (input) {
case mojom::CheckStatus::NOT_CHECKABLE: case autofill::mojom::CheckStatus::NOT_CHECKABLE:
*output = FormFieldData::CheckStatus::NOT_CHECKABLE; *output = autofill::FormFieldData::CheckStatus::NOT_CHECKABLE;
return true; return true;
case mojom::CheckStatus::CHECKABLE_BUT_UNCHECKED: case autofill::mojom::CheckStatus::CHECKABLE_BUT_UNCHECKED:
*output = FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED; *output = autofill::FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED;
return true; return true;
case mojom::CheckStatus::CHECKED: case autofill::mojom::CheckStatus::CHECKED:
*output = FormFieldData::CheckStatus::CHECKED; *output = autofill::FormFieldData::CheckStatus::CHECKED;
return true; return true;
} }
...@@ -52,30 +51,33 @@ bool EnumTraits<mojom::CheckStatus, FormFieldData::CheckStatus>::FromMojom( ...@@ -52,30 +51,33 @@ bool EnumTraits<mojom::CheckStatus, FormFieldData::CheckStatus>::FromMojom(
} }
// static // static
mojom::RoleAttribute autofill::mojom::RoleAttribute
EnumTraits<mojom::RoleAttribute, FormFieldData::RoleAttribute>::ToMojom( EnumTraits<autofill::mojom::RoleAttribute,
FormFieldData::RoleAttribute input) { autofill::FormFieldData::RoleAttribute>::
ToMojom(autofill::FormFieldData::RoleAttribute input) {
switch (input) { switch (input) {
case FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION: case autofill::FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION:
return mojom::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION; return autofill::mojom::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION;
case FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_OTHER: case autofill::FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_OTHER:
return mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER; return autofill::mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER;
} }
NOTREACHED(); NOTREACHED();
return mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER; return autofill::mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER;
} }
// static // static
bool EnumTraits<mojom::RoleAttribute, FormFieldData::RoleAttribute>::FromMojom( bool EnumTraits<autofill::mojom::RoleAttribute,
mojom::RoleAttribute input, autofill::FormFieldData::RoleAttribute>::
FormFieldData::RoleAttribute* output) { FromMojom(autofill::mojom::RoleAttribute input,
autofill::FormFieldData::RoleAttribute* output) {
switch (input) { switch (input) {
case mojom::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION: case autofill::mojom::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION:
*output = FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION; *output =
autofill::FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_PRESENTATION;
return true; return true;
case mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER: case autofill::mojom::RoleAttribute::ROLE_ATTRIBUTE_OTHER:
*output = FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_OTHER; *output = autofill::FormFieldData::RoleAttribute::ROLE_ATTRIBUTE_OTHER;
return true; return true;
} }
...@@ -84,41 +86,44 @@ bool EnumTraits<mojom::RoleAttribute, FormFieldData::RoleAttribute>::FromMojom( ...@@ -84,41 +86,44 @@ bool EnumTraits<mojom::RoleAttribute, FormFieldData::RoleAttribute>::FromMojom(
} }
// static // static
mojom::GenerationUploadStatus EnumTraits<mojom::GenerationUploadStatus, autofill::mojom::GenerationUploadStatus
PasswordForm::GenerationUploadStatus>:: EnumTraits<autofill::mojom::GenerationUploadStatus,
ToMojom(PasswordForm::GenerationUploadStatus input) { autofill::PasswordForm::GenerationUploadStatus>::
ToMojom(autofill::PasswordForm::GenerationUploadStatus input) {
switch (input) { switch (input) {
case PasswordForm::GenerationUploadStatus::NO_SIGNAL_SENT: case autofill::PasswordForm::GenerationUploadStatus::NO_SIGNAL_SENT:
return mojom::GenerationUploadStatus::NO_SIGNAL_SENT; return autofill::mojom::GenerationUploadStatus::NO_SIGNAL_SENT;
case PasswordForm::GenerationUploadStatus::POSITIVE_SIGNAL_SENT: case autofill::PasswordForm::GenerationUploadStatus::POSITIVE_SIGNAL_SENT:
return mojom::GenerationUploadStatus::POSITIVE_SIGNAL_SENT; return autofill::mojom::GenerationUploadStatus::POSITIVE_SIGNAL_SENT;
case PasswordForm::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT: case autofill::PasswordForm::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT:
return mojom::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT; return autofill::mojom::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT;
case PasswordForm::GenerationUploadStatus::UNKNOWN_STATUS: case autofill::PasswordForm::GenerationUploadStatus::UNKNOWN_STATUS:
return mojom::GenerationUploadStatus::UNKNOWN_STATUS; return autofill::mojom::GenerationUploadStatus::UNKNOWN_STATUS;
} }
NOTREACHED(); NOTREACHED();
return mojom::GenerationUploadStatus::UNKNOWN_STATUS; return autofill::mojom::GenerationUploadStatus::UNKNOWN_STATUS;
} }
// static // static
bool EnumTraits<mojom::GenerationUploadStatus, bool EnumTraits<autofill::mojom::GenerationUploadStatus,
PasswordForm::GenerationUploadStatus>:: autofill::PasswordForm::GenerationUploadStatus>::
FromMojom(mojom::GenerationUploadStatus input, FromMojom(autofill::mojom::GenerationUploadStatus input,
PasswordForm::GenerationUploadStatus* output) { autofill::PasswordForm::GenerationUploadStatus* output) {
switch (input) { switch (input) {
case mojom::GenerationUploadStatus::NO_SIGNAL_SENT: case autofill::mojom::GenerationUploadStatus::NO_SIGNAL_SENT:
*output = PasswordForm::GenerationUploadStatus::NO_SIGNAL_SENT; *output = autofill::PasswordForm::GenerationUploadStatus::NO_SIGNAL_SENT;
return true; return true;
case mojom::GenerationUploadStatus::POSITIVE_SIGNAL_SENT: case autofill::mojom::GenerationUploadStatus::POSITIVE_SIGNAL_SENT:
*output = PasswordForm::GenerationUploadStatus::POSITIVE_SIGNAL_SENT; *output =
autofill::PasswordForm::GenerationUploadStatus::POSITIVE_SIGNAL_SENT;
return true; return true;
case mojom::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT: case autofill::mojom::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT:
*output = PasswordForm::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT; *output =
autofill::PasswordForm::GenerationUploadStatus::NEGATIVE_SIGNAL_SENT;
return true; return true;
case mojom::GenerationUploadStatus::UNKNOWN_STATUS: case autofill::mojom::GenerationUploadStatus::UNKNOWN_STATUS:
*output = PasswordForm::GenerationUploadStatus::UNKNOWN_STATUS; *output = autofill::PasswordForm::GenerationUploadStatus::UNKNOWN_STATUS;
return true; return true;
} }
...@@ -127,30 +132,32 @@ bool EnumTraits<mojom::GenerationUploadStatus, ...@@ -127,30 +132,32 @@ bool EnumTraits<mojom::GenerationUploadStatus,
} }
// static // static
mojom::PasswordFormLayout autofill::mojom::PasswordFormLayout EnumTraits<
EnumTraits<mojom::PasswordFormLayout, PasswordForm::Layout>::ToMojom( autofill::mojom::PasswordFormLayout,
PasswordForm::Layout input) { autofill::PasswordForm::Layout>::ToMojom(autofill::PasswordForm::Layout
input) {
switch (input) { switch (input) {
case PasswordForm::Layout::LAYOUT_OTHER: case autofill::PasswordForm::Layout::LAYOUT_OTHER:
return mojom::PasswordFormLayout::LAYOUT_OTHER; return autofill::mojom::PasswordFormLayout::LAYOUT_OTHER;
case PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP: case autofill::PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP:
return mojom::PasswordFormLayout::LAYOUT_LOGIN_AND_SIGNUP; return autofill::mojom::PasswordFormLayout::LAYOUT_LOGIN_AND_SIGNUP;
} }
NOTREACHED(); NOTREACHED();
return mojom::PasswordFormLayout::LAYOUT_OTHER; return autofill::mojom::PasswordFormLayout::LAYOUT_OTHER;
} }
// static // static
bool EnumTraits<mojom::PasswordFormLayout, PasswordForm::Layout>::FromMojom( bool EnumTraits<autofill::mojom::PasswordFormLayout,
mojom::PasswordFormLayout input, autofill::PasswordForm::Layout>::
PasswordForm::Layout* output) { FromMojom(autofill::mojom::PasswordFormLayout input,
autofill::PasswordForm::Layout* output) {
switch (input) { switch (input) {
case mojom::PasswordFormLayout::LAYOUT_OTHER: case autofill::mojom::PasswordFormLayout::LAYOUT_OTHER:
*output = PasswordForm::Layout::LAYOUT_OTHER; *output = autofill::PasswordForm::Layout::LAYOUT_OTHER;
return true; return true;
case mojom::PasswordFormLayout::LAYOUT_LOGIN_AND_SIGNUP: case autofill::mojom::PasswordFormLayout::LAYOUT_LOGIN_AND_SIGNUP:
*output = PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; *output = autofill::PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP;
return true; return true;
} }
...@@ -159,35 +166,36 @@ bool EnumTraits<mojom::PasswordFormLayout, PasswordForm::Layout>::FromMojom( ...@@ -159,35 +166,36 @@ bool EnumTraits<mojom::PasswordFormLayout, PasswordForm::Layout>::FromMojom(
} }
// static // static
mojom::PasswordFormType autofill::mojom::PasswordFormType EnumTraits<
EnumTraits<mojom::PasswordFormType, PasswordForm::Type>::ToMojom( autofill::mojom::PasswordFormType,
PasswordForm::Type input) { autofill::PasswordForm::Type>::ToMojom(autofill::PasswordForm::Type input) {
switch (input) { switch (input) {
case PasswordForm::Type::TYPE_MANUAL: case autofill::PasswordForm::Type::TYPE_MANUAL:
return mojom::PasswordFormType::TYPE_MANUAL; return autofill::mojom::PasswordFormType::TYPE_MANUAL;
case PasswordForm::Type::TYPE_GENERATED: case autofill::PasswordForm::Type::TYPE_GENERATED:
return mojom::PasswordFormType::TYPE_GENERATED; return autofill::mojom::PasswordFormType::TYPE_GENERATED;
case PasswordForm::Type::TYPE_API: case autofill::PasswordForm::Type::TYPE_API:
return mojom::PasswordFormType::TYPE_API; return autofill::mojom::PasswordFormType::TYPE_API;
} }
NOTREACHED(); NOTREACHED();
return mojom::PasswordFormType::TYPE_MANUAL; return autofill::mojom::PasswordFormType::TYPE_MANUAL;
} }
// static // static
bool EnumTraits<mojom::PasswordFormType, PasswordForm::Type>::FromMojom( bool EnumTraits<autofill::mojom::PasswordFormType,
mojom::PasswordFormType input, autofill::PasswordForm::Type>::
PasswordForm::Type* output) { FromMojom(autofill::mojom::PasswordFormType input,
autofill::PasswordForm::Type* output) {
switch (input) { switch (input) {
case mojom::PasswordFormType::TYPE_MANUAL: case autofill::mojom::PasswordFormType::TYPE_MANUAL:
*output = PasswordForm::Type::TYPE_MANUAL; *output = autofill::PasswordForm::Type::TYPE_MANUAL;
return true; return true;
case mojom::PasswordFormType::TYPE_GENERATED: case autofill::mojom::PasswordFormType::TYPE_GENERATED:
*output = PasswordForm::Type::TYPE_GENERATED; *output = autofill::PasswordForm::Type::TYPE_GENERATED;
return true; return true;
case mojom::PasswordFormType::TYPE_API: case autofill::mojom::PasswordFormType::TYPE_API:
*output = PasswordForm::Type::TYPE_API; *output = autofill::PasswordForm::Type::TYPE_API;
return true; return true;
} }
...@@ -196,45 +204,47 @@ bool EnumTraits<mojom::PasswordFormType, PasswordForm::Type>::FromMojom( ...@@ -196,45 +204,47 @@ bool EnumTraits<mojom::PasswordFormType, PasswordForm::Type>::FromMojom(
} }
// static // static
mojom::PasswordFormScheme autofill::mojom::PasswordFormScheme EnumTraits<
EnumTraits<mojom::PasswordFormScheme, PasswordForm::Scheme>::ToMojom( autofill::mojom::PasswordFormScheme,
PasswordForm::Scheme input) { autofill::PasswordForm::Scheme>::ToMojom(autofill::PasswordForm::Scheme
input) {
switch (input) { switch (input) {
case PasswordForm::Scheme::SCHEME_HTML: case autofill::PasswordForm::Scheme::SCHEME_HTML:
return mojom::PasswordFormScheme::SCHEME_HTML; return autofill::mojom::PasswordFormScheme::SCHEME_HTML;
case PasswordForm::Scheme::SCHEME_BASIC: case autofill::PasswordForm::Scheme::SCHEME_BASIC:
return mojom::PasswordFormScheme::SCHEME_BASIC; return autofill::mojom::PasswordFormScheme::SCHEME_BASIC;
case PasswordForm::Scheme::SCHEME_DIGEST: case autofill::PasswordForm::Scheme::SCHEME_DIGEST:
return mojom::PasswordFormScheme::SCHEME_DIGEST; return autofill::mojom::PasswordFormScheme::SCHEME_DIGEST;
case PasswordForm::Scheme::SCHEME_OTHER: case autofill::PasswordForm::Scheme::SCHEME_OTHER:
return mojom::PasswordFormScheme::SCHEME_OTHER; return autofill::mojom::PasswordFormScheme::SCHEME_OTHER;
case PasswordForm::Scheme::SCHEME_USERNAME_ONLY: case autofill::PasswordForm::Scheme::SCHEME_USERNAME_ONLY:
return mojom::PasswordFormScheme::SCHEME_USERNAME_ONLY; return autofill::mojom::PasswordFormScheme::SCHEME_USERNAME_ONLY;
} }
NOTREACHED(); NOTREACHED();
return mojom::PasswordFormScheme::SCHEME_OTHER; return autofill::mojom::PasswordFormScheme::SCHEME_OTHER;
} }
// static // static
bool EnumTraits<mojom::PasswordFormScheme, PasswordForm::Scheme>::FromMojom( bool EnumTraits<autofill::mojom::PasswordFormScheme,
mojom::PasswordFormScheme input, autofill::PasswordForm::Scheme>::
PasswordForm::Scheme* output) { FromMojom(autofill::mojom::PasswordFormScheme input,
autofill::PasswordForm::Scheme* output) {
switch (input) { switch (input) {
case mojom::PasswordFormScheme::SCHEME_HTML: case autofill::mojom::PasswordFormScheme::SCHEME_HTML:
*output = PasswordForm::Scheme::SCHEME_HTML; *output = autofill::PasswordForm::Scheme::SCHEME_HTML;
return true; return true;
case mojom::PasswordFormScheme::SCHEME_BASIC: case autofill::mojom::PasswordFormScheme::SCHEME_BASIC:
*output = PasswordForm::Scheme::SCHEME_BASIC; *output = autofill::PasswordForm::Scheme::SCHEME_BASIC;
return true; return true;
case mojom::PasswordFormScheme::SCHEME_DIGEST: case autofill::mojom::PasswordFormScheme::SCHEME_DIGEST:
*output = PasswordForm::Scheme::SCHEME_DIGEST; *output = autofill::PasswordForm::Scheme::SCHEME_DIGEST;
return true; return true;
case mojom::PasswordFormScheme::SCHEME_OTHER: case autofill::mojom::PasswordFormScheme::SCHEME_OTHER:
*output = PasswordForm::Scheme::SCHEME_OTHER; *output = autofill::PasswordForm::Scheme::SCHEME_OTHER;
return true; return true;
case mojom::PasswordFormScheme::SCHEME_USERNAME_ONLY: case autofill::mojom::PasswordFormScheme::SCHEME_USERNAME_ONLY:
*output = PasswordForm::Scheme::SCHEME_USERNAME_ONLY; *output = autofill::PasswordForm::Scheme::SCHEME_USERNAME_ONLY;
return true; return true;
} }
...@@ -243,95 +253,106 @@ bool EnumTraits<mojom::PasswordFormScheme, PasswordForm::Scheme>::FromMojom( ...@@ -243,95 +253,106 @@ bool EnumTraits<mojom::PasswordFormScheme, PasswordForm::Scheme>::FromMojom(
} }
// static // static
mojom::PasswordFormSubmissionIndicatorEvent autofill::mojom::PasswordFormSubmissionIndicatorEvent
EnumTraits<mojom::PasswordFormSubmissionIndicatorEvent, EnumTraits<autofill::mojom::PasswordFormSubmissionIndicatorEvent,
PasswordForm::SubmissionIndicatorEvent>:: autofill::PasswordForm::SubmissionIndicatorEvent>::
ToMojom(PasswordForm::SubmissionIndicatorEvent input) { ToMojom(autofill::PasswordForm::SubmissionIndicatorEvent input) {
switch (input) { switch (input) {
case PasswordForm::SubmissionIndicatorEvent::NONE: case autofill::PasswordForm::SubmissionIndicatorEvent::NONE:
return mojom::PasswordFormSubmissionIndicatorEvent::NONE; return autofill::mojom::PasswordFormSubmissionIndicatorEvent::NONE;
case PasswordForm::SubmissionIndicatorEvent::HTML_FORM_SUBMISSION: case autofill::PasswordForm::SubmissionIndicatorEvent::HTML_FORM_SUBMISSION:
return mojom::PasswordFormSubmissionIndicatorEvent::HTML_FORM_SUBMISSION; return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
case PasswordForm::SubmissionIndicatorEvent::SAME_DOCUMENT_NAVIGATION: HTML_FORM_SUBMISSION;
return mojom::PasswordFormSubmissionIndicatorEvent:: case autofill::PasswordForm::SubmissionIndicatorEvent::
SAME_DOCUMENT_NAVIGATION:
return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
SAME_DOCUMENT_NAVIGATION; SAME_DOCUMENT_NAVIGATION;
case PasswordForm::SubmissionIndicatorEvent::XHR_SUCCEEDED: case autofill::PasswordForm::SubmissionIndicatorEvent::XHR_SUCCEEDED:
return mojom::PasswordFormSubmissionIndicatorEvent::XHR_SUCCEEDED; return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
case PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED: XHR_SUCCEEDED;
return mojom::PasswordFormSubmissionIndicatorEvent::FRAME_DETACHED; case autofill::PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED:
case PasswordForm::SubmissionIndicatorEvent::MANUAL_SAVE: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
return mojom::PasswordFormSubmissionIndicatorEvent::MANUAL_SAVE; FRAME_DETACHED;
case PasswordForm::SubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR: case autofill::PasswordForm::SubmissionIndicatorEvent::MANUAL_SAVE:
return mojom::PasswordFormSubmissionIndicatorEvent:: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::MANUAL_SAVE;
case autofill::PasswordForm::SubmissionIndicatorEvent::
DOM_MUTATION_AFTER_XHR:
return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
DOM_MUTATION_AFTER_XHR; DOM_MUTATION_AFTER_XHR;
case PasswordForm::SubmissionIndicatorEvent:: case autofill::PasswordForm::SubmissionIndicatorEvent::
PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD: PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD:
return mojom::PasswordFormSubmissionIndicatorEvent:: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD; PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD;
case PasswordForm::SubmissionIndicatorEvent:: case autofill::PasswordForm::SubmissionIndicatorEvent::
FILLED_FORM_ON_START_PROVISIONAL_LOAD: FILLED_FORM_ON_START_PROVISIONAL_LOAD:
return mojom::PasswordFormSubmissionIndicatorEvent:: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
FILLED_FORM_ON_START_PROVISIONAL_LOAD; FILLED_FORM_ON_START_PROVISIONAL_LOAD;
case PasswordForm::SubmissionIndicatorEvent:: case autofill::PasswordForm::SubmissionIndicatorEvent::
FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD: FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD:
return mojom::PasswordFormSubmissionIndicatorEvent:: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD; FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD;
case PasswordForm::SubmissionIndicatorEvent:: case autofill::PasswordForm::SubmissionIndicatorEvent::
SUBMISSION_INDICATOR_EVENT_COUNT: SUBMISSION_INDICATOR_EVENT_COUNT:
return mojom::PasswordFormSubmissionIndicatorEvent:: return autofill::mojom::PasswordFormSubmissionIndicatorEvent::
SUBMISSION_INDICATOR_EVENT_COUNT; SUBMISSION_INDICATOR_EVENT_COUNT;
} }
NOTREACHED(); NOTREACHED();
return mojom::PasswordFormSubmissionIndicatorEvent::NONE; return autofill::mojom::PasswordFormSubmissionIndicatorEvent::NONE;
} }
// static // static
bool EnumTraits<mojom::PasswordFormSubmissionIndicatorEvent, bool EnumTraits<autofill::mojom::PasswordFormSubmissionIndicatorEvent,
PasswordForm::SubmissionIndicatorEvent>:: autofill::PasswordForm::SubmissionIndicatorEvent>::
FromMojom(mojom::PasswordFormSubmissionIndicatorEvent input, FromMojom(autofill::mojom::PasswordFormSubmissionIndicatorEvent input,
PasswordForm::SubmissionIndicatorEvent* output) { autofill::PasswordForm::SubmissionIndicatorEvent* output) {
switch (input) { switch (input) {
case mojom::PasswordFormSubmissionIndicatorEvent::NONE: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::NONE:
*output = PasswordForm::SubmissionIndicatorEvent::NONE; *output = autofill::PasswordForm::SubmissionIndicatorEvent::NONE;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::HTML_FORM_SUBMISSION: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
*output = PasswordForm::SubmissionIndicatorEvent::HTML_FORM_SUBMISSION; HTML_FORM_SUBMISSION:
*output = autofill::PasswordForm::SubmissionIndicatorEvent::
HTML_FORM_SUBMISSION;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::SAME_DOCUMENT_NAVIGATION: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
*output = SAME_DOCUMENT_NAVIGATION:
PasswordForm::SubmissionIndicatorEvent::SAME_DOCUMENT_NAVIGATION; *output = autofill::PasswordForm::SubmissionIndicatorEvent::
SAME_DOCUMENT_NAVIGATION;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::XHR_SUCCEEDED: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::XHR_SUCCEEDED:
*output = PasswordForm::SubmissionIndicatorEvent::XHR_SUCCEEDED; *output = autofill::PasswordForm::SubmissionIndicatorEvent::XHR_SUCCEEDED;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::FRAME_DETACHED: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::FRAME_DETACHED:
*output = PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED; *output =
autofill::PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::MANUAL_SAVE: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::MANUAL_SAVE:
*output = PasswordForm::SubmissionIndicatorEvent::MANUAL_SAVE; *output = autofill::PasswordForm::SubmissionIndicatorEvent::MANUAL_SAVE;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
*output = PasswordForm::SubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR; DOM_MUTATION_AFTER_XHR:
*output = autofill::PasswordForm::SubmissionIndicatorEvent::
DOM_MUTATION_AFTER_XHR;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent:: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD: PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD:
*output = PasswordForm::SubmissionIndicatorEvent:: *output = autofill::PasswordForm::SubmissionIndicatorEvent::
PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD; PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent:: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
FILLED_FORM_ON_START_PROVISIONAL_LOAD: FILLED_FORM_ON_START_PROVISIONAL_LOAD:
*output = PasswordForm::SubmissionIndicatorEvent:: *output = autofill::PasswordForm::SubmissionIndicatorEvent::
FILLED_FORM_ON_START_PROVISIONAL_LOAD; FILLED_FORM_ON_START_PROVISIONAL_LOAD;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent:: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD: FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD:
*output = PasswordForm::SubmissionIndicatorEvent:: *output = autofill::PasswordForm::SubmissionIndicatorEvent::
FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD; FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD;
return true; return true;
case mojom::PasswordFormSubmissionIndicatorEvent:: case autofill::mojom::PasswordFormSubmissionIndicatorEvent::
SUBMISSION_INDICATOR_EVENT_COUNT: SUBMISSION_INDICATOR_EVENT_COUNT:
*output = PasswordForm::SubmissionIndicatorEvent:: *output = autofill::PasswordForm::SubmissionIndicatorEvent::
SUBMISSION_INDICATOR_EVENT_COUNT; SUBMISSION_INDICATOR_EVENT_COUNT;
return true; return true;
} }
...@@ -341,43 +362,53 @@ bool EnumTraits<mojom::PasswordFormSubmissionIndicatorEvent, ...@@ -341,43 +362,53 @@ bool EnumTraits<mojom::PasswordFormSubmissionIndicatorEvent,
} }
// static // static
mojom::PasswordFormFieldPredictionType EnumTraits< autofill::mojom::PasswordFormFieldPredictionType
mojom::PasswordFormFieldPredictionType, EnumTraits<autofill::mojom::PasswordFormFieldPredictionType,
PasswordFormFieldPredictionType>::ToMojom(PasswordFormFieldPredictionType autofill::PasswordFormFieldPredictionType>::
input) { ToMojom(autofill::PasswordFormFieldPredictionType input) {
switch (input) { switch (input) {
case PasswordFormFieldPredictionType::PREDICTION_USERNAME: case autofill::PasswordFormFieldPredictionType::PREDICTION_USERNAME:
return mojom::PasswordFormFieldPredictionType::PREDICTION_USERNAME; return autofill::mojom::PasswordFormFieldPredictionType::
case PasswordFormFieldPredictionType::PREDICTION_CURRENT_PASSWORD: PREDICTION_USERNAME;
return mojom::PasswordFormFieldPredictionType:: case autofill::PasswordFormFieldPredictionType::PREDICTION_CURRENT_PASSWORD:
return autofill::mojom::PasswordFormFieldPredictionType::
PREDICTION_CURRENT_PASSWORD; PREDICTION_CURRENT_PASSWORD;
case PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD: case autofill::PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD:
return mojom::PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD; return autofill::mojom::PasswordFormFieldPredictionType::
case PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD: PREDICTION_NEW_PASSWORD;
return mojom::PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD; case autofill::PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD:
return autofill::mojom::PasswordFormFieldPredictionType::
PREDICTION_NOT_PASSWORD;
} }
NOTREACHED(); NOTREACHED();
return mojom::PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD; return autofill::mojom::PasswordFormFieldPredictionType::
PREDICTION_NOT_PASSWORD;
} }
// static // static
bool EnumTraits<mojom::PasswordFormFieldPredictionType, bool EnumTraits<autofill::mojom::PasswordFormFieldPredictionType,
PasswordFormFieldPredictionType>:: autofill::PasswordFormFieldPredictionType>::
FromMojom(mojom::PasswordFormFieldPredictionType input, FromMojom(autofill::mojom::PasswordFormFieldPredictionType input,
PasswordFormFieldPredictionType* output) { autofill::PasswordFormFieldPredictionType* output) {
switch (input) { switch (input) {
case mojom::PasswordFormFieldPredictionType::PREDICTION_USERNAME: case autofill::mojom::PasswordFormFieldPredictionType::PREDICTION_USERNAME:
*output = PasswordFormFieldPredictionType::PREDICTION_USERNAME; *output = autofill::PasswordFormFieldPredictionType::PREDICTION_USERNAME;
return true; return true;
case mojom::PasswordFormFieldPredictionType::PREDICTION_CURRENT_PASSWORD: case autofill::mojom::PasswordFormFieldPredictionType::
*output = PasswordFormFieldPredictionType::PREDICTION_CURRENT_PASSWORD; PREDICTION_CURRENT_PASSWORD:
*output = autofill::PasswordFormFieldPredictionType::
PREDICTION_CURRENT_PASSWORD;
return true; return true;
case mojom::PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD: case autofill::mojom::PasswordFormFieldPredictionType::
*output = PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD; PREDICTION_NEW_PASSWORD:
*output =
autofill::PasswordFormFieldPredictionType::PREDICTION_NEW_PASSWORD;
return true; return true;
case mojom::PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD: case autofill::mojom::PasswordFormFieldPredictionType::
*output = PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD; PREDICTION_NOT_PASSWORD:
*output =
autofill::PasswordFormFieldPredictionType::PREDICTION_NOT_PASSWORD;
return true; return true;
} }
...@@ -386,9 +417,10 @@ bool EnumTraits<mojom::PasswordFormFieldPredictionType, ...@@ -386,9 +417,10 @@ bool EnumTraits<mojom::PasswordFormFieldPredictionType,
} }
// static // static
bool StructTraits<mojom::FormFieldDataDataView, FormFieldData>::Read( bool StructTraits<
mojom::FormFieldDataDataView data, autofill::mojom::FormFieldDataDataView,
FormFieldData* out) { autofill::FormFieldData>::Read(autofill::mojom::FormFieldDataDataView data,
autofill::FormFieldData* out) {
if (!data.ReadLabel(&out->label)) if (!data.ReadLabel(&out->label))
return false; return false;
if (!data.ReadName(&out->name)) if (!data.ReadName(&out->name))
...@@ -435,9 +467,9 @@ bool StructTraits<mojom::FormFieldDataDataView, FormFieldData>::Read( ...@@ -435,9 +467,9 @@ bool StructTraits<mojom::FormFieldDataDataView, FormFieldData>::Read(
} }
// static // static
bool StructTraits<mojom::FormDataDataView, FormData>::Read( bool StructTraits<autofill::mojom::FormDataDataView, autofill::FormData>::Read(
mojom::FormDataDataView data, autofill::mojom::FormDataDataView data,
FormData* out) { autofill::FormData* out) {
if (!data.ReadName(&out->name)) if (!data.ReadName(&out->name))
return false; return false;
if (!data.ReadOrigin(&out->origin)) if (!data.ReadOrigin(&out->origin))
...@@ -455,10 +487,10 @@ bool StructTraits<mojom::FormDataDataView, FormData>::Read( ...@@ -455,10 +487,10 @@ bool StructTraits<mojom::FormDataDataView, FormData>::Read(
} }
// static // static
bool StructTraits<mojom::FormFieldDataPredictionsDataView, bool StructTraits<autofill::mojom::FormFieldDataPredictionsDataView,
FormFieldDataPredictions>:: autofill::FormFieldDataPredictions>::
Read(mojom::FormFieldDataPredictionsDataView data, Read(autofill::mojom::FormFieldDataPredictionsDataView data,
FormFieldDataPredictions* out) { autofill::FormFieldDataPredictions* out) {
if (!data.ReadField(&out->field)) if (!data.ReadField(&out->field))
return false; return false;
if (!data.ReadSignature(&out->signature)) if (!data.ReadSignature(&out->signature))
...@@ -476,8 +508,10 @@ bool StructTraits<mojom::FormFieldDataPredictionsDataView, ...@@ -476,8 +508,10 @@ bool StructTraits<mojom::FormFieldDataPredictionsDataView,
} }
// static // static
bool StructTraits<mojom::FormDataPredictionsDataView, FormDataPredictions>:: bool StructTraits<autofill::mojom::FormDataPredictionsDataView,
Read(mojom::FormDataPredictionsDataView data, FormDataPredictions* out) { autofill::FormDataPredictions>::
Read(autofill::mojom::FormDataPredictionsDataView data,
autofill::FormDataPredictions* out) {
if (!data.ReadData(&out->data)) if (!data.ReadData(&out->data))
return false; return false;
if (!data.ReadSignature(&out->signature)) if (!data.ReadSignature(&out->signature))
...@@ -489,9 +523,10 @@ bool StructTraits<mojom::FormDataPredictionsDataView, FormDataPredictions>:: ...@@ -489,9 +523,10 @@ bool StructTraits<mojom::FormDataPredictionsDataView, FormDataPredictions>::
} }
// static // static
bool StructTraits<mojom::PasswordAndRealmDataView, PasswordAndRealm>::Read( bool StructTraits<autofill::mojom::PasswordAndRealmDataView,
mojom::PasswordAndRealmDataView data, autofill::PasswordAndRealm>::
PasswordAndRealm* out) { Read(autofill::mojom::PasswordAndRealmDataView data,
autofill::PasswordAndRealm* out) {
if (!data.ReadPassword(&out->password)) if (!data.ReadPassword(&out->password))
return false; return false;
if (!data.ReadRealm(&out->realm)) if (!data.ReadRealm(&out->realm))
...@@ -501,8 +536,10 @@ bool StructTraits<mojom::PasswordAndRealmDataView, PasswordAndRealm>::Read( ...@@ -501,8 +536,10 @@ bool StructTraits<mojom::PasswordAndRealmDataView, PasswordAndRealm>::Read(
} }
// static // static
bool StructTraits<mojom::PasswordFormFillDataDataView, PasswordFormFillData>:: bool StructTraits<autofill::mojom::PasswordFormFillDataDataView,
Read(mojom::PasswordFormFillDataDataView data, PasswordFormFillData* out) { autofill::PasswordFormFillData>::
Read(autofill::mojom::PasswordFormFillDataDataView data,
autofill::PasswordFormFillData* out) {
if (!data.ReadName(&out->name) || !data.ReadOrigin(&out->origin) || if (!data.ReadName(&out->name) || !data.ReadOrigin(&out->origin) ||
!data.ReadAction(&out->action) || !data.ReadAction(&out->action) ||
!data.ReadUsernameField(&out->username_field) || !data.ReadUsernameField(&out->username_field) ||
...@@ -519,10 +556,10 @@ bool StructTraits<mojom::PasswordFormFillDataDataView, PasswordFormFillData>:: ...@@ -519,10 +556,10 @@ bool StructTraits<mojom::PasswordFormFillDataDataView, PasswordFormFillData>::
} }
// static // static
bool StructTraits<mojom::PasswordFormGenerationDataDataView, bool StructTraits<autofill::mojom::PasswordFormGenerationDataDataView,
PasswordFormGenerationData>:: autofill::PasswordFormGenerationData>::
Read(mojom::PasswordFormGenerationDataDataView data, Read(autofill::mojom::PasswordFormGenerationDataDataView data,
PasswordFormGenerationData* out) { autofill::PasswordFormGenerationData* out) {
out->form_signature = data.form_signature(); out->form_signature = data.form_signature();
out->field_signature = data.field_signature(); out->field_signature = data.field_signature();
if (data.has_confirmation_field()) { if (data.has_confirmation_field()) {
...@@ -535,9 +572,10 @@ bool StructTraits<mojom::PasswordFormGenerationDataDataView, ...@@ -535,9 +572,10 @@ bool StructTraits<mojom::PasswordFormGenerationDataDataView,
} }
// static // static
bool StructTraits<mojom::PasswordFormDataView, PasswordForm>::Read( bool StructTraits<
mojom::PasswordFormDataView data, autofill::mojom::PasswordFormDataView,
PasswordForm* out) { autofill::PasswordForm>::Read(autofill::mojom::PasswordFormDataView data,
autofill::PasswordForm* out) {
if (!data.ReadScheme(&out->scheme) || if (!data.ReadScheme(&out->scheme) ||
!data.ReadSignonRealm(&out->signon_realm) || !data.ReadSignonRealm(&out->signon_realm) ||
!data.ReadOriginWithPath(&out->origin) || !data.ReadOriginWithPath(&out->origin) ||
...@@ -605,10 +643,10 @@ bool StructTraits<mojom::PasswordFormDataView, PasswordForm>::Read( ...@@ -605,10 +643,10 @@ bool StructTraits<mojom::PasswordFormDataView, PasswordForm>::Read(
} }
// static // static
std::vector<autofill::FormFieldData> StructTraits< std::vector<autofill::FormFieldData>
mojom::PasswordFormFieldPredictionMapDataView, StructTraits<autofill::mojom::PasswordFormFieldPredictionMapDataView,
PasswordFormFieldPredictionMap>::keys(const PasswordFormFieldPredictionMap& autofill::PasswordFormFieldPredictionMap>::
r) { keys(const autofill::PasswordFormFieldPredictionMap& r) {
std::vector<autofill::FormFieldData> data; std::vector<autofill::FormFieldData> data;
for (const auto& i : r) for (const auto& i : r)
data.push_back(i.first); data.push_back(i.first);
...@@ -617,9 +655,9 @@ std::vector<autofill::FormFieldData> StructTraits< ...@@ -617,9 +655,9 @@ std::vector<autofill::FormFieldData> StructTraits<
// static // static
std::vector<autofill::PasswordFormFieldPredictionType> std::vector<autofill::PasswordFormFieldPredictionType>
StructTraits<mojom::PasswordFormFieldPredictionMapDataView, StructTraits<autofill::mojom::PasswordFormFieldPredictionMapDataView,
PasswordFormFieldPredictionMap>:: autofill::PasswordFormFieldPredictionMap>::
values(const PasswordFormFieldPredictionMap& r) { values(const autofill::PasswordFormFieldPredictionMap& r) {
std::vector<autofill::PasswordFormFieldPredictionType> types; std::vector<autofill::PasswordFormFieldPredictionType> types;
for (const auto& i : r) for (const auto& i : r)
types.push_back(i.second); types.push_back(i.second);
...@@ -627,15 +665,15 @@ StructTraits<mojom::PasswordFormFieldPredictionMapDataView, ...@@ -627,15 +665,15 @@ StructTraits<mojom::PasswordFormFieldPredictionMapDataView,
} }
// static // static
bool StructTraits<mojom::PasswordFormFieldPredictionMapDataView, bool StructTraits<autofill::mojom::PasswordFormFieldPredictionMapDataView,
PasswordFormFieldPredictionMap>:: autofill::PasswordFormFieldPredictionMap>::
Read(mojom::PasswordFormFieldPredictionMapDataView data, Read(autofill::mojom::PasswordFormFieldPredictionMapDataView data,
PasswordFormFieldPredictionMap* out) { autofill::PasswordFormFieldPredictionMap* out) {
// Combines keys vector and values vector to the map. // Combines keys vector and values vector to the map.
std::vector<FormFieldData> keys; std::vector<autofill::FormFieldData> keys;
if (!data.ReadKeys(&keys)) if (!data.ReadKeys(&keys))
return false; return false;
std::vector<PasswordFormFieldPredictionType> values; std::vector<autofill::PasswordFormFieldPredictionType> values;
if (!data.ReadValues(&values)) if (!data.ReadValues(&values))
return false; return false;
if (keys.size() != values.size()) if (keys.size() != values.size())
...@@ -648,9 +686,10 @@ bool StructTraits<mojom::PasswordFormFieldPredictionMapDataView, ...@@ -648,9 +686,10 @@ bool StructTraits<mojom::PasswordFormFieldPredictionMapDataView,
} }
// static // static
std::vector<autofill::FormData> std::vector<autofill::FormData> StructTraits<
StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::keys( autofill::mojom::FormsPredictionsMapDataView,
const FormsPredictionsMap& r) { autofill::FormsPredictionsMap>::keys(const autofill::FormsPredictionsMap&
r) {
std::vector<autofill::FormData> data; std::vector<autofill::FormData> data;
for (const auto& i : r) for (const auto& i : r)
data.push_back(i.first); data.push_back(i.first);
...@@ -658,9 +697,10 @@ StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::keys( ...@@ -658,9 +697,10 @@ StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::keys(
} }
// static // static
std::vector<autofill::PasswordFormFieldPredictionMap> std::vector<autofill::PasswordFormFieldPredictionMap> StructTraits<
StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::values( autofill::mojom::FormsPredictionsMapDataView,
const FormsPredictionsMap& r) { autofill::FormsPredictionsMap>::values(const autofill::FormsPredictionsMap&
r) {
std::vector<autofill::PasswordFormFieldPredictionMap> maps; std::vector<autofill::PasswordFormFieldPredictionMap> maps;
for (const auto& i : r) for (const auto& i : r)
maps.push_back(i.second); maps.push_back(i.second);
...@@ -668,13 +708,15 @@ StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::values( ...@@ -668,13 +708,15 @@ StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::values(
} }
// static // static
bool StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>:: bool StructTraits<autofill::mojom::FormsPredictionsMapDataView,
Read(mojom::FormsPredictionsMapDataView data, FormsPredictionsMap* out) { autofill::FormsPredictionsMap>::
Read(autofill::mojom::FormsPredictionsMapDataView data,
autofill::FormsPredictionsMap* out) {
// Combines keys vector and values vector to the map. // Combines keys vector and values vector to the map.
std::vector<FormData> keys; std::vector<autofill::FormData> keys;
if (!data.ReadKeys(&keys)) if (!data.ReadKeys(&keys))
return false; return false;
std::vector<PasswordFormFieldPredictionMap> values; std::vector<autofill::PasswordFormFieldPredictionMap> values;
if (!data.ReadValues(&values)) if (!data.ReadValues(&values))
return false; return false;
if (keys.size() != values.size()) if (keys.size() != values.size())
...@@ -687,8 +729,10 @@ bool StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>:: ...@@ -687,8 +729,10 @@ bool StructTraits<mojom::FormsPredictionsMapDataView, FormsPredictionsMap>::
} }
// static // static
bool StructTraits<mojom::PossibleUsernamePairDataView, PossibleUsernamePair>:: bool StructTraits<autofill::mojom::PossibleUsernamePairDataView,
Read(mojom::PossibleUsernamePairDataView data, PossibleUsernamePair* out) { autofill::PossibleUsernamePair>::
Read(autofill::mojom::PossibleUsernamePairDataView data,
autofill::PossibleUsernamePair* out) {
if (!data.ReadValue(&out->first) || !data.ReadFieldName(&out->second)) if (!data.ReadValue(&out->first) || !data.ReadFieldName(&out->second))
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment