Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ | |
| 7 | |
| 8 #include "components/strings/grit/components_strings.h" | |
| 9 #include "ui/base/l10n/l10n_util.h" | |
| 10 #include "ui/views/controls/textfield/textfield.h" | |
| 11 | |
| 12 namespace autofill { | |
| 13 | |
| 14 // Fixed width of the CVC Textfield, in characters. | |
| 15 static const int kDefaultWidthForCvc = 8; | |
|
Evan Stade
2017/04/11 15:28:05
I would just inline this. The code itself is very
Jared Saul
2017/04/11 22:57:47
Done.
| |
| 16 | |
| 17 // Creates and returns a small Textfield intended to be used for CVC entry. | |
| 18 static views::Textfield* CreateCvcTextfield() { | |
| 19 views::Textfield* textfield = new views::Textfield(); | |
| 20 textfield->set_placeholder_text( | |
| 21 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC)); | |
| 22 textfield->set_default_width_in_chars(kDefaultWidthForCvc); | |
| 23 textfield->SetTextInputType(ui::TextInputType::TEXT_INPUT_TYPE_NUMBER); | |
| 24 return textfield; | |
| 25 } | |
| 26 | |
| 27 } // namespace autofill | |
| 28 | |
| 29 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ | |
| OLD | NEW |