Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
| index 5e57094a1ac9f7a891f91b77b7cf643fce0768ed..474b8bf251ab597edea4bd15944e4b8985e72cc6 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.cc |
| +++ b/content/browser/renderer_host/render_widget_host_impl.cc |
| @@ -83,6 +83,7 @@ |
| #include "ui/base/clipboard/clipboard.h" |
| #include "ui/events/blink/web_input_event_traits.h" |
| #include "ui/events/event.h" |
| +#include "ui/events/keycodes/dom/dom_code.h" |
| #include "ui/events/keycodes/keyboard_codes.h" |
| #include "ui/gfx/color_space.h" |
| #include "ui/gfx/geometry/size_conversions.h" |
| @@ -1208,7 +1209,14 @@ void RenderWidgetHostImpl::ForwardKeyboardEvent( |
| if (!WebInputEvent::isKeyboardEventType(key_event.type())) |
| return; |
| - if (suppress_events_until_keydown_) { |
| + // For PrintScreen, a lone KeyUp event arrives. Bypass the suppression in this |
|
sadrul
2017/01/23 18:18:35
Is this the case on all platforms?
foolip
2017/01/24 04:38:12
I tested Windows and Linux then, on Mac there isn'
|
| + // case, as a |SuppressEventsUntilKeyDown()| call otherwise causes the keyup |
| + // events to go missing. |
| + // TODO(foolip): Remove this special case by instead removing the |
| + // |SuppressEventsUntilKeyDown()| call. https://crbug.com/668969 |
| + bool is_print_screen = |
| + static_cast<ui::DomCode>(key_event.domCode) == ui::DomCode::PRINT_SCREEN; |
| + if (suppress_events_until_keydown_ && !is_print_screen) { |
| // If the preceding RawKeyDown event was handled by the browser, then we |
| // need to suppress all events generated by it until the next RawKeyDown or |
| // KeyDown event. |