Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate.cc

Issue 2137153002: [Autofill] Implement Impression metric for signin promo in CC dropdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_external_delegate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/core/browser/autofill_external_delegate.h" 5 #include "components/autofill/core/browser/autofill_external_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/i18n/case_conversion.h" 11 #include "base/i18n/case_conversion.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
14 #include "base/metrics/sparse_histogram.h" 14 #include "base/metrics/sparse_histogram.h"
15 #include "base/metrics/user_metrics.h"
15 #include "base/stl_util.h" 16 #include "base/stl_util.h"
16 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
17 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
18 #include "build/build_config.h" 19 #include "build/build_config.h"
19 #include "components/autofill/core/browser/autocomplete_history_manager.h" 20 #include "components/autofill/core/browser/autocomplete_history_manager.h"
20 #include "components/autofill/core/browser/autofill_driver.h" 21 #include "components/autofill/core/browser/autofill_driver.h"
21 #include "components/autofill/core/browser/autofill_manager.h" 22 #include "components/autofill/core/browser/autofill_manager.h"
22 #include "components/autofill/core/browser/autofill_metrics.h" 23 #include "components/autofill/core/browser/autofill_metrics.h"
23 #include "components/autofill/core/browser/popup_item_ids.h" 24 #include "components/autofill/core/browser/popup_item_ids.h"
24 #include "components/autofill/core/common/autofill_util.h" 25 #include "components/autofill/core/common/autofill_util.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Suggestion separator; 111 Suggestion separator;
111 separator.frontend_id = POPUP_ITEM_ID_SEPARATOR; 112 separator.frontend_id = POPUP_ITEM_ID_SEPARATOR;
112 suggestions.push_back(separator); 113 suggestions.push_back(separator);
113 #endif 114 #endif
114 115
115 Suggestion signin_promo_suggestion( 116 Suggestion signin_promo_suggestion(
116 l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDIT_CARD_SIGNIN_PROMO)); 117 l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDIT_CARD_SIGNIN_PROMO));
117 signin_promo_suggestion.frontend_id = 118 signin_promo_suggestion.frontend_id =
118 POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO; 119 POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO;
119 suggestions.push_back(signin_promo_suggestion); 120 suggestions.push_back(signin_promo_suggestion);
121 base::RecordAction(
122 base::UserMetricsAction("Signin_Impression_FromAutofillDropdown"));
120 } 123 }
121 124
122 #if !defined(OS_ANDROID) 125 #if !defined(OS_ANDROID)
123 // Remove the separator if it is the last element. 126 // Remove the separator if it is the last element.
124 DCHECK_GT(suggestions.size(), 0U); 127 DCHECK_GT(suggestions.size(), 0U);
125 if (suggestions.back().frontend_id == POPUP_ITEM_ID_SEPARATOR) 128 if (suggestions.back().frontend_id == POPUP_ITEM_ID_SEPARATOR)
126 suggestions.pop_back(); 129 suggestions.pop_back();
127 #endif 130 #endif
128 131
129 // If anything else is added to modify the values after inserting the data 132 // If anything else is added to modify the values after inserting the data
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 suggestions->insert(suggestions->begin(), data_list_values_.size(), 364 suggestions->insert(suggestions->begin(), data_list_values_.size(),
362 Suggestion()); 365 Suggestion());
363 for (size_t i = 0; i < data_list_values_.size(); i++) { 366 for (size_t i = 0; i < data_list_values_.size(); i++) {
364 (*suggestions)[i].value = data_list_values_[i]; 367 (*suggestions)[i].value = data_list_values_[i];
365 (*suggestions)[i].label = data_list_labels_[i]; 368 (*suggestions)[i].label = data_list_labels_[i];
366 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; 369 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY;
367 } 370 }
368 } 371 }
369 372
370 } // namespace autofill 373 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_external_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698