| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/string16.h" | |
| 12 #include "chrome/browser/autofill/autofill_popup_view.h" | 11 #include "chrome/browser/autofill/autofill_popup_view.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" | 12 #include "ui/base/gtk/gtk_signal.h" |
| 14 | 13 #include "ui/gfx/font.h" |
| 15 #include <vector> | 14 #include "ui/gfx/rect.h" |
| 16 | 15 |
| 17 class AutofillPopupViewGtk : public AutofillPopupView { | 16 class AutofillPopupViewGtk : public AutofillPopupView { |
| 18 public: | 17 public: |
| 19 AutofillPopupViewGtk(content::WebContents* web_contents, GtkWidget* parent); | 18 AutofillPopupViewGtk(content::WebContents* web_contents, |
| 19 GtkWidget* parent); |
| 20 virtual ~AutofillPopupViewGtk(); | 20 virtual ~AutofillPopupViewGtk(); |
| 21 | 21 |
| 22 // AutofillPopupView implementations. | 22 // AutofillPopupView implementations. |
| 23 virtual void Hide() OVERRIDE; | 23 virtual void Hide() OVERRIDE; |
| 24 virtual void Show(const std::vector<string16>& autofill_values, | 24 virtual void ShowInternal( |
| 25 const std::vector<string16>& autofill_labels, | 25 const std::vector<string16>& autofill_values, |
| 26 const std::vector<string16>& autofill_icons, | 26 const std::vector<string16>& autofill_labels, |
| 27 const std::vector<int>& autofill_unique_ids, | 27 const std::vector<string16>& autofill_icons) OVERRIDE; |
| 28 int separator_index) OVERRIDE; | |
| 29 | 28 |
| 30 private: | 29 private: |
| 31 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleExpose, | 30 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleExpose, |
| 32 GdkEventExpose*); | 31 GdkEventExpose*); |
| 33 | 32 |
| 33 void PaintUpdatesNow(); |
| 34 |
| 35 // Setup the pango layout to display the autofill results. |
| 36 void SetupLayout(const gfx::Rect& window_rect, const GdkColor* text_color); |
| 37 |
| 34 GtkWidget* parent_; // Weak reference. | 38 GtkWidget* parent_; // Weak reference. |
| 35 GtkWidget* window_; // Strong refence. | 39 GtkWidget* window_; // Strong reference. |
| 40 PangoLayout* layout_; // Strong reference |
| 41 gfx::Font font_; |
| 42 |
| 43 // The height of each individual autofill popup row. |
| 44 int row_height_; |
| 36 }; | 45 }; |
| 37 | 46 |
| 38 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ | 47 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ |
| OLD | NEW |