OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
10 #include "ui/views/focus/widget_focus_manager.h" | 10 #include "ui/views/focus/widget_focus_manager.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Hide the widget and delete |this|. | 45 // Hide the widget and delete |this|. |
46 void DoHide(); | 46 void DoHide(); |
47 | 47 |
48 // Update size of popup and paint. | 48 // Update size of popup and paint. |
49 void DoUpdateBoundsAndRedrawPopup(); | 49 void DoUpdateBoundsAndRedrawPopup(); |
50 | 50 |
51 private: | 51 private: |
52 friend class AutofillPopupBaseViewTest; | 52 friend class AutofillPopupBaseViewTest; |
53 | 53 |
54 // views::Views implementation. | 54 // views::Views implementation. |
55 virtual void OnMouseCaptureLost() OVERRIDE; | 55 virtual void OnMouseCaptureLost() override; |
56 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 56 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; |
57 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 57 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
58 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 58 virtual void OnMouseMoved(const ui::MouseEvent& event) override; |
59 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 59 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
60 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 60 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
61 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 61 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
62 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 62 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
63 | 63 |
64 // views::WidgetFocusChangeListener implementation. | 64 // views::WidgetFocusChangeListener implementation. |
65 virtual void OnNativeFocusChange(gfx::NativeView focused_before, | 65 virtual void OnNativeFocusChange(gfx::NativeView focused_before, |
66 gfx::NativeView focused_now) OVERRIDE; | 66 gfx::NativeView focused_now) override; |
67 | 67 |
68 // views::WidgetObserver implementation. | 68 // views::WidgetObserver implementation. |
69 virtual void OnWidgetBoundsChanged(views::Widget* widget, | 69 virtual void OnWidgetBoundsChanged(views::Widget* widget, |
70 const gfx::Rect& new_bounds) OVERRIDE; | 70 const gfx::Rect& new_bounds) override; |
71 | 71 |
72 // Stop observing the |observing_widget_|. | 72 // Stop observing the |observing_widget_|. |
73 void RemoveObserver(); | 73 void RemoveObserver(); |
74 | 74 |
75 void SetSelection(const gfx::Point& point); | 75 void SetSelection(const gfx::Point& point); |
76 void AcceptSelection(const gfx::Point& point); | 76 void AcceptSelection(const gfx::Point& point); |
77 void ClearSelection(); | 77 void ClearSelection(); |
78 | 78 |
79 // Hide the controller of this view. This assumes that doing so will | 79 // Hide the controller of this view. This assumes that doing so will |
80 // eventually hide this view in the process. | 80 // eventually hide this view in the process. |
81 void HideController(); | 81 void HideController(); |
82 | 82 |
83 // Must return the container view for this popup. | 83 // Must return the container view for this popup. |
84 gfx::NativeView container_view(); | 84 gfx::NativeView container_view(); |
85 | 85 |
86 // Controller for this popup. Weak reference. | 86 // Controller for this popup. Weak reference. |
87 AutofillPopupViewDelegate* delegate_; | 87 AutofillPopupViewDelegate* delegate_; |
88 | 88 |
89 // The widget that |this| observes. Weak reference. | 89 // The widget that |this| observes. Weak reference. |
90 views::Widget* observing_widget_; | 90 views::Widget* observing_widget_; |
91 | 91 |
92 base::WeakPtrFactory<AutofillPopupBaseView> weak_ptr_factory_; | 92 base::WeakPtrFactory<AutofillPopupBaseView> weak_ptr_factory_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(AutofillPopupBaseView); | 94 DISALLOW_COPY_AND_ASSIGN(AutofillPopupBaseView); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace autofill | 97 } // namespace autofill |
98 | 98 |
99 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ | 99 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_BASE_VIEW_H_ |
OLD | NEW |