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 | |
89 return FALSE; | 82 return FALSE; |
90 } | 83 } |
91 | 84 |
92 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, | 85 static gboolean Focus(GtkWidget* widget, GtkDirectionType focus, |
93 RenderWidgetHostViewGtk* host_view) { | 86 RenderWidgetHostViewGtk* host_view) { |
94 // We override this so that pressing tab navigates within the web contents | 87 // We override this so that pressing tab navigates within the web contents |
95 // rather than tabbing out of it. However, we do want to be able to tab | 88 // rather than tabbing out of it. However, we do want to be able to tab |
96 // out of it at the appropriate points. TODO(port): study how this works | 89 // out of it at the appropriate points. TODO(port): study how this works |
97 // on Windows and implement it. | 90 // on Windows and implement it. |
98 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 GdkWindow* window = view_->window; | 298 GdkWindow* window = view_->window; |
306 if (window) { | 299 if (window) { |
307 backing_store->ShowRect( | 300 backing_store->ShowRect( |
308 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); | 301 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); |
309 } | 302 } |
310 } else { | 303 } else { |
311 NOTIMPLEMENTED(); | 304 NOTIMPLEMENTED(); |
312 } | 305 } |
313 } | 306 } |
314 | 307 |
OLD | NEW |