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_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include "base/strings/string16.h" |
| 11 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
| 12 #include "chrome/browser/ui/autofill/popup_view_utils.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
10 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
11 | 15 |
12 namespace gfx { | 16 namespace gfx { |
13 class Rect; | 17 class Display; |
| 18 class Point; |
14 } | 19 } |
15 | 20 |
16 namespace ui { | 21 namespace ui { |
17 class KeyEvent; | 22 class KeyEvent; |
18 } | 23 } |
19 | 24 |
20 namespace autofill { | 25 namespace autofill { |
21 | 26 |
22 class AutofillPopupController; | 27 class AutofillPopupController; |
23 | 28 |
(...skipping 22 matching lines...) Expand all Loading... |
46 | 51 |
47 // Hides the popup from view. This will cause the popup to be deleted. | 52 // Hides the popup from view. This will cause the popup to be deleted. |
48 virtual void Hide() = 0; | 53 virtual void Hide() = 0; |
49 | 54 |
50 // Invalidates the given row and redraw it. | 55 // Invalidates the given row and redraw it. |
51 virtual void InvalidateRow(size_t row) = 0; | 56 virtual void InvalidateRow(size_t row) = 0; |
52 | 57 |
53 // Refreshes the position of the popup. | 58 // Refreshes the position of the popup. |
54 virtual void UpdateBoundsAndRedrawPopup() = 0; | 59 virtual void UpdateBoundsAndRedrawPopup() = 0; |
55 | 60 |
| 61 #if !defined(OS_ANDROID) |
| 62 // Simply updates the popup bounds and doesn't redraw. |
| 63 virtual void UpdatePopupBounds() = 0; |
| 64 |
| 65 // Get the available space for the total text width. |with_label| indicates |
| 66 // whether a label is expected to be present. |
| 67 virtual int GetAvailableWidthForRow(int row, bool with_label) = 0; |
| 68 #endif |
| 69 |
| 70 // Convert a y-coordinate to the closest line. |
| 71 virtual int LineFromY(int y) = 0; |
| 72 |
| 73 virtual gfx::Rect GetPopupBounds() = 0; |
| 74 |
56 // Factory function for creating the view. | 75 // Factory function for creating the view. |
57 static AutofillPopupView* Create(AutofillPopupController* controller); | 76 static AutofillPopupView* Create(AutofillPopupController* controller); |
58 | 77 |
59 protected: | 78 protected: |
60 virtual ~AutofillPopupView() {} | 79 virtual ~AutofillPopupView() {} |
61 }; | 80 }; |
62 | 81 |
63 } // namespace autofill | 82 } // namespace autofill |
64 | 83 |
65 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 84 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
OLD | NEW |