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

Unified Diff: content/browser/renderer_host/render_widget_host.h

Issue 8885009: Revert r112160 ("Send one WebKeyboardEvent to the RenderWidget at a time.") (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host.h
diff --git a/content/browser/renderer_host/render_widget_host.h b/content/browser/renderer_host/render_widget_host.h
index d25876f961e12571e0e11d27f4c7d30ee40aa1e3..49b71fdb9b7e6f8eb67e3da6908954ddfbcd37ee 100644
--- a/content/browser/renderer_host/render_widget_host.h
+++ b/content/browser/renderer_host/render_widget_host.h
@@ -283,7 +283,6 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Channel::Listener,
void ForwardWheelEvent(const WebKit::WebMouseWheelEvent& wheel_event);
void ForwardGestureEvent(const WebKit::WebGestureEvent& gesture_event);
virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event);
- virtual void ForwardNextKeyboardEvent();
virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event);
@@ -459,7 +458,7 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Channel::Listener,
protected:
// Internal implementation of the public Forward*Event() methods.
void ForwardInputEvent(const WebKit::WebInputEvent& input_event,
- int event_size);
+ int event_size, bool is_keyboard_shortcut);
// Called when we receive a notification indicating that the renderer
// process has gone. This will reset our state so that our state will be
@@ -760,14 +759,7 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Channel::Listener,
base::TimeTicks repaint_start_time_;
// Queue of keyboard events that we need to track.
- struct Key {
- Key(const NativeWebKeyboardEvent& event, bool is_shortcut)
- : event(event), is_shortcut(is_shortcut) {
- }
- NativeWebKeyboardEvent event;
- bool is_shortcut;
- };
- typedef std::deque<Key> KeyQueue;
+ typedef std::deque<NativeWebKeyboardEvent> KeyQueue;
// A queue of keyboard events. We can't trust data from the renderer so we
// stuff key events into a queue and pop them out on ACK, feeding our copy
@@ -787,27 +779,19 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Channel::Listener,
bool text_direction_canceled_;
// Indicates if the next sequence of Char events should be suppressed or not.
- //
- // The system may translate a RawKeyDown event into zero or more Char events,
+ // System may translate a RawKeyDown event into zero or more Char events,
// usually we send them to the renderer directly in sequence. However, If a
- // RawKeyDown event was not handled by the renderer but was handled by our
- // UnhandledKeyboardEvent() method, e.g. as an accelerator key, then we shall
- // not send the following sequence of Char events, which was generated by
- // this RawKeyDown event, to the renderer. Otherwise the renderer may handle
- // the Char events and cause unexpected behavior. For example, pressing
- // alt-2 may let the browser switch to the second tab, but the Char event
- // generated by alt-2 may also activate a HTML element if its accesskey
- // happens to be "2", then the user may get confused when switching back to
- // the original tab, because the content may already be changed.
- //
- // If true, suppress_incoming_char_events_ prevents Char events from being
- // added to key_queue_.
- //
- // If true, suppress_outgoing_char_events_ prevents Char events from being
- // removed from key_queue_ and forwarded to the renderer.
- //
- bool suppress_incoming_char_events_;
- bool suppress_outgoing_char_events_;
+ // RawKeyDown event was not handled by the renderer but was handled by
+ // our UnhandledKeyboardEvent() method, e.g. as an accelerator key, then we
+ // shall not send the following sequence of Char events, which was generated
+ // by this RawKeyDown event, to the renderer. Otherwise the renderer may
+ // handle the Char events and cause unexpected behavior.
+ // For example, pressing alt-2 may let the browser switch to the second tab,
+ // but the Char event generated by alt-2 may also activate a HTML element
+ // if its accesskey happens to be "2", then the user may get confused when
+ // switching back to the original tab, because the content may already be
+ // changed.
+ bool suppress_next_char_events_;
std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698