Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h

Issue 9235072: Adding Mouse Support for new GTK Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <pango/pango.h> 9 #include <pango/pango.h>
10 10
11 #include "chrome/browser/autofill/autofill_popup_view.h" 11 #include "chrome/browser/autofill/autofill_popup_view.h"
12 #include "ui/base/glib/glib_integers.h" 12 #include "ui/base/glib/glib_integers.h"
13 #include "ui/base/gtk/gtk_signal.h" 13 #include "ui/base/gtk/gtk_signal.h"
14 #include "ui/gfx/font.h" 14 #include "ui/gfx/font.h"
15 15
16 namespace gfx { 16 namespace gfx {
17 class Rect; 17 class Rect;
18 } 18 }
19 19
20 typedef struct _GdkEventButton GdkEventButton;
20 typedef struct _GdkEventExpose GdkEventExpose; 21 typedef struct _GdkEventExpose GdkEventExpose;
22 typedef struct _GdkEventMotion GdkEventMotion;
21 typedef struct _GdkColor GdkColor; 23 typedef struct _GdkColor GdkColor;
22 typedef struct _GtkWidget GtkWidget; 24 typedef struct _GtkWidget GtkWidget;
23 25
24 class AutofillPopupViewGtk : public AutofillPopupView { 26 class AutofillPopupViewGtk : public AutofillPopupView {
25 public: 27 public:
26 AutofillPopupViewGtk(content::WebContents* web_contents, GtkWidget* parent); 28 AutofillPopupViewGtk(content::WebContents* web_contents,
29 AutofillExternalDelegate* external_delegate,
30 GtkWidget* parent);
27 virtual ~AutofillPopupViewGtk(); 31 virtual ~AutofillPopupViewGtk();
28 32
29 // AutofillPopupView implementations. 33 // AutofillPopupView implementations.
30 virtual void Hide() OVERRIDE; 34 virtual void Hide() OVERRIDE;
35
36 protected:
37 // AutofillPopupView implementations.
31 virtual void ShowInternal() OVERRIDE; 38 virtual void ShowInternal() OVERRIDE;
39 virtual void InvalidateRow(size_t row) OVERRIDE;
32 40
33 private: 41 private:
42 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleButtonRelease,
43 GdkEventButton*);
34 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleExpose, 44 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleExpose,
35 GdkEventExpose*); 45 GdkEventExpose*);
46 CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleMotion,
47 GdkEventMotion*);
36 48
37 // Setup the pango layout to display the autofill results. 49 // Setup the pango layout to display the autofill results.
38 void SetupLayout(const gfx::Rect& window_rect, const GdkColor& text_color); 50 void SetupLayout(const gfx::Rect& window_rect, const GdkColor& text_color);
39 51
52 // Convert a y-coordinate to the closest line.
53 size_t LineFromY(int y);
54
40 GtkWidget* parent_; // Weak reference. 55 GtkWidget* parent_; // Weak reference.
41 GtkWidget* window_; // Strong reference. 56 GtkWidget* window_; // Strong reference.
42 PangoLayout* layout_; // Strong reference 57 PangoLayout* layout_; // Strong reference
43 gfx::Font font_; 58 gfx::Font font_;
44 59
45 // The height of each individual Autofill popup row. 60 // The height of each individual Autofill popup row.
46 int row_height_; 61 int row_height_;
62
63 // The size of the popup.
64 gfx::Rect bounds;
47 }; 65 };
48 66
49 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_ 67 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698