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 18 matching lines...) Expand all Loading... | |
29 public: | 29 public: |
30 // Called when the popup should get hidden. | 30 // Called when the popup should get hidden. |
31 virtual void Hide() = 0; | 31 virtual void Hide() = 0; |
32 | 32 |
33 // Called whent the popup view was destroyed. | 33 // Called whent the popup view was destroyed. |
34 virtual void ViewDestroyed() = 0; | 34 virtual void ViewDestroyed() = 0; |
35 | 35 |
36 // Recalculates the height and width of the popup and triggers a redraw. | 36 // Recalculates the height and width of the popup and triggers a redraw. |
37 virtual void UpdateBoundsAndRedrawPopup() = 0; | 37 virtual void UpdateBoundsAndRedrawPopup() = 0; |
38 | 38 |
39 // The user has moved the mouse within the popup. | 39 // The line at (x, y) is preselected (e.g., mouse hovered). |
40 virtual void MouseHovered(int x, int y) = 0; | 40 virtual void PointPreselected(int x, int y) = 0; |
Ilya Sherman
2013/11/01 06:45:50
It doesn't make sense, at least in terminology tha
| |
41 | 41 |
42 // The user clicked the mouse within the popup. | 42 // The line at (x, y) is selected (e.g., mouse clicked). |
43 virtual void MouseClicked(int x, int y) = 0; | 43 virtual void PointSelected(int x, int y) = 0; |
44 | 44 |
45 // The user has moved the mouse outside of the popup. | 45 // The preselection is cleared (e.g., mouse exited popup). |
46 virtual void MouseExitedPopup() = 0; | 46 virtual void PreselectionCleared() = 0; |
47 | 47 |
48 // Whether |event| should be reposted to the native window management. | 48 // Whether |event| should be reposted to the native window management. |
49 virtual bool ShouldRepostEvent(const ui::MouseEvent& event) = 0; | 49 virtual bool ShouldRepostEvent(const ui::MouseEvent& event) = 0; |
50 | 50 |
51 // Accepts the suggestion at |index|. | 51 // Accepts the suggestion at |index|. |
52 virtual void AcceptSuggestion(size_t index) = 0; | 52 virtual void AcceptSuggestion(size_t index) = 0; |
53 | 53 |
54 // Gets the resource value for the given resource, returning -1 if the | 54 // Gets the resource value for the given resource, returning -1 if the |
55 // resource isn't recognized. | 55 // resource isn't recognized. |
56 virtual int GetIconResourceID(const string16& resource_name) = 0; | 56 virtual int GetIconResourceID(const string16& resource_name) = 0; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 // Identifier for the row. | 96 // Identifier for the row. |
97 virtual const std::vector<int>& identifiers() const = 0; | 97 virtual const std::vector<int>& identifiers() const = 0; |
98 | 98 |
99 #if !defined(OS_ANDROID) | 99 #if !defined(OS_ANDROID) |
100 // The same font can vary based on the type of data it is showing, | 100 // The same font can vary based on the type of data it is showing, |
101 // so we need to know the row. | 101 // so we need to know the row. |
102 virtual const gfx::Font& GetNameFontForRow(size_t index) const = 0; | 102 virtual const gfx::Font& GetNameFontForRow(size_t index) const = 0; |
103 virtual const gfx::Font& subtext_font() const = 0; | 103 virtual const gfx::Font& subtext_font() const = 0; |
104 #endif | 104 #endif |
105 | 105 |
106 // Returns the index of the selected line. A line is "selected" when it is | 106 // Returns the index of the preselected line. A line is "preselected" when it |
107 // hovered or has keyboard focus. | 107 // is hovered or has keyboard focus. |
108 virtual int selected_line() const = 0; | 108 virtual int preselected_line() const = 0; |
109 | 109 |
110 // Whether the view should be hidden on outside mouse presses. | 110 // Whether the view should be hidden on outside mouse presses. |
111 virtual bool hide_on_outside_click() const = 0; | 111 virtual bool hide_on_outside_click() const = 0; |
112 | 112 |
113 protected: | 113 protected: |
114 virtual ~AutofillPopupController() {} | 114 virtual ~AutofillPopupController() {} |
115 }; | 115 }; |
116 | 116 |
117 } // namespace autofill | 117 } // namespace autofill |
118 | 118 |
119 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ | 119 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ |
OLD | NEW |