OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 |
11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ | 11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ |
(...skipping 10 matching lines...) Expand all Loading... |
22 #if defined(OS_WIN) || defined(OS_LINUX) | 22 #if defined(OS_WIN) || defined(OS_LINUX) |
23 class AutocompleteEditViewWin; | 23 class AutocompleteEditViewWin; |
24 class AutocompleteEditModel; | 24 class AutocompleteEditModel; |
25 class Profile; | 25 class Profile; |
26 #endif | 26 #endif |
27 | 27 |
28 // An object in the browser UI can implement this interface to provide display | 28 // An object in the browser UI can implement this interface to provide display |
29 // bounds for the autocomplete popup view. | 29 // bounds for the autocomplete popup view. |
30 class AutocompletePopupPositioner { | 30 class AutocompletePopupPositioner { |
31 public: | 31 public: |
| 32 virtual ~AutocompletePopupPositioner() { } |
| 33 |
32 // Returns the bounds at which the popup should be shown, in screen | 34 // Returns the bounds at which the popup should be shown, in screen |
33 // coordinates. The height is ignored, since the popup is sized to its | 35 // coordinates. The height is ignored, since the popup is sized to its |
34 // contents automatically. | 36 // contents automatically. |
35 virtual gfx::Rect GetPopupBounds() const = 0; | 37 virtual gfx::Rect GetPopupBounds() const = 0; |
36 protected: | |
37 ~AutocompletePopupPositioner() {} | |
38 }; | 38 }; |
39 | 39 |
40 class AutocompletePopupView { | 40 class AutocompletePopupView { |
41 public: | 41 public: |
42 virtual ~AutocompletePopupView() {} | 42 virtual ~AutocompletePopupView() { } |
43 | 43 |
44 // Returns true if the popup is currently open. | 44 // Returns true if the popup is currently open. |
45 virtual bool IsOpen() const = 0; | 45 virtual bool IsOpen() const = 0; |
46 | 46 |
47 // Invalidates one line of the autocomplete popup. | 47 // Invalidates one line of the autocomplete popup. |
48 virtual void InvalidateLine(size_t line) = 0; | 48 virtual void InvalidateLine(size_t line) = 0; |
49 | 49 |
50 // Redraws the popup window to match any changes in the result set; this may | 50 // Redraws the popup window to match any changes in the result set; this may |
51 // mean opening or closing the window. | 51 // mean opening or closing the window. |
52 virtual void UpdatePopupAppearance() = 0; | 52 virtual void UpdatePopupAppearance() = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
66 static AutocompletePopupView* CreatePopupView( | 66 static AutocompletePopupView* CreatePopupView( |
67 const gfx::Font& font, | 67 const gfx::Font& font, |
68 AutocompleteEditView* edit_view, | 68 AutocompleteEditView* edit_view, |
69 AutocompleteEditModel* edit_model, | 69 AutocompleteEditModel* edit_model, |
70 Profile* profile, | 70 Profile* profile, |
71 AutocompletePopupPositioner* popup_positioner); | 71 AutocompletePopupPositioner* popup_positioner); |
72 #endif | 72 #endif |
73 }; | 73 }; |
74 | 74 |
75 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ | 75 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_H_ |
OLD | NEW |