OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 11 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
12 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" | 12 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" |
| 13 #include "ui/views/view.h" |
13 | 14 |
14 namespace autofill { | 15 namespace autofill { |
15 | 16 |
16 class AutofillPopupController; | 17 class AutofillPopupController; |
17 | 18 |
18 // Views toolkit implementation for AutofillPopupView. | 19 // Views toolkit implementation for AutofillPopupView. |
19 class AutofillPopupViewViews : public AutofillPopupBaseView, | 20 class AutofillPopupViewViews : public AutofillPopupBaseView, |
20 public AutofillPopupView { | 21 public AutofillPopupView { |
21 public: | 22 public: |
22 AutofillPopupViewViews(AutofillPopupController* controller, | 23 AutofillPopupViewViews(AutofillPopupController* controller, |
23 views::Widget* parent_widget); | 24 views::Widget* parent_widget); |
24 | 25 |
25 private: | 26 private: |
26 ~AutofillPopupViewViews() override; | 27 ~AutofillPopupViewViews() override; |
27 | 28 |
28 // AutofillPopupView implementation. | 29 // AutofillPopupView implementation. |
29 void Show() override; | 30 void Show() override; |
30 void Hide() override; | 31 void Hide() override; |
31 void InvalidateRow(size_t row) override; | 32 void InvalidateRow(size_t row) override; |
32 void UpdateBoundsAndRedrawPopup() override; | 33 void UpdateBoundsAndRedrawPopup() override; |
33 | 34 |
34 // views::Views implementation | 35 // views::Views implementation |
35 void OnPaint(gfx::Canvas* canvas) override; | 36 void OnPaint(gfx::Canvas* canvas) override; |
| 37 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 38 |
| 39 AutofillPopupController* controller_; // Weak reference. |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewViews); |
| 42 }; |
| 43 |
| 44 class AutofillPopupChildView : public views::View { |
| 45 public: |
| 46 AutofillPopupChildView(AutofillPopupController* controller, |
| 47 size_t index) |
| 48 : controller_(controller), index_(index) {} |
| 49 |
| 50 // views::Views implementation |
| 51 void OnPaint(gfx::Canvas* canvas) override; |
36 | 52 |
| 53 void clear_controller() { controller_ = NULL; } |
| 54 |
| 55 private: |
| 56 ~AutofillPopupChildView() override; |
| 57 |
| 58 // views::Views implementation |
| 59 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 60 |
37 // Draw the given autofill entry in |entry_rect|. | 61 // Draw the given autofill entry in |entry_rect|. |
38 void DrawAutofillEntry(gfx::Canvas* canvas, | 62 void DrawAutofillEntry(gfx::Canvas* canvas, |
39 int index, | 63 int index, |
40 const gfx::Rect& entry_rect); | 64 const gfx::Rect& entry_rect); |
41 | 65 |
42 AutofillPopupController* controller_; // Weak reference. | 66 AutofillPopupController* controller_; // Weak reference. |
43 | 67 const size_t index_; |
44 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewViews); | |
45 }; | 68 }; |
46 | 69 |
47 } // namespace autofill | 70 } // namespace autofill |
48 | 71 |
49 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_ | 72 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_POPUP_VIEW_VIEWS_H_ |
OLD | NEW |