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"
18 // Base class for Controllers of Autofill-style popups. This interface is
19 // used by the relevant views to communicate with the controller.
20 class AutofillPopupViewDelegate
{
22 // Called when the popup should be hidden. Controller will be deleted after
23 // the view has been hidden and destroyed.
24 virtual void Hide() = 0;
26 // Called whent the popup view was destroyed.
27 virtual void ViewDestroyed() = 0;
29 // The user has selected |point|, e.g. by hovering the mouse cursor. |point|
30 // must be in popup coordinates.
31 virtual void SetSelectionAtPoint(const gfx::Point
& point
) = 0;
33 // The user has accepted the currently selected line. Returns whether there
34 // was a selection to accept.
35 virtual bool AcceptSelectedLine() = 0;
37 // The user cleared the current selection, e.g. by moving the mouse cursor
38 // out of the popup bounds.
39 virtual void SelectionCleared() = 0;
41 // The actual bounds of the popup.
42 virtual const gfx::Rect
& popup_bounds() const = 0;
44 // The view that the form field element sits in.
45 virtual gfx::NativeView
container_view() = 0;
47 // The bounds of the form field element (screen coordinates).
48 virtual const gfx::RectF
& element_bounds() const = 0;
50 // If the current popup should be displayed in RTL mode.
51 virtual bool IsRTL() const = 0;
54 virtual ~AutofillPopupViewDelegate() {}
57 } // namespace autofill
59 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_DELEGATE_H_