Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2874313002: Fix is_browser_shortcut; add a test.
Patch Set: SendKeyPressSync Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d177e31a35969c24316e54d599f97ccae5dd9221..d839e0df9f503156ef19ac18e42fc905121c0f94 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -87,6 +87,7 @@
#include "ui/display/display_switches.h"
#include "ui/events/blink/web_input_event_traits.h"
#include "ui/events/event.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -1219,6 +1220,7 @@ void RenderWidgetHostImpl::ForwardKeyboardEventWithCommands(
const ui::LatencyInfo& latency,
const std::vector<EditCommand>* commands,
bool* update_event) {
+ LOG(ERROR) << "RenderWidgetHostImpl::ForwardKeyboardEventWithCommands";
TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardKeyboardEvent");
if (owner_delegate_ &&
!owner_delegate_->MayRenderWidgetForwardKeyboardEvent(key_event)) {
@@ -1261,7 +1263,9 @@ void RenderWidgetHostImpl::ForwardKeyboardEventWithCommands(
bool is_shortcut = false;
// Only pre-handle the key event if it's not handled by the input method.
- if (delegate_ && !key_event.skip_in_browser) {
+ LOG(ERROR) << " > delegate_ = " << delegate_;
+ LOG(ERROR) << " > key_event.skip_in_browser = " << key_event.skip_in_browser;
+ if (delegate_){// && !key_event.skip_in_browser) {
// We need to set |suppress_events_until_keydown_| to true if
// PreHandleKeyboardEvent() handles the event, but |this| may already be
// destroyed at that time. So set |suppress_events_until_keydown_| true
@@ -1296,7 +1300,23 @@ void RenderWidgetHostImpl::ForwardKeyboardEventWithCommands(
NativeWebKeyboardEventWithLatencyInfo key_event_with_latency(key_event,
latency);
key_event_with_latency.event.is_browser_shortcut = is_shortcut;
- DispatchInputEventWithLatencyInfo(key_event, &key_event_with_latency.latency);
+ LOG(ERROR) << " > key_event_with_latency.event.GetType() "
+ << key_event_with_latency.event.GetType();
+ LOG(ERROR) << " > key_event_with_latency.event.is_browser_shortcut "
+ << key_event_with_latency.event.is_browser_shortcut;
+ LOG(ERROR) << " > key_event_with_latency.event.windows_key_code "
+ << key_event_with_latency.event.windows_key_code;
+ LOG(ERROR) << " > key_event_with_latency.event.dom_code "
+ << key_event_with_latency.event.dom_code;
+ LOG(ERROR) << " > key_event_with_latency.event.dom_key "
+ << key_event_with_latency.event.dom_key;
+ LOG(ERROR) << " > key_event_with_latency.event.text[0] "
+ << key_event_with_latency.event.text[0] << " "
+ << (key_event.text[0] ? ((char)key_event.text[0]) : ' ');
+ LOG(ERROR) << " > is_modifier "
+ << ui::KeycodeConverter::IsDomKeyForModifier(key_event.dom_key);
+ DispatchInputEventWithLatencyInfo(key_event_with_latency.event,
+ &key_event_with_latency.latency);
// TODO(foolip): |InputRouter::SendKeyboardEvent()| may filter events, in
// which the commands will be treated as belonging to the next key event.
// InputMsg_SetEditCommandsForNextKeyEvent should only be sent if
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698