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_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // This interface provides data to an AutofillPopupView. | 23 // This interface provides data to an AutofillPopupView. |
24 class AutofillPopupController : public AutofillPopupViewDelegate { | 24 class AutofillPopupController : public AutofillPopupViewDelegate { |
25 public: | 25 public: |
26 // Recalculates the height and width of the popup and triggers a redraw. | 26 // Recalculates the height and width of the popup and triggers a redraw. |
27 virtual void UpdateBoundsAndRedrawPopup() = 0; | 27 virtual void UpdateBoundsAndRedrawPopup() = 0; |
28 | 28 |
29 // Accepts the suggestion at |index|. | 29 // Accepts the suggestion at |index|. |
30 virtual void AcceptSuggestion(size_t index) = 0; | 30 virtual void AcceptSuggestion(size_t index) = 0; |
31 | 31 |
32 // Returns true if the given index refers to an element that is a warning | |
33 // rather than an Autofill suggestion. | |
34 virtual bool IsWarning(size_t index) const = 0; | |
35 | |
36 // Returns the number of lines of data that there are. | 32 // Returns the number of lines of data that there are. |
37 virtual size_t GetLineCount() const = 0; | 33 virtual size_t GetLineCount() const = 0; |
38 | 34 |
39 // Returns the suggestion or pre-elided string at the given row index. | 35 // Returns the suggestion or pre-elided string at the given row index. |
40 virtual const autofill::Suggestion& GetSuggestionAt(size_t row) const = 0; | 36 virtual const autofill::Suggestion& GetSuggestionAt(size_t row) const = 0; |
41 virtual const base::string16& GetElidedValueAt(size_t row) const = 0; | 37 virtual const base::string16& GetElidedValueAt(size_t row) const = 0; |
42 virtual const base::string16& GetElidedLabelAt(size_t row) const = 0; | 38 virtual const base::string16& GetElidedLabelAt(size_t row) const = 0; |
43 | 39 |
44 // Returns whether the item at |list_index| can be removed. If so, fills | 40 // Returns whether the item at |list_index| can be removed. If so, fills |
45 // out |title| and |body| (when non-null) with relevant user-facing text. | 41 // out |title| and |body| (when non-null) with relevant user-facing text. |
(...skipping 14 matching lines...) Expand all Loading... |
60 | 56 |
61 virtual const AutofillPopupLayoutModel& layout_model() const = 0; | 57 virtual const AutofillPopupLayoutModel& layout_model() const = 0; |
62 | 58 |
63 protected: | 59 protected: |
64 ~AutofillPopupController() override {} | 60 ~AutofillPopupController() override {} |
65 }; | 61 }; |
66 | 62 |
67 } // namespace autofill | 63 } // namespace autofill |
68 | 64 |
69 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 65 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
OLD | NEW |