Chromium Code Reviews| Index: chrome/browser/ui/views/autofill/view_util.h |
| diff --git a/chrome/browser/ui/views/autofill/view_util.h b/chrome/browser/ui/views/autofill/view_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b2349ed8a4107593cdf05c6771ecc6856de5757b |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/autofill/view_util.h |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ |
| + |
| +#include "components/strings/grit/components_strings.h" |
| +#include "ui/base/l10n/l10n_util.h" |
| +#include "ui/views/controls/textfield/textfield.h" |
| + |
| +namespace autofill { |
| + |
| +// Fixed width of the CVC Textfield, in characters. |
| +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.
|
| + |
| +// Creates and returns a small Textfield intended to be used for CVC entry. |
| +static views::Textfield* CreateCvcTextfield() { |
| + views::Textfield* textfield = new views::Textfield(); |
| + textfield->set_placeholder_text( |
| + l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC)); |
| + textfield->set_default_width_in_chars(kDefaultWidthForCvc); |
| + textfield->SetTextInputType(ui::TextInputType::TEXT_INPUT_TYPE_NUMBER); |
| + return textfield; |
| +} |
| + |
| +} // namespace autofill |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_VIEW_UTIL_H_ |