OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |