| 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 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // layout. | 109 // layout. |
| 110 SkColor GetDividerColor() const; | 110 SkColor GetDividerColor() const; |
| 111 | 111 |
| 112 // Returns the dropdown item height, or 0 if the dropdown item height isn't | 112 // Returns the dropdown item height, or 0 if the dropdown item height isn't |
| 113 // configured in an experiment to tweak autofill popup layout. | 113 // configured in an experiment to tweak autofill popup layout. |
| 114 unsigned int GetDropdownItemHeight() const; | 114 unsigned int GetDropdownItemHeight() const; |
| 115 | 115 |
| 116 // Returns true if suggestion icon must be displayed before suggestion text. | 116 // Returns true if suggestion icon must be displayed before suggestion text. |
| 117 bool IsIconAtStart(int frontend_id) const; | 117 bool IsIconAtStart(int frontend_id) const; |
| 118 | 118 |
| 119 // Returns the margin for icon, label and between icon and label, or 0 if the |
| 120 // margin isn't configured in an experiment to tweak autofill popup layout. |
| 121 unsigned int GetMargin() const; |
| 122 |
| 119 private: | 123 private: |
| 120 // Returns the enclosing rectangle for the element_bounds. | 124 // Returns the enclosing rectangle for the element_bounds. |
| 121 const gfx::Rect RoundedElementBounds() const; | 125 const gfx::Rect RoundedElementBounds() const; |
| 122 | 126 |
| 123 #if !defined(OS_ANDROID) | 127 #if !defined(OS_ANDROID) |
| 124 // The fonts for the popup text. | 128 // The fonts for the popup text. |
| 125 // Normal font (readable size, non bold). | 129 // Normal font (readable size, non bold). |
| 126 gfx::FontList normal_font_list_; | 130 gfx::FontList normal_font_list_; |
| 127 // Slightly smaller than the normal font. | 131 // Slightly smaller than the normal font. |
| 128 gfx::FontList smaller_font_list_; | 132 gfx::FontList smaller_font_list_; |
| 129 // Bold version of the normal font. | 133 // Bold version of the normal font. |
| 130 gfx::FontList bold_font_list_; | 134 gfx::FontList bold_font_list_; |
| 131 #endif | 135 #endif |
| 132 | 136 |
| 133 // The bounds of the Autofill popup. | 137 // The bounds of the Autofill popup. |
| 134 gfx::Rect popup_bounds_; | 138 gfx::Rect popup_bounds_; |
| 135 | 139 |
| 136 PopupViewCommon view_common_; | 140 PopupViewCommon view_common_; |
| 137 | 141 |
| 138 AutofillPopupViewDelegate* delegate_; // Weak reference. | 142 AutofillPopupViewDelegate* delegate_; // Weak reference. |
| 139 | 143 |
| 140 const bool is_credit_card_popup_; | 144 const bool is_credit_card_popup_; |
| 141 | 145 |
| 142 DISALLOW_COPY_AND_ASSIGN(AutofillPopupLayoutModel); | 146 DISALLOW_COPY_AND_ASSIGN(AutofillPopupLayoutModel); |
| 143 }; | 147 }; |
| 144 | 148 |
| 145 } // namespace autofill | 149 } // namespace autofill |
| 146 | 150 |
| 147 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 151 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| OLD | NEW |