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 2f67f45093d68d644043654875dd2212e0f1f846..40d17ddc58cc92523de8da9a280dfb7b9add32d5 100644 |
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h |
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h |
@@ -76,14 +76,17 @@ class AutofillPopupControllerImpl : public AutofillPopupController { |
bool AcceptSelectedLine() override; |
void SelectionCleared() override; |
void AcceptSuggestion(size_t index) override; |
- int GetIconResourceID(const base::string16& resource_name) const override; |
bool IsWarning(size_t index) const override; |
- gfx::Rect GetRowBounds(size_t index) override; |
- const gfx::Rect& popup_bounds() const override; |
+ |
Evan Stade
2016/01/09 00:19:02
?
Mathieu
2016/01/11 18:33:11
Done.
|
+ gfx::Rect popup_bounds() const override; |
gfx::NativeView container_view() override; |
const gfx::RectF& element_bounds() const override; |
bool IsRTL() const override; |
- |
+ const std::vector<autofill::Suggestion> GetSuggestions() override; |
+#if !defined(OS_ANDROID) |
Evan Stade
2016/01/09 00:19:02
this will need to be !BUILDFLAG(ANDROID_JAVA_UI)
Mathieu
2016/01/11 18:33:11
I would rather punt this to a subsequent CL becaus
|
+ int GetElidedValueWidthForRow(size_t row) override; |
+ int GetElidedLabelWidthForRow(size_t row) override; |
+#endif |
size_t GetLineCount() const override; |
const autofill::Suggestion& GetSuggestionAt(size_t row) const override; |
const base::string16& GetElidedValueAt(size_t row) const override; |
@@ -112,12 +115,6 @@ class AutofillPopupControllerImpl : public AutofillPopupController { |
// The user has removed a suggestion. |
bool RemoveSelectedLine(); |
- // Convert a y-coordinate to the closest line. |
- int LineFromY(int y); |
- |
- // Returns the height of a row depending on its type. |
- int GetRowHeightFromId(int identifier) const; |
- |
// Returns true if the given id refers to an element that can be accepted. |
bool CanAccept(int id); |
@@ -134,20 +131,6 @@ class AutofillPopupControllerImpl : public AutofillPopupController { |
virtual void ShowView(); |
virtual void InvalidateRow(size_t row); |
- // Protected so tests can access. |
-#if !defined(OS_ANDROID) |
- // Calculates the desired width of the popup based on its contents. |
- int GetDesiredPopupWidth() const; |
- |
- // Calculates the desired height of the popup based on its contents. |
- int GetDesiredPopupHeight() const; |
- |
- // Calculate the width of the row, excluding all the text. This provides |
- // the size of the row that won't be reducible (since all the text can be |
- // elided if there isn't enough space). |
- int RowWidthWithoutText(int row) const; |
-#endif |
- |
base::WeakPtr<AutofillPopupControllerImpl> GetWeakPtr(); |
// Contains common popup functionality such as popup layout. Protected for |
@@ -155,22 +138,22 @@ class AutofillPopupControllerImpl : public AutofillPopupController { |
scoped_ptr<PopupControllerCommon> controller_common_; |
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_|. |
+ void ElideValueAndLabelForRow(size_t row, int available_width); |
+#endif |
+ |
// Clear the internal state of the controller. This is needed to ensure that |
// when the popup is reused it doesn't leak values between uses. |
void ClearState(); |
-#if !defined(OS_ANDROID) |
- // Calculates and sets the bounds of the popup, including placing it properly |
- // to prevent it from going off the screen. |
- void UpdatePopupBounds(); |
-#endif |
- |
AutofillPopupView* view_; // Weak reference. |
base::WeakPtr<AutofillPopupDelegate> delegate_; |
- // The bounds of the Autofill popup. |
- gfx::Rect popup_bounds_; |
- |
// The text direction of the popup. |
base::i18n::TextDirection text_direction_; |