| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
| 9 #include <cairo/cairo.h> | 9 #include <cairo/cairo.h> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 RenderWidgetHostViewGtk* host_view) { | 70 RenderWidgetHostViewGtk* host_view) { |
| 71 const gfx::Rect damage_rect(expose->area); | 71 const gfx::Rect damage_rect(expose->area); |
| 72 host_view->Paint(damage_rect); | 72 host_view->Paint(damage_rect); |
| 73 return FALSE; | 73 return FALSE; |
| 74 } | 74 } |
| 75 | 75 |
| 76 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, | 76 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, |
| 77 RenderWidgetHostViewGtk* host_view) { | 77 RenderWidgetHostViewGtk* host_view) { |
| 78 WebKeyboardEvent wke(event); | 78 WebKeyboardEvent wke(event); |
| 79 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); | 79 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); |
| 80 | |
| 81 // See note in webwidget_host_gtk.cc::HandleKeyPress(). | |
| 82 if (event->type == GDK_KEY_PRESS) { | |
| 83 wke.type = WebKeyboardEvent::CHAR; | |
| 84 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); | |
| 85 } | |
| 86 | |
| 87 return FALSE; | 80 return FALSE; |
| 88 } | 81 } |
| 89 | 82 |
| 90 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, | 83 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, |
| 91 RenderWidgetHostViewGtk* host_view) { | 84 RenderWidgetHostViewGtk* host_view) { |
| 92 // We override this so that pressing tab navigates within the web contents | 85 // We override this so that pressing tab navigates within the web contents |
| 93 // rather than tabbing out of it. However, we do want to be able to tab | 86 // rather than tabbing out of it. However, we do want to be able to tab |
| 94 // out of it at the appropriate points. TODO(port): study how this works | 87 // out of it at the appropriate points. TODO(port): study how this works |
| 95 // on Windows and implement it. | 88 // on Windows and implement it. |
| 96 NOTIMPLEMENTED(); | 89 NOTIMPLEMENTED(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 cairo_paint(cairo_drawable); | 301 cairo_paint(cairo_drawable); |
| 309 cairo_destroy(cairo_drawable); | 302 cairo_destroy(cairo_drawable); |
| 310 gdk_window_end_paint(window); | 303 gdk_window_end_paint(window); |
| 311 } | 304 } |
| 312 | 305 |
| 313 } else { | 306 } else { |
| 314 NOTIMPLEMENTED(); | 307 NOTIMPLEMENTED(); |
| 315 } | 308 } |
| 316 } | 309 } |
| 317 | 310 |
| OLD | NEW |