OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tab_contents/web_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/web_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | |
7 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
8 | 9 |
9 #include "base/gfx/point.h" | 10 #include "base/gfx/point.h" |
10 #include "base/gfx/rect.h" | 11 #include "base/gfx/rect.h" |
11 #include "chrome/browser/renderer_host/render_view_host.h" | 12 #include "chrome/browser/renderer_host/render_view_host.h" |
12 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 13 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
13 #include "chrome/browser/tab_contents/web_contents.h" | 14 #include "chrome/browser/tab_contents/web_contents.h" |
14 | 15 |
16 #include "webkit/glue/webinputevent.h" | |
17 | |
15 namespace { | 18 namespace { |
16 | 19 |
17 // Callback used in WebContentsViewGtk::CreateViewForWidget(). | 20 // Callback used in WebContentsViewGtk::CreateViewForWidget(). |
18 void RemoveWidget(GtkWidget* widget, void* container) { | 21 void RemoveWidget(GtkWidget* widget, void* container) { |
19 gtk_container_remove(GTK_CONTAINER(container), widget); | 22 gtk_container_remove(GTK_CONTAINER(container), widget); |
20 } | 23 } |
21 | 24 |
22 } // namespace | 25 } // namespace |
23 | 26 |
24 // static | 27 // static |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 | 112 |
110 void WebContentsViewGtk::UpdateDragCursor(bool is_drop_target) { | 113 void WebContentsViewGtk::UpdateDragCursor(bool is_drop_target) { |
111 NOTIMPLEMENTED(); | 114 NOTIMPLEMENTED(); |
112 } | 115 } |
113 | 116 |
114 void WebContentsViewGtk::TakeFocus(bool reverse) { | 117 void WebContentsViewGtk::TakeFocus(bool reverse) { |
115 NOTIMPLEMENTED(); | 118 NOTIMPLEMENTED(); |
116 } | 119 } |
117 | 120 |
118 void WebContentsViewGtk::HandleKeyboardEvent(const WebKeyboardEvent& event) { | 121 void WebContentsViewGtk::HandleKeyboardEvent(const WebKeyboardEvent& event) { |
119 // The renderer returned a keyboard event it did not process. This may be | 122 // The renderer returned a keyboard event it did not process. This may be a |
120 // a keyboard shortcut that we have to process. | 123 // keyboard shortcut that we have to process or a cursor key/page up/down |
121 // The windows code forwards this event onwards to accelerator handling, | 124 // etc. |
122 // and then to DefWindowProc. TODO(port): should do something similar. | 125 switch (event.gdk_keyval) { |
123 NOTIMPLEMENTED(); | 126 case GDK_Page_Up: |
127 case GDK_Page_Down: | |
128 case GDK_Left: | |
129 case GDK_Right: | |
130 case GDK_Up: | |
131 case GDK_Down: | |
132 NOTIMPLEMENTED() | |
133 << "Need better navigation support in HandleKeyboardEvent"; | |
134 break; | |
135 default: | |
136 // This may be an accelerator. Pass it on to GTK. | |
137 gtk_accel_groups_activate(G_OBJECT(vbox_->window), | |
138 event.gdk_keyval, | |
139 GdkModifierType(event.gdk_modifier)); | |
140 } | |
Avi (use Gerrit)
2009/02/25 22:38:40
No. Handling random crap that the renderer sends b
| |
124 } | 141 } |
125 | 142 |
126 void WebContentsViewGtk::OnFindReply(int request_id, | 143 void WebContentsViewGtk::OnFindReply(int request_id, |
127 int number_of_matches, | 144 int number_of_matches, |
128 const gfx::Rect& selection_rect, | 145 const gfx::Rect& selection_rect, |
129 int active_match_ordinal, | 146 int active_match_ordinal, |
130 bool final_update) { | 147 bool final_update) { |
131 NOTIMPLEMENTED(); | 148 NOTIMPLEMENTED(); |
132 } | 149 } |
133 | 150 |
(...skipping 26 matching lines...) Expand all Loading... | |
160 bool user_gesture) { | 177 bool user_gesture) { |
161 NOTIMPLEMENTED(); | 178 NOTIMPLEMENTED(); |
162 } | 179 } |
163 | 180 |
164 void WebContentsViewGtk::ShowCreatedWidgetInternal( | 181 void WebContentsViewGtk::ShowCreatedWidgetInternal( |
165 RenderWidgetHostView* widget_host_view, | 182 RenderWidgetHostView* widget_host_view, |
166 const gfx::Rect& initial_pos) { | 183 const gfx::Rect& initial_pos) { |
167 NOTIMPLEMENTED(); | 184 NOTIMPLEMENTED(); |
168 } | 185 } |
169 | 186 |
OLD | NEW |