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

Unified Diff: chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h

Issue 9432029: GTK Keyboard Support for New Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Using keyboard listener to get keypresses Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h
diff --git a/chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h b/chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h
index 999dd4696dc092bde778463b551e1086e0d9b12e..be26ada4b4b270e13ab3045df3b880372a20c6df 100644
--- a/chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h
+++ b/chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h
@@ -9,32 +9,42 @@
#include <pango/pango.h>
#include "chrome/browser/autofill/autofill_popup_view.h"
+#include "content/public/browser/keyboard_listener.h"
#include "ui/base/glib/glib_integers.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/gfx/font.h"
+namespace content {
+class RenderViewHost;
+}
+
namespace gfx {
class Rect;
}
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GdkEventExpose GdkEventExpose;
+typedef struct _GdkEventKey GdkEventKey;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkColor GdkColor;
typedef struct _GtkWidget GtkWidget;
-class AutofillPopupViewGtk : public AutofillPopupView {
+class AutofillPopupViewGtk : public AutofillPopupView,
+ public KeyboardListener {
public:
AutofillPopupViewGtk(content::WebContents* web_contents,
AutofillExternalDelegate* external_delegate,
GtkWidget* parent);
virtual ~AutofillPopupViewGtk();
+ virtual bool HandleKeyPressEvent(GdkEventKey* event) OVERRIDE;
Ilya Sherman 2012/03/15 20:10:56 nit: Can this have private visibility instead?
Ilya Sherman 2012/03/15 20:10:56 nit: Please add a comment like "// KeyboardListene
csharp 2012/03/21 15:32:28 Done.
+
protected:
// AutofillPopupView implementations.
virtual void ShowInternal() OVERRIDE;
virtual void HideInternal() OVERRIDE;
virtual void InvalidateRow(size_t row) OVERRIDE;
+ virtual void UpdatePopupSize() OVERRIDE;
private:
CHROMEGTK_CALLBACK_1(AutofillPopupViewGtk, gboolean, HandleButtonRelease,
@@ -47,6 +57,9 @@ class AutofillPopupViewGtk : public AutofillPopupView {
// Setup the pango layout to display the autofill results.
void SetupLayout(const gfx::Rect& window_rect, const GdkColor& text_color);
+ // Get width of popup needs by values.
+ int GetPopupRequiredWidth();
+
// Convert a y-coordinate to the closest line.
int LineFromY(int y);
@@ -60,6 +73,8 @@ class AutofillPopupViewGtk : public AutofillPopupView {
// The size of the popup.
gfx::Rect bounds_;
+
+ content::RenderViewHost* render_view_host_; // Weak reference.
};
#endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_POPUP_VIEW_GTK_H_

Powered by Google App Engine
This is Rietveld 408576698