| 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 AutocompleteEditView; | 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(AutocompleteEditView* 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 const BubblePositioner* bubble_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 PaintUpdatesNow(); | 33 virtual void PaintUpdatesNow(); |
| 34 virtual AutocompletePopupModel* GetModel(); | 34 virtual AutocompletePopupModel* GetModel(); |
| 35 | 35 |
| 36 private: | 36 private: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 static gboolean HandleButtonReleaseThunk(GtkWidget* widget, | 68 static gboolean HandleButtonReleaseThunk(GtkWidget* widget, |
| 69 GdkEventButton* event, | 69 GdkEventButton* event, |
| 70 gpointer userdata) { | 70 gpointer userdata) { |
| 71 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> | 71 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> |
| 72 HandleButtonRelease(widget, event); | 72 HandleButtonRelease(widget, event); |
| 73 } | 73 } |
| 74 gboolean HandleButtonRelease(GtkWidget* widget, GdkEventButton* event); | 74 gboolean HandleButtonRelease(GtkWidget* widget, GdkEventButton* event); |
| 75 | 75 |
| 76 scoped_ptr<AutocompletePopupModel> model_; | 76 scoped_ptr<AutocompletePopupModel> model_; |
| 77 AutocompleteEditView* edit_view_; | 77 AutocompleteEditView* edit_view_; |
| 78 AutocompletePopupPositioner* popup_positioner_; | 78 const BubblePositioner* bubble_positioner_; |
| 79 | 79 |
| 80 // Our popup window, which is the only widget used, and we paint it on our | 80 // Our popup window, which is the only widget used, and we paint it on our |
| 81 // own. This widget shouldn't be exposed outside of this class. | 81 // own. This widget shouldn't be exposed outside of this class. |
| 82 GtkWidget* window_; | 82 GtkWidget* window_; |
| 83 // The pango layout object created from the window, cached across exposes. | 83 // The pango layout object created from the window, cached across exposes. |
| 84 PangoLayout* layout_; | 84 PangoLayout* layout_; |
| 85 | 85 |
| 86 // Whether our popup is currently open / shown, or closed / hidden. | 86 // Whether our popup is currently open / shown, or closed / hidden. |
| 87 bool opened_; | 87 bool opened_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); | 89 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ | 92 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ |
| OLD | NEW |