| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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 COMPONENTS_AUTOFILL_CORE_BROWSER_DETAIL_INPUT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_DETAIL_INPUT_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/strings/string16.h" |
| 11 #include "components/autofill/core/browser/field_types.h" |
| 12 |
| 13 namespace autofill { |
| 14 |
| 15 // This struct describes a single input control for the imperative autocomplete |
| 16 // dialog. |
| 17 struct DetailInput { |
| 18 enum Length { |
| 19 SHORT, // Shares a line with other short inputs, like display: inline. |
| 20 SHORT_EOL, // Like SHORT but starts a new line directly afterward. Used to |
| 21 // separate groups of short inputs into different lines. |
| 22 LONG, // Will be given its own full line, like display: block. |
| 23 NONE, // Input will not be shown. |
| 24 }; |
| 25 |
| 26 // Returns whether this input can spread across multiple lines. |
| 27 bool IsMultiline() const; |
| 28 |
| 29 // Used to determine which inputs share lines when laying out. |
| 30 Length length; |
| 31 |
| 32 ServerFieldType type; |
| 33 |
| 34 // Text shown when the input is at its default state (e.g. empty). |
| 35 base::string16 placeholder_text; |
| 36 |
| 37 // A number between 0 and 1.0 that describes how much of the horizontal space |
| 38 // in the row should be allotted to this input. 0 is equivalent to 1. |
| 39 float expand_weight; |
| 40 |
| 41 // When non-empty, indicates the starting value for this input. This will be |
| 42 // used when the user is editing existing data. |
| 43 base::string16 initial_value; |
| 44 }; |
| 45 |
| 46 typedef std::vector<DetailInput> DetailInputs; |
| 47 |
| 48 } // namespace autofill |
| 49 |
| 50 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_DETAIL_INPUT_H_ |
| OLD | NEW |