Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller.h

Issue 2727233003: Uses child views in Autofill Popup so we can trigger (Closed)
Patch Set: (int) to NSInteger Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/optional.h"
13 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" 16 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
16 #include "third_party/skia/include/core/SkColor.h" 17 #include "third_party/skia/include/core/SkColor.h"
17 #include "ui/native_theme/native_theme.h" 18 #include "ui/native_theme/native_theme.h"
18 19
19 namespace autofill { 20 namespace autofill {
20 21
21 class AutofillPopupLayoutModel; 22 class AutofillPopupLayoutModel;
22 struct Suggestion; 23 struct Suggestion;
23 24
24 // This interface provides data to an AutofillPopupView. 25 // This interface provides data to an AutofillPopupView.
25 class AutofillPopupController : public AutofillPopupViewDelegate { 26 class AutofillPopupController : public AutofillPopupViewDelegate {
26 public: 27 public:
27 // Recalculates the height and width of the popup and triggers a redraw. 28 // Recalculates the height and width of the popup and triggers a redraw when
28 virtual void UpdateBoundsAndRedrawPopup() = 0; 29 // suggestions change.
30 virtual void OnSuggestionsChanged() = 0;
29 31
30 // Accepts the suggestion at |index|. 32 // Accepts the suggestion at |index|.
31 virtual void AcceptSuggestion(size_t index) = 0; 33 virtual void AcceptSuggestion(int index) = 0;
32 34
33 // Returns the number of lines of data that there are. 35 // Returns the number of lines of data that there are.
34 virtual size_t GetLineCount() const = 0; 36 virtual int GetLineCount() const = 0;
35 37
36 // Returns the suggestion or pre-elided string at the given row index. 38 // Returns the suggestion or pre-elided string at the given row index.
37 virtual const autofill::Suggestion& GetSuggestionAt(size_t row) const = 0; 39 virtual const autofill::Suggestion& GetSuggestionAt(int row) const = 0;
38 virtual const base::string16& GetElidedValueAt(size_t row) const = 0; 40 virtual const base::string16& GetElidedValueAt(int row) const = 0;
39 virtual const base::string16& GetElidedLabelAt(size_t row) const = 0; 41 virtual const base::string16& GetElidedLabelAt(int row) const = 0;
40 42
41 // Returns whether the item at |list_index| can be removed. If so, fills 43 // Returns whether the item at |list_index| can be removed. If so, fills
42 // out |title| and |body| (when non-null) with relevant user-facing text. 44 // out |title| and |body| (when non-null) with relevant user-facing text.
43 virtual bool GetRemovalConfirmationText(int index, 45 virtual bool GetRemovalConfirmationText(int index,
44 base::string16* title, 46 base::string16* title,
45 base::string16* body) = 0; 47 base::string16* body) = 0;
46 48
47 // Removes the suggestion at the given index. 49 // Removes the suggestion at the given index.
48 virtual bool RemoveSuggestion(int index) = 0; 50 virtual bool RemoveSuggestion(int index) = 0;
49 51
50 // Returns the background color ID of the row item according to its |index|, 52 // Returns the background color ID of the row item according to its |index|,
51 // or default popup background otherwise. 53 // or default popup background otherwise.
52 virtual ui::NativeTheme::ColorId GetBackgroundColorIDForRow( 54 virtual ui::NativeTheme::ColorId GetBackgroundColorIDForRow(
53 int index) const = 0; 55 int index) const = 0;
54 56
55 // Returns the index of the selected line. A line is "selected" when it is 57 // Returns the index of the selected line. A line is "selected" when it is
56 // hovered or has keyboard focus. 58 // hovered or has keyboard focus.
57 virtual int selected_line() const = 0; 59 virtual base::Optional<int> selected_line() const = 0;
58 60
59 virtual const AutofillPopupLayoutModel& layout_model() const = 0; 61 virtual const AutofillPopupLayoutModel& layout_model() const = 0;
60 62
61 protected: 63 protected:
62 ~AutofillPopupController() override {} 64 ~AutofillPopupController() override {}
63 }; 65 };
64 66
65 } // namespace autofill 67 } // namespace autofill
66 68
67 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_ 69 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698