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