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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // This interface provides data to an AutofillPopupView. | 27 // This interface provides data to an AutofillPopupView. |
28 class AutofillPopupController : public AutofillPopupViewDelegate { | 28 class AutofillPopupController : public AutofillPopupViewDelegate { |
29 public: | 29 public: |
30 // Recalculates the height and width of the popup and triggers a redraw. | 30 // Recalculates the height and width of the popup and triggers a redraw. |
31 virtual void UpdateBoundsAndRedrawPopup() = 0; | 31 virtual void UpdateBoundsAndRedrawPopup() = 0; |
32 | 32 |
33 // Accepts the suggestion at |index|. | 33 // Accepts the suggestion at |index|. |
34 virtual void AcceptSuggestion(size_t index) = 0; | 34 virtual void AcceptSuggestion(size_t index) = 0; |
35 | 35 |
36 // Gets the resource value for the given resource, returning -1 if the | |
37 // resource isn't recognized. | |
38 virtual int GetIconResourceID(const base::string16& resource_name) const = 0; | |
39 | |
40 // Returns true if the given index refers to an element that is a warning | 36 // Returns true if the given index refers to an element that is a warning |
41 // rather than an Autofill suggestion. | 37 // rather than an Autofill suggestion. |
42 virtual bool IsWarning(size_t index) const = 0; | 38 virtual bool IsWarning(size_t index) const = 0; |
43 | 39 |
44 // Returns the bounds of the item at |index| in the popup, relative to | |
45 // the top left of the popup. | |
46 virtual gfx::Rect GetRowBounds(size_t index) = 0; | |
47 | |
48 // Returns the number of lines of data that there are. | 40 // Returns the number of lines of data that there are. |
49 virtual size_t GetLineCount() const = 0; | 41 virtual size_t GetLineCount() const = 0; |
50 | 42 |
51 // Returns the suggestion or pre-elided string at the given row index. | 43 // Returns the suggestion or pre-elided string at the given row index. |
52 virtual const autofill::Suggestion& GetSuggestionAt(size_t row) const = 0; | 44 virtual const autofill::Suggestion& GetSuggestionAt(size_t row) const = 0; |
53 virtual const base::string16& GetElidedValueAt(size_t row) const = 0; | 45 virtual const base::string16& GetElidedValueAt(size_t row) const = 0; |
54 virtual const base::string16& GetElidedLabelAt(size_t row) const = 0; | 46 virtual const base::string16& GetElidedLabelAt(size_t row) const = 0; |
55 | 47 |
56 // Returns whether the item at |list_index| can be removed. If so, fills | 48 // Returns whether the item at |list_index| can be removed. If so, fills |
57 // out |title| and |body| (when non-null) with relevant user-facing text. | 49 // out |title| and |body| (when non-null) with relevant user-facing text. |
(...skipping 15 matching lines...) Expand all Loading... |
73 // hovered or has keyboard focus. | 65 // hovered or has keyboard focus. |
74 virtual int selected_line() const = 0; | 66 virtual int selected_line() const = 0; |
75 | 67 |
76 protected: | 68 protected: |
77 ~AutofillPopupController() override {} | 69 ~AutofillPopupController() override {} |
78 }; | 70 }; |
79 | 71 |
80 } // namespace autofill | 72 } // namespace autofill |
81 | 73 |
82 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 74 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
OLD | NEW |