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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.h

Issue 2727233003: Uses child views in Autofill Popup so we can trigger (Closed)
Patch Set: Combines 2 calls to InvalidateRow to 1 OnSelectedRowChanged call. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.h
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
index e3332b51f00d49f50a74b5c06df29046052c63ae..ba73aee3cd73f66cc020c11e56d61bb69cac06b1 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
#include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
#include "chrome/browser/ui/autofill/popup_controller_common.h"
+#include "ui/accessibility/ax_enums.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/native_theme/native_theme.h"
@@ -72,11 +73,9 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
~AutofillPopupControllerImpl() override;
// AutofillPopupViewDelegate implementation.
- void UpdateBoundsAndRedrawPopup() override;
void SetSelectionAtPoint(const gfx::Point& point) override;
bool AcceptSelectedLine() override;
void SelectionCleared() override;
- void AcceptSuggestion(size_t index) override;
gfx::Rect popup_bounds() const override;
gfx::NativeView container_view() override;
const gfx::RectF& element_bounds() const override;
@@ -88,6 +87,8 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
#endif
// AutofillPopupController implementation.
+ void OnSuggestionsChanged() override;
+ void AcceptSuggestion(size_t index) override;
size_t GetLineCount() const override;
const autofill::Suggestion& GetSuggestionAt(size_t row) const override;
const base::string16& GetElidedValueAt(size_t row) const override;
@@ -126,10 +127,6 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
AutofillPopupView* view() { return view_; }
- // |view_| pass throughs (virtual for testing).
- virtual void ShowView();
- virtual void InvalidateRow(size_t row);
-
base::WeakPtr<AutofillPopupControllerImpl> GetWeakPtr();
// Contains common popup functionality such as popup layout. Protected for
@@ -139,7 +136,6 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
private:
#if !defined(OS_ANDROID)
FRIEND_TEST_ALL_PREFIXES(AutofillPopupControllerUnitTest, ElideText);
-
// Helper method which elides the value and label for the suggestion at |row|
// given the |available_width|. Puts the results in |elided_values_| and
// |elided_labels_|.
@@ -150,6 +146,9 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
// when the popup is reused it doesn't leak values between uses.
void ClearState();
+ friend class AutofillPopupControllerUnitTest;
+ void SetViewForTesting(AutofillPopupView* view) { view_ = view; }
+
AutofillPopupView* view_; // Weak reference.
AutofillPopupLayoutModel layout_model_;
base::WeakPtr<AutofillPopupDelegate> delegate_;
@@ -166,7 +165,8 @@ class AutofillPopupControllerImpl : public AutofillPopupController {
std::vector<base::string16> elided_labels_;
// The line that is currently selected by the user.
- // |kNoSelection| indicates that no line is currently selected.
+ // |AutofillPopupView::kNoSelection| indicates that no line is currently
+ // selected.
int selected_line_;
base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698