Chromium Code Reviews| 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_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 // Returns true if the popup still has non-options entries to show the user. | 121 // Returns true if the popup still has non-options entries to show the user. |
| 122 bool HasSuggestions(); | 122 bool HasSuggestions(); |
| 123 | 123 |
| 124 AutofillPopupView* view() { return view_; } | 124 AutofillPopupView* view() { return view_; } |
| 125 | 125 |
| 126 // |view_| pass throughs (virtual for testing). | 126 // |view_| pass throughs (virtual for testing). |
| 127 virtual void ShowView(); | 127 virtual void ShowView(); |
| 128 virtual void InvalidateRow(size_t row); | 128 virtual void InvalidateRow(size_t row); |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 // Calculate the width of the row, excluding all the text. This provides | |
| 132 // the size of the row that won't be reducible (since all the text can be | |
| 133 // elided if there isn't enough space). | |
| 134 int RowWidthWithoutText(int row); | |
| 135 | |
| 136 // Calculates and sets the width of the popup based on the data to be shown, | |
| 137 // the screen size and position of the popup (virtual for testing). | |
| 138 virtual int CalculateAndSetPopupWidth(); | |
|
Ilya Sherman
2013/01/11 23:05:35
IMO the code would be cleaner if this either retur
csharp
2013/01/14 20:32:33
Done.
| |
| 139 | |
| 131 AutofillPopupView* view_; // Weak reference. | 140 AutofillPopupView* view_; // Weak reference. |
| 132 AutofillPopupDelegate* delegate_; // Weak reference. | 141 AutofillPopupDelegate* delegate_; // Weak reference. |
| 133 gfx::NativeView container_view_; // Weak reference. | 142 gfx::NativeView container_view_; // Weak reference. |
| 134 | 143 |
| 135 // The bounds of the text element that is the focus of the Autofill. | 144 // The bounds of the text element that is the focus of the Autofill. |
| 136 // These coordinates are in screen space. | 145 // These coordinates are in screen space. |
| 137 const gfx::Rect element_bounds_; | 146 const gfx::Rect element_bounds_; |
| 138 | 147 |
| 139 // The bounds of the Autofill popup. | 148 // The bounds of the Autofill popup. |
| 140 gfx::Rect popup_bounds_; | 149 gfx::Rect popup_bounds_; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 159 bool delete_icon_hovered_; | 168 bool delete_icon_hovered_; |
| 160 | 169 |
| 161 // True if |HideInternal| has already been called. | 170 // True if |HideInternal| has already been called. |
| 162 bool is_hiding_; | 171 bool is_hiding_; |
| 163 | 172 |
| 164 // True if the delegate should be informed when |this| is destroyed. | 173 // True if the delegate should be informed when |this| is destroyed. |
| 165 bool inform_delegate_of_destruction_; | 174 bool inform_delegate_of_destruction_; |
| 166 }; | 175 }; |
| 167 | 176 |
| 168 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 177 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| OLD | NEW |