autofill_popup_delegate.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
1// Copyright 2013 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
5#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_POPUP_DELEGATE_H_
6#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_POPUP_DELEGATE_H_
7
8#include "base/strings/string16.h"
9
10namespace ui {
11class MouseEvent;
12}
13
14namespace autofill {
15
16// An interface for interaction with AutofillPopupController. Will be notified
17// of events by the controller.
18class AutofillPopupDelegate {
19 public:
20  // Called when the Autofill popup is shown.
21  virtual void OnPopupShown() = 0;
22
23  // Called when the Autofill popup is hidden.
24  virtual void OnPopupHidden() = 0;
25
26  // Called when the Autofill popup recieves a click outside of the popup view
27  // to determine if the event should be reposted to the native window manager.
28  virtual bool ShouldRepostEvent(const ui::MouseEvent& event) = 0;
29
30  // Called when the autofill suggestion indicated by |identifier| has been
31  // temporarily selected (e.g., hovered).
32  virtual void DidSelectSuggestion(const base::string16& value,
33                                   int identifier) = 0;
34
35  // Inform the delegate that a row in the popup has been chosen.
36  virtual void DidAcceptSuggestion(const base::string16& value,
37                                   int identifier) = 0;
38
39  // Delete the described suggestion.
40  virtual void RemoveSuggestion(const base::string16& value,
41                                int identifier) = 0;
42
43  // Informs the delegate that the Autofill previewed form should be cleared.
44  virtual void ClearPreviewedForm() = 0;
45};
46
47}  // namespace autofill
48
49#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_POPUP_DELEGATE_H_
50