OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Clear the internal state of the controller. This is needed to ensure that | 161 // Clear the internal state of the controller. This is needed to ensure that |
162 // when the popup is reused it doesn't leak values between uses. | 162 // when the popup is reused it doesn't leak values between uses. |
163 void ClearState(); | 163 void ClearState(); |
164 | 164 |
165 #if !defined(OS_ANDROID) | 165 #if !defined(OS_ANDROID) |
166 // Calculates and sets the bounds of the popup, including placing it properly | 166 // Calculates and sets the bounds of the popup, including placing it properly |
167 // to prevent it from going off the screen. | 167 // to prevent it from going off the screen. |
168 void UpdatePopupBounds(); | 168 void UpdatePopupBounds(); |
169 #endif | 169 #endif |
170 | 170 |
| 171 // Returns the line number of the first selectable line, accounting for a |
| 172 // title. |
| 173 int GetFirstSelectableLine(); |
| 174 |
171 AutofillPopupView* view_; // Weak reference. | 175 AutofillPopupView* view_; // Weak reference. |
172 base::WeakPtr<AutofillPopupDelegate> delegate_; | 176 base::WeakPtr<AutofillPopupDelegate> delegate_; |
173 | 177 |
174 // The bounds of the Autofill popup. | 178 // The bounds of the Autofill popup. |
175 gfx::Rect popup_bounds_; | 179 gfx::Rect popup_bounds_; |
176 | 180 |
177 // The text direction of the popup. | 181 // The text direction of the popup. |
178 base::i18n::TextDirection text_direction_; | 182 base::i18n::TextDirection text_direction_; |
179 | 183 |
180 // The current Autofill query values. | 184 // The current Autofill query values. |
181 std::vector<base::string16> names_; | 185 std::vector<base::string16> names_; |
182 std::vector<base::string16> subtexts_; | 186 std::vector<base::string16> subtexts_; |
183 std::vector<base::string16> icons_; | 187 std::vector<base::string16> icons_; |
184 std::vector<int> identifiers_; | 188 std::vector<int> identifiers_; |
185 | 189 |
186 // Since names_ can be elided to ensure that it fits on the screen, we need to | 190 // Since names_ can be elided to ensure that it fits on the screen, we need to |
187 // keep an unelided copy of the names to be able to pass to the delegate. | 191 // keep an unelided copy of the names to be able to pass to the delegate. |
188 std::vector<base::string16> full_names_; | 192 std::vector<base::string16> full_names_; |
189 | 193 |
190 #if !defined(OS_ANDROID) | 194 #if !defined(OS_ANDROID) |
191 // The fonts for the popup text. | 195 // The fonts for the popup text. |
192 gfx::FontList name_font_list_; | 196 gfx::FontList name_font_list_; |
193 gfx::FontList subtext_font_list_; | 197 gfx::FontList subtext_font_list_; |
194 gfx::FontList warning_font_list_; | 198 gfx::FontList warning_font_list_; |
| 199 gfx::FontList title_font_list_; |
195 #endif | 200 #endif |
196 | 201 |
197 // The line that is currently selected by the user. | 202 // The line that is currently selected by the user. |
198 // |kNoSelection| indicates that no line is currently selected. | 203 // |kNoSelection| indicates that no line is currently selected. |
199 int selected_line_; | 204 int selected_line_; |
200 | 205 |
201 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; | 206 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; |
202 }; | 207 }; |
203 | 208 |
204 } // namespace autofill | 209 } // namespace autofill |
205 | 210 |
206 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 211 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
OLD | NEW |