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/optional.h" |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" | 12 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
12 | 13 |
13 namespace autofill { | 14 namespace autofill { |
14 | 15 |
15 class AutofillPopupController; | 16 class AutofillPopupController; |
16 | 17 |
17 // The interface for creating and controlling a platform-dependent | 18 // The interface for creating and controlling a platform-dependent |
18 // AutofillPopupView. | 19 // AutofillPopupView. |
19 class AutofillPopupView { | 20 class AutofillPopupView { |
20 public: | 21 public: |
21 // Displays the Autofill popup and fills it in with data from the controller. | 22 // Displays the Autofill popup and fills it in with data from the controller. |
22 virtual void Show() = 0; | 23 virtual void Show() = 0; |
23 | 24 |
24 // Hides the popup from view. This will cause the popup to be deleted. | 25 // Hides the popup from view. This will cause the popup to be deleted. |
25 virtual void Hide() = 0; | 26 virtual void Hide() = 0; |
26 | 27 |
27 // Invalidates the given row and redraw it. | 28 // If not null, invalidates the given rows and redraws them. |
28 virtual void InvalidateRow(size_t row) = 0; | 29 virtual void OnSelectedRowChanged( |
| 30 base::Optional<int> previous_row_selection, |
| 31 base::Optional<int> current_row_selection) = 0; |
29 | 32 |
30 // Refreshes the position of the popup. | 33 // Refreshes the position and redraws popup when suggestions change. |
31 virtual void UpdateBoundsAndRedrawPopup() = 0; | 34 virtual void OnSuggestionsChanged() = 0; |
32 | 35 |
33 // Factory function for creating the view. | 36 // Factory function for creating the view. |
34 static AutofillPopupView* Create(AutofillPopupController* controller); | 37 static AutofillPopupView* Create(AutofillPopupController* controller); |
35 | 38 |
36 protected: | 39 protected: |
37 virtual ~AutofillPopupView() {} | 40 virtual ~AutofillPopupView() {} |
38 }; | 41 }; |
39 | 42 |
40 } // namespace autofill | 43 } // namespace autofill |
41 | 44 |
42 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 45 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
OLD | NEW |