OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/gtk_key_bindings_handler.h" | 5 #include "content/browser/renderer_host/gtk_key_bindings_handler.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // the |handler_| object. | 22 // the |handler_| object. |
23 gtk_fixed_put(GTK_FIXED(parent_widget), handler_.get(), -1, -1); | 23 gtk_fixed_put(GTK_FIXED(parent_widget), handler_.get(), -1, -1); |
24 } | 24 } |
25 | 25 |
26 GtkKeyBindingsHandler::~GtkKeyBindingsHandler() { | 26 GtkKeyBindingsHandler::~GtkKeyBindingsHandler() { |
27 handler_.Destroy(); | 27 handler_.Destroy(); |
28 } | 28 } |
29 | 29 |
30 bool GtkKeyBindingsHandler::Match(const NativeWebKeyboardEvent& wke, | 30 bool GtkKeyBindingsHandler::Match(const NativeWebKeyboardEvent& wke, |
31 EditCommands* edit_commands) { | 31 EditCommands* edit_commands) { |
32 if (wke.type == WebKit::WebInputEvent::Char || !wke.os_event) | 32 if (wke.type == blink::WebInputEvent::Char || !wke.os_event) |
33 return false; | 33 return false; |
34 | 34 |
35 edit_commands_.clear(); | 35 edit_commands_.clear(); |
36 // If this key event matches a predefined key binding, corresponding signal | 36 // If this key event matches a predefined key binding, corresponding signal |
37 // will be emitted. | 37 // will be emitted. |
38 gtk_bindings_activate_event(GTK_OBJECT(handler_.get()), &wke.os_event->key); | 38 gtk_bindings_activate_event(GTK_OBJECT(handler_.get()), &wke.os_event->key); |
39 | 39 |
40 bool matched = !edit_commands_.empty(); | 40 bool matched = !edit_commands_.empty(); |
41 if (edit_commands) | 41 if (edit_commands) |
42 edit_commands->swap(edit_commands_); | 42 edit_commands->swap(edit_commands_); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // Just for disabling the default handler. | 284 // Just for disabling the default handler. |
285 return FALSE; | 285 return FALSE; |
286 } | 286 } |
287 | 287 |
288 void GtkKeyBindingsHandler::MoveFocus(GtkWidget* widget, | 288 void GtkKeyBindingsHandler::MoveFocus(GtkWidget* widget, |
289 GtkDirectionType arg1) { | 289 GtkDirectionType arg1) { |
290 // Just for disabling the default handler. | 290 // Just for disabling the default handler. |
291 } | 291 } |
292 | 292 |
293 } // namespace content | 293 } // namespace content |
OLD | NEW |