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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 660069: Only send unprocessed key events upwards if the RenderWidgetHost is not hidde... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer_host/render_widget_host.h" 5 #include "chrome/browser/renderer_host/render_widget_host.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/keyboard_codes.h" 9 #include "base/keyboard_codes.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 << type << "). Ignoring event."; 1009 << type << "). Ignoring event.";
1010 1010
1011 // Something must be wrong. Clear the |key_queue_| and 1011 // Something must be wrong. Clear the |key_queue_| and
1012 // |suppress_next_char_events_| so that we can resume from the error. 1012 // |suppress_next_char_events_| so that we can resume from the error.
1013 key_queue_.clear(); 1013 key_queue_.clear();
1014 suppress_next_char_events_ = false; 1014 suppress_next_char_events_ = false;
1015 } else { 1015 } else {
1016 NativeWebKeyboardEvent front_item = key_queue_.front(); 1016 NativeWebKeyboardEvent front_item = key_queue_.front();
1017 key_queue_.pop_front(); 1017 key_queue_.pop_front();
1018 1018
1019 if (!processed) { 1019 // We only send unprocessed key event upwards if we are not hidden,
1020 // because the user has moved away from us and no longer expect any effect
1021 // of this key event.
1022 if (!processed && !is_hidden_) {
1020 UnhandledKeyboardEvent(front_item); 1023 UnhandledKeyboardEvent(front_item);
1021 1024
1022 // WARNING: This RenderWidgetHost can be deallocated at this point 1025 // WARNING: This RenderWidgetHost can be deallocated at this point
1023 // (i.e. in the case of Ctrl+W, where the call to 1026 // (i.e. in the case of Ctrl+W, where the call to
1024 // UnhandledKeyboardEvent destroys this RenderWidgetHost). 1027 // UnhandledKeyboardEvent destroys this RenderWidgetHost).
1025 } 1028 }
1026 } 1029 }
1027 } 1030 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698