OLD | NEW |
---|---|
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 // Size difference between the normal font and the smaller font, in pixels. | 42 // Size difference between the normal font and the smaller font, in pixels. |
43 const int kSmallerFontSizeDelta = -1; | 43 const int kSmallerFontSizeDelta = -1; |
44 | 44 |
45 const int kHttpWarningIconWidth = 16; | 45 const int kHttpWarningIconWidth = 16; |
46 #endif | 46 #endif |
47 | 47 |
48 const struct { | 48 const struct { |
49 const char* name; | 49 const char* name; |
50 int id; | 50 int id; |
51 } kDataResources[] = { | 51 } kDataResources[] = { |
52 {"americanExpressCC", IDR_AUTOFILL_CC_AMEX}, | 52 {kAmericanExpressCard, IDR_AUTOFILL_CC_AMEX}, |
53 {"dinersCC", IDR_AUTOFILL_CC_GENERIC}, | 53 {kDinersCard, IDR_AUTOFILL_CC_GENERIC}, |
Mathieu
2017/05/29 15:54:31
yikes, there's a few errors from before your patch
jiahuiguo
2017/05/29 20:08:06
Done.
| |
54 {"discoverCC", IDR_AUTOFILL_CC_DISCOVER}, | 54 {kDiscoverCard, IDR_AUTOFILL_CC_DISCOVER}, |
55 {"genericCC", IDR_AUTOFILL_CC_GENERIC}, | 55 {kEloCard, IDR_AUTOFILL_CC_ELO}, |
56 {"jcbCC", IDR_AUTOFILL_CC_GENERIC}, | 56 {kGenericCard, IDR_AUTOFILL_CC_GENERIC}, |
57 {"masterCardCC", IDR_AUTOFILL_CC_MASTERCARD}, | 57 {kJCBCard, IDR_AUTOFILL_CC_GENERIC}, |
58 {"mirCC", IDR_AUTOFILL_CC_MIR}, | 58 {kMasterCard, IDR_AUTOFILL_CC_MASTERCARD}, |
59 {"unionPayCC", IDR_AUTOFILL_CC_UNIONPAY}, | 59 {kMirCard, IDR_AUTOFILL_CC_MIR}, |
60 {"visaCC", IDR_AUTOFILL_CC_VISA}, | 60 {kUnionPay, IDR_AUTOFILL_CC_UNIONPAY}, |
61 {kVisaCard, IDR_AUTOFILL_CC_VISA}, | |
61 #if defined(OS_ANDROID) | 62 #if defined(OS_ANDROID) |
62 {"httpWarning", IDR_AUTOFILL_HTTP_WARNING}, | 63 {"httpWarning", IDR_AUTOFILL_HTTP_WARNING}, |
63 {"httpsInvalid", IDR_AUTOFILL_HTTPS_INVALID_WARNING}, | 64 {"httpsInvalid", IDR_AUTOFILL_HTTPS_INVALID_WARNING}, |
64 {"scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW}, | 65 {"scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW}, |
65 {"settings", IDR_AUTOFILL_SETTINGS}, | 66 {"settings", IDR_AUTOFILL_SETTINGS}, |
66 {"create", IDR_AUTOFILL_CREATE}, | 67 {"create", IDR_AUTOFILL_CREATE}, |
67 #endif | 68 #endif |
68 }; | 69 }; |
69 | 70 |
70 int GetRowHeightFromId(int identifier) { | 71 int GetRowHeightFromId(int identifier) { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { | 303 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { |
303 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || | 304 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || |
304 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); | 305 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); |
305 } | 306 } |
306 | 307 |
307 unsigned int AutofillPopupLayoutModel::GetMargin() const { | 308 unsigned int AutofillPopupLayoutModel::GetMargin() const { |
308 return GetPopupMargin(); | 309 return GetPopupMargin(); |
309 } | 310 } |
310 | 311 |
311 } // namespace autofill | 312 } // namespace autofill |
OLD | NEW |