#ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
namespace content {
class WebContents;
}
namespace gfx {
class Point;
}
namespace autofill {
class AutofillPopupBaseView : public views::WidgetDelegateView,
public views::WidgetObserver {
protected:
explicit AutofillPopupBaseView(AutofillPopupViewDelegate* delegate,
views::Widget* observing_widget);
virtual ~AutofillPopupBaseView();
void DoShow();
void DoHide();
void DoUpdateBoundsAndRedrawPopup();
static const SkColor kBorderColor;
static const SkColor kHoveredBackgroundColor;
static const SkColor kItemTextColor;
static const SkColor kPopupBackground;
static const SkColor kValueTextColor;
static const SkColor kWarningTextColor;
private:
friend class AutofillPopupBaseViewTest;
virtual void OnMouseCaptureLost() OVERRIDE;
virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
virtual void OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) OVERRIDE;
void RemoveObserver();
void SetSelection(const gfx::Point& point);
void AcceptSelection(const gfx::Point& point);
void ClearSelection();
bool ShouldHideOnOutsideClick();
void HideController();
bool ShouldRepostEvent(const ui::MouseEvent& event);
gfx::NativeView container_view();
AutofillPopupViewDelegate* delegate_;
views::Widget* observing_widget_;
base::WeakPtrFactory<AutofillPopupBaseView> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AutofillPopupBaseView);
};
}
#endif