| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" | 12 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" |
| 13 #include "webkit/glue/window_open_disposition.h" | 13 #include "webkit/glue/window_open_disposition.h" |
| 14 | 14 |
| 15 class AutocompleteEditModel; | 15 class AutocompleteEditModel; |
| 16 class AutocompleteEditViewGtk; | 16 class AutocompleteEditView; |
| 17 class AutocompletePopupModel; | 17 class AutocompletePopupModel; |
| 18 class Profile; | 18 class Profile; |
| 19 class SkBitmap; | 19 class SkBitmap; |
| 20 | 20 |
| 21 class AutocompletePopupViewGtk : public AutocompletePopupView { | 21 class AutocompletePopupViewGtk : public AutocompletePopupView { |
| 22 public: | 22 public: |
| 23 AutocompletePopupViewGtk(AutocompleteEditViewGtk* edit_view, | 23 AutocompletePopupViewGtk(AutocompleteEditView* edit_view, |
| 24 AutocompleteEditModel* edit_model, | 24 AutocompleteEditModel* edit_model, |
| 25 Profile* profile, | 25 Profile* profile, |
| 26 AutocompletePopupPositioner* popup_positioner); | 26 AutocompletePopupPositioner* popup_positioner); |
| 27 ~AutocompletePopupViewGtk(); | 27 ~AutocompletePopupViewGtk(); |
| 28 | 28 |
| 29 // Implement the AutocompletePopupView interface. | 29 // Implement the AutocompletePopupView interface. |
| 30 virtual bool IsOpen() const { return opened_; } | 30 virtual bool IsOpen() const { return opened_; } |
| 31 virtual void InvalidateLine(size_t line); | 31 virtual void InvalidateLine(size_t line); |
| 32 virtual void UpdatePopupAppearance(); | 32 virtual void UpdatePopupAppearance(); |
| 33 virtual void OnHoverEnabledOrDisabled(bool disabled); | 33 virtual void OnHoverEnabledOrDisabled(bool disabled); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 static gboolean HandleButtonReleaseThunk(GtkWidget* widget, | 69 static gboolean HandleButtonReleaseThunk(GtkWidget* widget, |
| 70 GdkEventButton* event, | 70 GdkEventButton* event, |
| 71 gpointer userdata) { | 71 gpointer userdata) { |
| 72 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> | 72 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> |
| 73 HandleButtonRelease(widget, event); | 73 HandleButtonRelease(widget, event); |
| 74 } | 74 } |
| 75 gboolean HandleButtonRelease(GtkWidget* widget, GdkEventButton* event); | 75 gboolean HandleButtonRelease(GtkWidget* widget, GdkEventButton* event); |
| 76 | 76 |
| 77 scoped_ptr<AutocompletePopupModel> model_; | 77 scoped_ptr<AutocompletePopupModel> model_; |
| 78 AutocompleteEditViewGtk* edit_view_; | 78 AutocompleteEditView* edit_view_; |
| 79 AutocompletePopupPositioner* popup_positioner_; | 79 AutocompletePopupPositioner* popup_positioner_; |
| 80 | 80 |
| 81 // Our popup window, which is the only widget used, and we paint it on our | 81 // Our popup window, which is the only widget used, and we paint it on our |
| 82 // own. This widget shouldn't be exposed outside of this class. | 82 // own. This widget shouldn't be exposed outside of this class. |
| 83 GtkWidget* window_; | 83 GtkWidget* window_; |
| 84 // The pango layout object created from the window, cached across exposes. | 84 // The pango layout object created from the window, cached across exposes. |
| 85 PangoLayout* layout_; | 85 PangoLayout* layout_; |
| 86 | 86 |
| 87 // Whether our popup is currently open / shown, or closed / hidden. | 87 // Whether our popup is currently open / shown, or closed / hidden. |
| 88 bool opened_; | 88 bool opened_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); | 90 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ | 93 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ |
| OLD | NEW |