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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 RenderWidgetHostViewGtk* host_view) { | 72 RenderWidgetHostViewGtk* host_view) { |
73 const gfx::Rect damage_rect(expose->area); | 73 const gfx::Rect damage_rect(expose->area); |
74 host_view->Paint(damage_rect); | 74 host_view->Paint(damage_rect); |
75 return FALSE; | 75 return FALSE; |
76 } | 76 } |
77 | 77 |
78 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, | 78 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, |
79 RenderWidgetHostViewGtk* host_view) { | 79 RenderWidgetHostViewGtk* host_view) { |
80 WebKeyboardEvent wke(event); | 80 WebKeyboardEvent wke(event); |
81 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); | 81 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); |
| 82 |
| 83 // See note in webwidget_host_gtk.cc::HandleKeyPress(). |
| 84 if (event->type == GDK_KEY_PRESS) { |
| 85 wke.type = WebKeyboardEvent::CHAR; |
| 86 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); |
| 87 } |
| 88 |
82 return FALSE; | 89 return FALSE; |
83 } | 90 } |
84 | 91 |
85 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, | 92 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, |
86 RenderWidgetHostViewGtk* host_view) { | 93 RenderWidgetHostViewGtk* host_view) { |
87 // We override this so that pressing tab navigates within the web contents | 94 // We override this so that pressing tab navigates within the web contents |
88 // rather than tabbing out of it. However, we do want to be able to tab | 95 // rather than tabbing out of it. However, we do want to be able to tab |
89 // out of it at the appropriate points. TODO(port): study how this works | 96 // out of it at the appropriate points. TODO(port): study how this works |
90 // on Windows and implement it. | 97 // on Windows and implement it. |
91 NOTIMPLEMENTED(); | 98 NOTIMPLEMENTED(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 GdkWindow* window = view_->window; | 305 GdkWindow* window = view_->window; |
299 if (window) { | 306 if (window) { |
300 backing_store->ShowRect( | 307 backing_store->ShowRect( |
301 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); | 308 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); |
302 } | 309 } |
303 } else { | 310 } else { |
304 NOTIMPLEMENTED(); | 311 NOTIMPLEMENTED(); |
305 } | 312 } |
306 } | 313 } |
307 | 314 |
OLD | NEW |