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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_layout_model.cc

Issue 2874933008: Adds animation as feature variation to keyboard accessory. (Closed)
Patch Set: Switch to base/metrics/field_trial_params.h API from variations:: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 "chrome/browser/ui/autofill/autofill_popup_layout_model.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 {"jcbCC", IDR_AUTOFILL_CC_GENERIC}, 56 {"jcbCC", IDR_AUTOFILL_CC_GENERIC},
57 {"masterCardCC", IDR_AUTOFILL_CC_MASTERCARD}, 57 {"masterCardCC", IDR_AUTOFILL_CC_MASTERCARD},
58 {"mirCC", IDR_AUTOFILL_CC_MIR}, 58 {"mirCC", IDR_AUTOFILL_CC_MIR},
59 {"unionPayCC", IDR_AUTOFILL_CC_UNIONPAY}, 59 {"unionPayCC", IDR_AUTOFILL_CC_UNIONPAY},
60 {"visaCC", IDR_AUTOFILL_CC_VISA}, 60 {"visaCC", IDR_AUTOFILL_CC_VISA},
61 #if defined(OS_ANDROID) 61 #if defined(OS_ANDROID)
62 {"httpWarning", IDR_AUTOFILL_HTTP_WARNING}, 62 {"httpWarning", IDR_AUTOFILL_HTTP_WARNING},
63 {"httpsInvalid", IDR_AUTOFILL_HTTPS_INVALID_WARNING}, 63 {"httpsInvalid", IDR_AUTOFILL_HTTPS_INVALID_WARNING},
64 {"scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW}, 64 {"scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW},
65 {"settings", IDR_AUTOFILL_SETTINGS}, 65 {"settings", IDR_AUTOFILL_SETTINGS},
66 {"create", IDR_AUTOFILL_CREATE},
66 #endif 67 #endif
67 }; 68 };
68 69
69 int GetRowHeightFromId(int identifier) { 70 int GetRowHeightFromId(int identifier) {
70 if (identifier == POPUP_ITEM_ID_SEPARATOR) 71 if (identifier == POPUP_ITEM_ID_SEPARATOR)
71 return kSeparatorHeight; 72 return kSeparatorHeight;
72 73
73 return kRowHeight; 74 return kRowHeight;
74 } 75 }
75 76
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (suggestions[index].frontend_id > 0) 165 if (suggestions[index].frontend_id > 0)
165 return bold_font_list_; 166 return bold_font_list_;
166 167
167 // All other message types are defined here. 168 // All other message types are defined here.
168 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); 169 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id);
169 switch (id) { 170 switch (id) {
170 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: 171 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
171 case POPUP_ITEM_ID_CLEAR_FORM: 172 case POPUP_ITEM_ID_CLEAR_FORM:
172 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: 173 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
173 case POPUP_ITEM_ID_AUTOFILL_OPTIONS: 174 case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
175 case POPUP_ITEM_ID_CREATE_HINT:
174 case POPUP_ITEM_ID_SCAN_CREDIT_CARD: 176 case POPUP_ITEM_ID_SCAN_CREDIT_CARD:
175 case POPUP_ITEM_ID_SEPARATOR: 177 case POPUP_ITEM_ID_SEPARATOR:
176 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: 178 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
177 case POPUP_ITEM_ID_TITLE: 179 case POPUP_ITEM_ID_TITLE:
178 case POPUP_ITEM_ID_PASSWORD_ENTRY: 180 case POPUP_ITEM_ID_PASSWORD_ENTRY:
179 return normal_font_list_; 181 return normal_font_list_;
180 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: 182 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
181 case POPUP_ITEM_ID_DATALIST_ENTRY: 183 case POPUP_ITEM_ID_DATALIST_ENTRY:
182 case POPUP_ITEM_ID_USERNAME_ENTRY: 184 case POPUP_ITEM_ID_USERNAME_ENTRY:
183 return bold_font_list_; 185 return bold_font_list_;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { 302 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const {
301 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || 303 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE ||
302 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); 304 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart());
303 } 305 }
304 306
305 unsigned int AutofillPopupLayoutModel::GetMargin() const { 307 unsigned int AutofillPopupLayoutModel::GetMargin() const {
306 return GetPopupMargin(); 308 return GetPopupMargin();
307 } 309 }
308 310
309 } // namespace autofill 311 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698