| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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: |
| 37 void Show(size_t num_results); | 37 void Show(size_t num_results); |
| 38 void Hide(); | 38 void Hide(); |
| 39 | 39 |
| 40 // Restack the popup window directly above the browser's toplevel window. |
| 41 void StackWindow(); |
| 42 |
| 40 // Convert a y-coordinate to the closest line / result. | 43 // Convert a y-coordinate to the closest line / result. |
| 41 size_t LineFromY(int y); | 44 size_t LineFromY(int y); |
| 42 | 45 |
| 43 // Accept a line of the results, for example, when the user clicks a line. | 46 // Accept a line of the results, for example, when the user clicks a line. |
| 44 void AcceptLine(size_t line, WindowOpenDisposition disposition); | 47 void AcceptLine(size_t line, WindowOpenDisposition disposition); |
| 45 | 48 |
| 46 static gboolean HandleExposeThunk(GtkWidget* widget, GdkEventExpose* event, | 49 static gboolean HandleExposeThunk(GtkWidget* widget, GdkEventExpose* event, |
| 47 gpointer userdata) { | 50 gpointer userdata) { |
| 48 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> | 51 return reinterpret_cast<AutocompletePopupViewGtk*>(userdata)-> |
| 49 HandleExpose(widget, event); | 52 HandleExpose(widget, event); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // The pango layout object created from the window, cached across exposes. | 86 // The pango layout object created from the window, cached across exposes. |
| 84 PangoLayout* layout_; | 87 PangoLayout* layout_; |
| 85 | 88 |
| 86 // Whether our popup is currently open / shown, or closed / hidden. | 89 // Whether our popup is currently open / shown, or closed / hidden. |
| 87 bool opened_; | 90 bool opened_; |
| 88 | 91 |
| 89 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); | 92 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewGtk); |
| 90 }; | 93 }; |
| 91 | 94 |
| 92 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ | 95 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ |
| OLD | NEW |