1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_DELEGATE_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_DELEGATE_H_
8 #include "ui/gfx/native_widget_types.h"
17 // Base class for Controllers of Autofill-style popups. This interface is
18 // used by the relevant views to communicate with the controller.
19 class AutofillPopupViewDelegate
{
21 // Called when the popup should be hidden. Controller will be deleted after
22 // the view has been hidden and destroyed.
23 virtual void Hide() = 0;
25 // Called whent the popup view was destroyed.
26 virtual void ViewDestroyed() = 0;
28 // The user has selected |point|, e.g. by hovering the mouse cursor. |point|
29 // must be in popup coordinates.
30 virtual void SetSelectionAtPoint(const gfx::Point
& point
) = 0;
32 // The user has accepted the currently selected line. Returns whether there
33 // was a selection to accept.
34 virtual bool AcceptSelectedLine() = 0;
36 // The user cleared the current selection, e.g. by moving the mouse cursor
37 // out of the popup bounds.
38 virtual void SelectionCleared() = 0;
40 // The actual bounds of the popup.
41 virtual const gfx::Rect
& popup_bounds() const = 0;
43 // The view that the form field element sits in.
44 virtual gfx::NativeView
container_view() = 0;
47 virtual ~AutofillPopupViewDelegate() {}
50 } // namespace autofill
52 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_DELEGATE_H_