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/tab_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 if (!window) { | 564 if (!window) { |
565 NOTREACHED(); | 565 NOTREACHED(); |
566 return; | 566 return; |
567 } | 567 } |
568 | 568 |
569 // Filter out pseudo key events created by GtkIMContext signal handlers. | 569 // Filter out pseudo key events created by GtkIMContext signal handlers. |
570 // Since GtkIMContext signal handlers don't use GdkEventKey objects, its | 570 // Since GtkIMContext signal handlers don't use GdkEventKey objects, its |
571 // |event.os_event| values are dummy values (or NULL.) | 571 // |event.os_event| values are dummy values (or NULL.) |
572 // We should filter out these pseudo key events to prevent unexpected | 572 // We should filter out these pseudo key events to prevent unexpected |
573 // behaviors caused by them. | 573 // behaviors caused by them. |
574 if (event.type == WebKit::WebInputEvent::Char) | 574 // We should also filter out the KeyUp event as it should not be processed |
| 575 // as an accelerator. |
| 576 if (event.type == WebKit::WebInputEvent::Char || |
| 577 event.type == WebKit::WebInputEvent::KeyUp) |
575 return; | 578 return; |
576 | 579 |
577 BrowserWindowGtk* browser_window = | 580 BrowserWindowGtk* browser_window = |
578 BrowserWindowGtk::GetBrowserWindowForNativeWindow(window); | 581 BrowserWindowGtk::GetBrowserWindowForNativeWindow(window); |
579 DCHECK(browser_window); | 582 DCHECK(browser_window); |
580 browser_window->HandleKeyboardEvent(event.os_event); | 583 browser_window->HandleKeyboardEvent(event.os_event); |
581 } | 584 } |
582 | 585 |
583 void TabContentsViewGtk::Observe(NotificationType type, | 586 void TabContentsViewGtk::Observe(NotificationType type, |
584 const NotificationSource& source, | 587 const NotificationSource& source, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 698 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
696 widget, "x", &value); | 699 widget, "x", &value); |
697 | 700 |
698 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 701 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
699 g_value_set_int(&value, child_y); | 702 g_value_set_int(&value, child_y); |
700 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 703 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
701 widget, "y", &value); | 704 widget, "y", &value); |
702 g_value_unset(&value); | 705 g_value_unset(&value); |
703 } | 706 } |
704 } | 707 } |
OLD | NEW |