| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ |
| 6 #define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ | 6 #define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ |
| 7 | 7 |
| 8 #include "views/widget/widget_gtk.h" | 8 #include "views/widget/widget_gtk.h" |
| 9 | 9 |
| 10 class AutocompleteEditView; | 10 class AutocompleteEditView; |
| 11 class AutocompletePopupContentsView; | 11 class AutocompletePopupContentsView; |
| 12 | 12 |
| 13 class AutocompletePopupGtk : public views::WidgetGtk { | 13 class AutocompletePopupGtk : public views::WidgetGtk { |
| 14 public: | 14 public: |
| 15 explicit AutocompletePopupGtk(AutocompletePopupContentsView* contents); | 15 explicit AutocompletePopupGtk(AutocompletePopupContentsView* contents); |
| 16 virtual ~AutocompletePopupGtk(); | 16 virtual ~AutocompletePopupGtk(); |
| 17 | 17 |
| 18 // Overridden from WidgetWin: |
| 19 virtual void Show(); |
| 20 virtual void Hide(); |
| 21 |
| 18 // Creates the popup and shows it for the first time. |edit_view| is the edit | 22 // Creates the popup and shows it for the first time. |edit_view| is the edit |
| 19 // that created us. | 23 // that created us. |
| 20 void Init(AutocompleteEditView* edit_view, views::View* contents); | 24 void Init(AutocompleteEditView* edit_view, views::View* contents); |
| 21 | 25 |
| 22 // Shows the popup and moves it to the right position. | |
| 23 void Show(); | |
| 24 | |
| 25 // Returns true if the popup is open. | 26 // Returns true if the popup is open. |
| 26 bool IsOpen() const; | 27 bool IsOpen() const; |
| 27 | 28 |
| 28 // Returns true if the popup has been created. | 29 // Returns true if the popup has been created. |
| 29 bool IsCreated() const; | 30 bool IsCreated() const; |
| 30 | 31 |
| 32 private: |
| 31 // Restack the popup window directly above the browser's toplevel window. | 33 // Restack the popup window directly above the browser's toplevel window. |
| 32 void StackWindow(); | 34 void StackWindow(); |
| 33 | 35 |
| 34 private: | |
| 35 AutocompletePopupContentsView* contents_; | 36 AutocompletePopupContentsView* contents_; |
| 36 AutocompleteEditView* edit_view_; | 37 AutocompleteEditView* edit_view_; |
| 37 | 38 |
| 39 bool is_open_; // Used only for sanity-checking. |
| 40 |
| 38 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupGtk); | 41 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupGtk); |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ | 44 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_GTK_H_ |
| OLD | NEW |