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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Recalculates the height and width of the popup and triggers a redraw. | 27 // Recalculates the height and width of the popup and triggers a redraw. |
28 virtual void UpdateBoundsAndRedrawPopup() = 0; | 28 virtual void UpdateBoundsAndRedrawPopup() = 0; |
29 | 29 |
30 // Accepts the suggestion at |index|. | 30 // Accepts the suggestion at |index|. |
31 virtual void AcceptSuggestion(size_t index) = 0; | 31 virtual void AcceptSuggestion(size_t index) = 0; |
32 | 32 |
33 // Gets the resource value for the given resource, returning -1 if the | 33 // Gets the resource value for the given resource, returning -1 if the |
34 // resource isn't recognized. | 34 // resource isn't recognized. |
35 virtual int GetIconResourceID(const base::string16& resource_name) const = 0; | 35 virtual int GetIconResourceID(const base::string16& resource_name) const = 0; |
36 | 36 |
37 // Returns true if the given index refers to an element that can be deleted. | |
38 virtual bool CanDelete(size_t index) const = 0; | |
39 | |
40 // Returns true if the given index refers to an element that is a warning | 37 // Returns true if the given index refers to an element that is a warning |
41 // rather than an Autofill suggestion. | 38 // rather than an Autofill suggestion. |
42 virtual bool IsWarning(size_t index) const = 0; | 39 virtual bool IsWarning(size_t index) const = 0; |
43 | 40 |
44 // Updates the bounds of the popup and initiates a redraw. | 41 // Updates the bounds of the popup and initiates a redraw. |
45 virtual void SetPopupBounds(const gfx::Rect& bounds) = 0; | 42 virtual void SetPopupBounds(const gfx::Rect& bounds) = 0; |
46 | 43 |
47 // Returns the bounds of the item at |index| in the popup, relative to | 44 // Returns the bounds of the item at |index| in the popup, relative to |
48 // the top left of the popup. | 45 // the top left of the popup. |
49 virtual gfx::Rect GetRowBounds(size_t index) = 0; | 46 virtual gfx::Rect GetRowBounds(size_t index) = 0; |
(...skipping 17 matching lines...) Expand all Loading... |
67 // hovered or has keyboard focus. | 64 // hovered or has keyboard focus. |
68 virtual int selected_line() const = 0; | 65 virtual int selected_line() const = 0; |
69 | 66 |
70 protected: | 67 protected: |
71 ~AutofillPopupController() override {} | 68 ~AutofillPopupController() override {} |
72 }; | 69 }; |
73 | 70 |
74 } // namespace autofill | 71 } // namespace autofill |
75 | 72 |
76 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 73 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
OLD | NEW |