OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines the interface class AutocompletePopupView. Each toolkit | 5 // This file defines the interface class AutocompletePopupView. Each toolkit |
6 // will implement the popup view differently, so that code is inheriently | 6 // will implement the popup view differently, so that code is inheriently |
7 // platform specific. However, the AutocompletePopupModel needs to do some | 7 // platform specific. However, the AutocompletePopupModel needs to do some |
8 // communication with the view. Since the model is shared between platforms, | 8 // communication with the view. Since the model is shared between platforms, |
9 // we need to define an interface that all view implementations will share. | 9 // we need to define an interface that all view implementations will share. |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Returns true if the popup is currently open. | 23 // Returns true if the popup is currently open. |
24 virtual bool IsOpen() const = 0; | 24 virtual bool IsOpen() const = 0; |
25 | 25 |
26 // Invalidates one line of the autocomplete popup. | 26 // Invalidates one line of the autocomplete popup. |
27 virtual void InvalidateLine(size_t line) = 0; | 27 virtual void InvalidateLine(size_t line) = 0; |
28 | 28 |
29 // Redraws the popup window to match any changes in the result set; this may | 29 // Redraws the popup window to match any changes in the result set; this may |
30 // mean opening or closing the window. | 30 // mean opening or closing the window. |
31 virtual void UpdatePopupAppearance() = 0; | 31 virtual void UpdatePopupAppearance() = 0; |
32 | 32 |
| 33 #if defined(TOOLKIT_VIEWS) |
| 34 // Returns the target bounds for the popup. This returns the popup's current |
| 35 // bounds when not animating, or the desired target bounds when animating. |
| 36 // The return value is in screen coordinates. |
| 37 virtual gfx::Rect GetTargetBounds() = 0; |
| 38 #endif |
| 39 |
33 // Paint any pending updates. | 40 // Paint any pending updates. |
34 virtual void PaintUpdatesNow() = 0; | 41 virtual void PaintUpdatesNow() = 0; |
35 | 42 |
36 // This method is called when the view should cancel any active drag (e.g. | 43 // This method is called when the view should cancel any active drag (e.g. |
37 // because the user pressed ESC). The view may or may not need to take any | 44 // because the user pressed ESC). The view may or may not need to take any |
38 // action (e.g. releasing mouse capture). Note that this can be called when | 45 // action (e.g. releasing mouse capture). Note that this can be called when |
39 // no drag is in progress. | 46 // no drag is in progress. |
40 virtual void OnDragCanceled() = 0; | 47 virtual void OnDragCanceled() = 0; |
41 | 48 |
42 // Returns the popup's model. | 49 // Returns the popup's model. |
43 virtual AutocompletePopupModel* GetModel() = 0; | 50 virtual AutocompletePopupModel* GetModel() = 0; |
44 | 51 |
45 // Returns the max y coordinate of the popup in screen coordinates. | 52 // Returns the max y coordinate of the popup in screen coordinates. |
46 virtual int GetMaxYCoordinate() = 0; | 53 virtual int GetMaxYCoordinate() = 0; |
47 }; | 54 }; |
48 | 55 |
49 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ | 56 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ |
OLD | NEW |