[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | e4b2fa3 | 2013-03-09 22:56:56 | [diff] [blame] | 5 | #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_ |
6 | #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_ | ||||
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 7 | |
8 | #include "base/string16.h" | ||||
9 | |||||
[email protected] | 5825ba11 | 2013-02-07 06:06:09 | [diff] [blame] | 10 | namespace content { |
11 | class KeyboardListener; | ||||
12 | } | ||||
13 | |||||
[email protected] | e217c563 | 2013-04-12 19:11:48 | [diff] [blame^] | 14 | namespace autofill { |
15 | |||||
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 16 | // An interface for interaction with AutofillPopupController. Will be notified |
17 | // of events by the controller. | ||||
18 | class AutofillPopupDelegate { | ||||
19 | public: | ||||
[email protected] | 5825ba11 | 2013-02-07 06:06:09 | [diff] [blame] | 20 | // Called when the Autofill popup is shown. |listener| may be used to pass |
21 | // keyboard events to the popup. | ||||
22 | virtual void OnPopupShown(content::KeyboardListener* listener) = 0; | ||||
23 | |||||
24 | // Called when the Autofill popup is hidden. |listener| must be unregistered | ||||
25 | // if it was registered in OnPopupShown. | ||||
26 | virtual void OnPopupHidden(content::KeyboardListener* listener) = 0; | ||||
27 | |||||
[email protected] | 7d7d3a79 | 2012-12-22 02:22:22 | [diff] [blame] | 28 | // Called when the autofill suggestion indicated by |identifier| has been |
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 29 | // temporarily selected (e.g., hovered). |
[email protected] | 7d7d3a79 | 2012-12-22 02:22:22 | [diff] [blame] | 30 | virtual void DidSelectSuggestion(int identifier) = 0; |
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 31 | |
[email protected] | 41c4c70d | 2012-12-21 01:22:22 | [diff] [blame] | 32 | // Inform the delegate that a row in the popup has been chosen. |
[email protected] | d5ca8fb | 2013-04-11 17:54:31 | [diff] [blame] | 33 | virtual void DidAcceptSuggestion(const base::string16& value, |
34 | int identifier) = 0; | ||||
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 35 | |
[email protected] | 7d7d3a79 | 2012-12-22 02:22:22 | [diff] [blame] | 36 | // Delete the described suggestion. |
[email protected] | d5ca8fb | 2013-04-11 17:54:31 | [diff] [blame] | 37 | virtual void RemoveSuggestion(const base::string16& value, |
38 | int identifier) = 0; | ||||
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 39 | |
40 | // Informs the delegate that the Autofill previewed form should be cleared. | ||||
41 | virtual void ClearPreviewedForm() = 0; | ||||
[email protected] | dbd4b1d | 2012-12-14 04:28:34 | [diff] [blame] | 42 | }; |
43 | |||||
[email protected] | e217c563 | 2013-04-12 19:11:48 | [diff] [blame^] | 44 | } // namespace autofill |
45 | |||||
[email protected] | e4b2fa3 | 2013-03-09 22:56:56 | [diff] [blame] | 46 | #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_ |