| 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 25 matching lines...) Expand all Loading... |
| 36 virtual void MouseExitedPopup() = 0; | 36 virtual void MouseExitedPopup() = 0; |
| 37 | 37 |
| 38 // Accepts the suggestion at |index|. | 38 // Accepts the suggestion at |index|. |
| 39 virtual void AcceptSuggestion(size_t index) = 0; | 39 virtual void AcceptSuggestion(size_t index) = 0; |
| 40 | 40 |
| 41 // Gets the resource value for the given resource, returning -1 if the | 41 // Gets the resource value for the given resource, returning -1 if the |
| 42 // resource isn't recognized. | 42 // resource isn't recognized. |
| 43 virtual int GetIconResourceID(const string16& resource_name) = 0; | 43 virtual int GetIconResourceID(const string16& resource_name) = 0; |
| 44 | 44 |
| 45 // Returns true if the given index refers to an element that can be deleted. | 45 // Returns true if the given index refers to an element that can be deleted. |
| 46 virtual bool CanDelete(size_t index) = 0; | 46 virtual bool CanDelete(size_t index) const = 0; |
| 47 | |
| 48 #if !defined(OS_ANDROID) | |
| 49 // Calculates the width of the popup based on its contents. | |
| 50 virtual int GetPopupRequiredWidth() = 0; | |
| 51 | |
| 52 // Calculates the height of the popup based on its contents. | |
| 53 virtual int GetPopupRequiredHeight() = 0; | |
| 54 #endif | |
| 55 | 47 |
| 56 // Updates the bounds of the popup and initiates a redraw. | 48 // Updates the bounds of the popup and initiates a redraw. |
| 57 virtual void SetPopupBounds(const gfx::Rect& bounds) = 0; | 49 virtual void SetPopupBounds(const gfx::Rect& bounds) = 0; |
| 58 | 50 |
| 59 // Returns the bounds of the item at |index| in the popup, relative to | 51 // Returns the bounds of the item at |index| in the popup, relative to |
| 60 // the top left of the popup. | 52 // the top left of the popup. |
| 61 virtual gfx::Rect GetRowBounds(size_t index) = 0; | 53 virtual gfx::Rect GetRowBounds(size_t index) = 0; |
| 62 | 54 |
| 63 // The actual bounds of the popup. | 55 // The actual bounds of the popup. |
| 64 virtual const gfx::Rect& popup_bounds() const = 0; | 56 virtual const gfx::Rect& popup_bounds() const = 0; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 91 virtual int selected_line() const = 0; | 83 virtual int selected_line() const = 0; |
| 92 | 84 |
| 93 // Returns true if the delete icon of the selected line is currently hovered. | 85 // Returns true if the delete icon of the selected line is currently hovered. |
| 94 virtual bool delete_icon_hovered() const = 0; | 86 virtual bool delete_icon_hovered() const = 0; |
| 95 | 87 |
| 96 protected: | 88 protected: |
| 97 virtual ~AutofillPopupController() {} | 89 virtual ~AutofillPopupController() {} |
| 98 }; | 90 }; |
| 99 | 91 |
| 100 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 92 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
| OLD | NEW |