| Index: components/autofill/core/browser/server_field_types_util.cc
|
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_common.cc b/components/autofill/core/browser/server_field_types_util.cc
|
| similarity index 63%
|
| copy from chrome/browser/ui/autofill/autofill_dialog_common.cc
|
| copy to components/autofill/core/browser/server_field_types_util.cc
|
| index fd2cadce4333e02f406500bec99a1db0662909b2..7922eddd9b98e8dd6d2ecf24f652b28de31c0f9f 100644
|
| --- a/chrome/browser/ui/autofill/autofill_dialog_common.cc
|
| +++ b/components/autofill/core/browser/server_field_types_util.cc
|
| @@ -1,17 +1,13 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/ui/autofill/autofill_dialog_common.h"
|
| +#include "components/autofill/core/browser/server_field_types_util.h"
|
|
|
| -#include "base/strings/utf_string_conversions.h"
|
| -#include "chrome/browser/browser_process.h"
|
| -#include "components/autofill/core/browser/autofill_country.h"
|
| #include "components/autofill/core/browser/autofill_field.h"
|
| #include "components/autofill/core/browser/autofill_type.h"
|
|
|
| namespace autofill {
|
| -namespace common {
|
|
|
| bool ServerTypeEncompassesFieldType(ServerFieldType type,
|
| const AutofillType& field_type) {
|
| @@ -37,9 +33,8 @@ bool ServerTypeEncompassesFieldType(ServerFieldType type,
|
|
|
| // The page may ask for individual address lines; this roughly matches the
|
| // street address blob.
|
| - if (server_type == ADDRESS_HOME_LINE1 ||
|
| - server_type == ADDRESS_HOME_LINE2 ||
|
| - server_type == ADDRESS_HOME_LINE3) {
|
| + if (server_type == ADDRESS_HOME_LINE1 || server_type == ADDRESS_HOME_LINE2 ||
|
| + server_type == ADDRESS_HOME_LINE3) {
|
| return autofill_type.GetStorableType() == ADDRESS_HOME_STREET_ADDRESS;
|
| }
|
|
|
| @@ -77,46 +72,6 @@ void BuildInputs(const DetailInput* input_template,
|
| }
|
| }
|
|
|
| -AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent(
|
| - DialogSection section) {
|
| - switch (section) {
|
| - case SECTION_BILLING:
|
| - return AutofillMetrics::DIALOG_UI_BILLING_ITEM_ADDED;
|
| -
|
| - case SECTION_CC_BILLING:
|
| - return AutofillMetrics::DIALOG_UI_CC_BILLING_ITEM_ADDED;
|
| -
|
| - case SECTION_SHIPPING:
|
| - return AutofillMetrics::DIALOG_UI_SHIPPING_ITEM_ADDED;
|
| -
|
| - case SECTION_CC:
|
| - return AutofillMetrics::DIALOG_UI_CC_ITEM_ADDED;
|
| - }
|
| -
|
| - NOTREACHED();
|
| - return AutofillMetrics::NUM_DIALOG_UI_EVENTS;
|
| -}
|
| -
|
| -AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent(
|
| - DialogSection section) {
|
| - switch (section) {
|
| - case SECTION_BILLING:
|
| - return AutofillMetrics::DIALOG_UI_BILLING_SELECTED_SUGGESTION_CHANGED;
|
| -
|
| - case SECTION_CC_BILLING:
|
| - return AutofillMetrics::DIALOG_UI_CC_BILLING_SELECTED_SUGGESTION_CHANGED;
|
| -
|
| - case SECTION_SHIPPING:
|
| - return AutofillMetrics::DIALOG_UI_SHIPPING_SELECTED_SUGGESTION_CHANGED;
|
| -
|
| - case SECTION_CC:
|
| - return AutofillMetrics::DIALOG_UI_CC_SELECTED_SUGGESTION_CHANGED;
|
| - }
|
| -
|
| - NOTREACHED();
|
| - return AutofillMetrics::NUM_DIALOG_UI_EVENTS;
|
| -}
|
| -
|
| std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs) {
|
| std::vector<ServerFieldType> types;
|
| for (size_t i = 0; i < inputs.size(); ++i) {
|
| @@ -125,5 +80,4 @@ std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs) {
|
| return types;
|
| }
|
|
|
| -} // namespace common
|
| } // namespace autofill
|
|
|