| 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 "webkit/tools/test_shell/webwidget_host.h" | 5 #include "webkit/tools/test_shell/webwidget_host.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/gfx/platform_canvas_linux.h" | 10 #include "base/gfx/platform_canvas_linux.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 g_signal_connect(host->view_, "destroy-event", G_CALLBACK(DestroyEvent), host)
; | 85 g_signal_connect(host->view_, "destroy-event", G_CALLBACK(DestroyEvent), host)
; |
| 86 g_signal_connect(host->view_, "key-press-event", G_CALLBACK(KeyPressEvent), ho
st); | 86 g_signal_connect(host->view_, "key-press-event", G_CALLBACK(KeyPressEvent), ho
st); |
| 87 g_signal_connect(host->view_, "focus-in-event", G_CALLBACK(FocusIn), host); | 87 g_signal_connect(host->view_, "focus-in-event", G_CALLBACK(FocusIn), host); |
| 88 g_signal_connect(host->view_, "focus-out-event", G_CALLBACK(FocusOut), host); | 88 g_signal_connect(host->view_, "focus-out-event", G_CALLBACK(FocusOut), host); |
| 89 | 89 |
| 90 gtk_box_pack_start(GTK_BOX(box), host->view_, TRUE, TRUE, 0); | 90 gtk_box_pack_start(GTK_BOX(box), host->view_, TRUE, TRUE, 0); |
| 91 | 91 |
| 92 return host; | 92 return host; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) { |
| 96 NOTIMPLEMENTED(); |
| 97 } |
| 98 |
| 95 WebWidgetHost* FromWindow(gfx::WindowHandle view) { | 99 WebWidgetHost* FromWindow(gfx::WindowHandle view) { |
| 96 const gpointer p = g_object_get_data(G_OBJECT(view), "webwidgethost"); | 100 const gpointer p = g_object_get_data(G_OBJECT(view), "webwidgethost"); |
| 97 return (WebWidgetHost* ) p; | 101 return (WebWidgetHost* ) p; |
| 98 } | 102 } |
| 99 | 103 |
| 100 WebWidgetHost::WebWidgetHost() | 104 WebWidgetHost::WebWidgetHost() |
| 101 : view_(NULL), | 105 : view_(NULL), |
| 102 webwidget_(NULL), | 106 webwidget_(NULL), |
| 103 scroll_dx_(0), | 107 scroll_dx_(0), |
| 104 scroll_dy_(0), | 108 scroll_dy_(0), |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 177 } |
| 174 | 178 |
| 175 // ----------------------------------------------------------------------------- | 179 // ----------------------------------------------------------------------------- |
| 176 // This is called when the GTK window is destroyed. In the Windows code this | 180 // This is called when the GTK window is destroyed. In the Windows code this |
| 177 // deletes this object. Since it's only test_shell it probably doesn't matter | 181 // deletes this object. Since it's only test_shell it probably doesn't matter |
| 178 // that much. | 182 // that much. |
| 179 // ----------------------------------------------------------------------------- | 183 // ----------------------------------------------------------------------------- |
| 180 void WebWidgetHost::WindowDestroyed() { | 184 void WebWidgetHost::WindowDestroyed() { |
| 181 delete this; | 185 delete this; |
| 182 } | 186 } |
| OLD | NEW |