blob: 78237fef2b2b48a1c589fb63ea74ccd26f6dadcd [file] [log] [blame]
[email protected]dbd4b1d2012-12-14 04:28:341// 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]e4b2fa32013-03-09 22:56:565#ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_
6#define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_
[email protected]dbd4b1d2012-12-14 04:28:347
8#include "base/string16.h"
9
[email protected]5825ba112013-02-07 06:06:0910namespace content {
11class KeyboardListener;
12}
13
[email protected]e217c5632013-04-12 19:11:4814namespace autofill {
15
[email protected]dbd4b1d2012-12-14 04:28:3416// An interface for interaction with AutofillPopupController. Will be notified
17// of events by the controller.
18class AutofillPopupDelegate {
19 public:
[email protected]5825ba112013-02-07 06:06:0920 // 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]7d7d3a792012-12-22 02:22:2228 // Called when the autofill suggestion indicated by |identifier| has been
[email protected]dbd4b1d2012-12-14 04:28:3429 // temporarily selected (e.g., hovered).
[email protected]7d7d3a792012-12-22 02:22:2230 virtual void DidSelectSuggestion(int identifier) = 0;
[email protected]dbd4b1d2012-12-14 04:28:3431
[email protected]41c4c70d2012-12-21 01:22:2232 // Inform the delegate that a row in the popup has been chosen.
[email protected]d5ca8fb2013-04-11 17:54:3133 virtual void DidAcceptSuggestion(const base::string16& value,
34 int identifier) = 0;
[email protected]dbd4b1d2012-12-14 04:28:3435
[email protected]7d7d3a792012-12-22 02:22:2236 // Delete the described suggestion.
[email protected]d5ca8fb2013-04-11 17:54:3137 virtual void RemoveSuggestion(const base::string16& value,
38 int identifier) = 0;
[email protected]dbd4b1d2012-12-14 04:28:3439
40 // Informs the delegate that the Autofill previewed form should be cleared.
41 virtual void ClearPreviewedForm() = 0;
[email protected]dbd4b1d2012-12-14 04:28:3442};
43
[email protected]e217c5632013-04-12 19:11:4844} // namespace autofill
45
[email protected]e4b2fa32013-03-09 22:56:5646#endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_POPUP_DELEGATE_H_