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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 40065: RenderWidgetHost now stores both the WebKeyboardEvent and the native (Closed)
Patch Set: Redesign Created 11 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 unified diff | Download patch
OLDNEW
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
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "chrome/common/native_web_keyboard_event.h"
13 #include "chrome/common/x11_util.h" 14 #include "chrome/common/x11_util.h"
14 #include "chrome/browser/renderer_host/backing_store.h" 15 #include "chrome/browser/renderer_host/backing_store.h"
15 #include "chrome/browser/renderer_host/render_widget_host.h" 16 #include "chrome/browser/renderer_host/render_widget_host.h"
16 #include "skia/ext/bitmap_platform_device_linux.h" 17 #include "skia/ext/bitmap_platform_device_linux.h"
17 #include "skia/ext/platform_device_linux.h" 18 #include "skia/ext/platform_device_linux.h"
18 #include "webkit/glue/webinputevent.h" 19 #include "webkit/glue/webinputevent.h"
19 20
20 namespace { 21 namespace {
21 22
22 // This class is a simple convenience wrapper for Gtk functions. It has only 23 // This class is a simple convenience wrapper for Gtk functions. It has only
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 static gboolean ExposeEvent(GtkWidget* widget, GdkEventExpose* expose, 70 static gboolean ExposeEvent(GtkWidget* widget, GdkEventExpose* expose,
70 RenderWidgetHostViewGtk* host_view) { 71 RenderWidgetHostViewGtk* host_view) {
71 const gfx::Rect damage_rect(expose->area); 72 const gfx::Rect damage_rect(expose->area);
72 host_view->Paint(damage_rect); 73 host_view->Paint(damage_rect);
73 return FALSE; 74 return FALSE;
74 } 75 }
75 76
76 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event, 77 static gboolean KeyPressReleaseEvent(GtkWidget* widget, GdkEventKey* event,
77 RenderWidgetHostViewGtk* host_view) { 78 RenderWidgetHostViewGtk* host_view) {
78 WebKeyboardEvent wke(event); 79 NativeWebKeyboardEvent wke(event);
79 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); 80 host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke);
80 return FALSE; 81 return FALSE;
81 } 82 }
82 83
83 static gboolean FocusIn(GtkWidget* widget, GdkEventFocus* focus, 84 static gboolean FocusIn(GtkWidget* widget, GdkEventFocus* focus,
84 RenderWidgetHostViewGtk* host_view) { 85 RenderWidgetHostViewGtk* host_view) {
85 host_view->GetRenderWidgetHost()->Focus(); 86 host_view->GetRenderWidgetHost()->Focus();
86 return FALSE; 87 return FALSE;
87 } 88 }
88 89
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 GdkWindow* window = view_->window; 288 GdkWindow* window = view_->window;
288 if (window) { 289 if (window) {
289 backing_store->ShowRect( 290 backing_store->ShowRect(
290 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_)); 291 damage_rect, x11_util::GetX11WindowFromGtkWidget(view_));
291 } 292 }
292 } else { 293 } else {
293 NOTIMPLEMENTED(); 294 NOTIMPLEMENTED();
294 } 295 }
295 } 296 }
296 297
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698