Chromium Code Reviews| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 RenderWidgetHostViewGtk* host_view) { | 71 RenderWidgetHostViewGtk* host_view) { |
| 72 const gfx::Rect damage_rect(expose->area); | 72 const gfx::Rect damage_rect(expose->area); |
| 73 host_view->Paint(damage_rect); | 73 host_view->Paint(damage_rect); |
| 74 return FALSE; | 74 return FALSE; |
| 75 } | 75 } |
| 76 | 76 |
| 77 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, | 77 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, |
| 78 RenderWidgetHostViewGtk* host_view) { | 78 RenderWidgetHostViewGtk* host_view) { |
| 79 NativeWebKeyboardEvent wke(event); | 79 NativeWebKeyboardEvent wke(event); |
| 80 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); | 80 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); |
| 81 return FALSE; | 81 // We return TRUE because we did handle the event. If it turns out webkit |
| 82 // can't handle the event, we'll deal with that later. | |
|
Dean McNamee
2009/03/16 19:19:02
we deal with that in XXX. This makes it sound lik
| |
| 83 return TRUE; | |
| 82 } | 84 } |
| 83 | 85 |
| 84 static gboolean FocusIn(GtkWidget* widget, GdkEventFocus* focus, | 86 static gboolean FocusIn(GtkWidget* widget, GdkEventFocus* focus, |
| 85 RenderWidgetHostViewGtk* host_view) { | 87 RenderWidgetHostViewGtk* host_view) { |
| 86 host_view->GetRenderWidgetHost()->Focus(); | 88 host_view->GetRenderWidgetHost()->Focus(); |
| 87 return FALSE; | 89 return FALSE; |
| 88 } | 90 } |
| 89 | 91 |
| 90 static gboolean FocusOut(GtkWidget* widget, GdkEventFocus* focus, | 92 static gboolean FocusOut(GtkWidget* widget, GdkEventFocus* focus, |
| 91 RenderWidgetHostViewGtk* host_view) { | 93 RenderWidgetHostViewGtk* host_view) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 // Destroy()ed yet and it receives paint messages... | 294 // Destroy()ed yet and it receives paint messages... |
| 293 GdkWindow* window = view_->window; | 295 GdkWindow* window = view_->window; |
| 294 if (window) { | 296 if (window) { |
| 295 backing_store->ShowRect( | 297 backing_store->ShowRect( |
| 296 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); | 298 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); |
| 297 } | 299 } |
| 298 } else { | 300 } else { |
| 299 NOTIMPLEMENTED(); | 301 NOTIMPLEMENTED(); |
| 300 } | 302 } |
| 301 } | 303 } |
| OLD | NEW |