Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / autofill / autofill_dialog_common.cc
blob565319957e0fd92abb50d42ddbfcc0982649eb96
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/autofill/autofill_dialog_common.h"
7 namespace autofill {
8 namespace common {
10 AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent(
11 DialogSection section) {
12 switch (section) {
13 case SECTION_BILLING:
14 return AutofillMetrics::DIALOG_UI_BILLING_ITEM_ADDED;
16 case SECTION_SHIPPING:
17 return AutofillMetrics::DIALOG_UI_SHIPPING_ITEM_ADDED;
19 case SECTION_CC:
20 return AutofillMetrics::DIALOG_UI_CC_ITEM_ADDED;
23 NOTREACHED();
24 return AutofillMetrics::NUM_DIALOG_UI_EVENTS;
27 AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent(
28 DialogSection section) {
29 switch (section) {
30 case SECTION_BILLING:
31 return AutofillMetrics::DIALOG_UI_BILLING_SELECTED_SUGGESTION_CHANGED;
33 case SECTION_SHIPPING:
34 return AutofillMetrics::DIALOG_UI_SHIPPING_SELECTED_SUGGESTION_CHANGED;
36 case SECTION_CC:
37 return AutofillMetrics::DIALOG_UI_CC_SELECTED_SUGGESTION_CHANGED;
40 NOTREACHED();
41 return AutofillMetrics::NUM_DIALOG_UI_EVENTS;
44 } // namespace common
45 } // namespace autofill