Chromium Code Reviews

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

Issue 3337006: Revert 58388 - Revert 58215 - Revert 58186 - Move the keyboard files from bas... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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 "app/keyboard_codes.h"
8 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
9 #include "base/command_line.h" 8 #include "base/command_line.h"
10 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/keyboard_codes.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "chrome/browser/chrome_thread.h" 12 #include "chrome/browser/chrome_thread.h"
13 #include "chrome/browser/renderer_host/backing_store.h" 13 #include "chrome/browser/renderer_host/backing_store.h"
14 #include "chrome/browser/renderer_host/backing_store_manager.h" 14 #include "chrome/browser/renderer_host/backing_store_manager.h"
15 #include "chrome/browser/renderer_host/render_process_host.h" 15 #include "chrome/browser/renderer_host/render_process_host.h"
16 #include "chrome/browser/renderer_host/render_widget_helper.h" 16 #include "chrome/browser/renderer_host/render_widget_helper.h"
17 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h" 17 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h"
18 #include "chrome/browser/renderer_host/render_widget_host_view.h" 18 #include "chrome/browser/renderer_host/render_widget_host_view.h"
19 #include "chrome/browser/renderer_host/video_layer.h" 19 #include "chrome/browser/renderer_host/video_layer.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
(...skipping 440 matching lines...)
461 461
462 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false); 462 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false);
463 } 463 }
464 464
465 void RenderWidgetHost::ForwardKeyboardEvent( 465 void RenderWidgetHost::ForwardKeyboardEvent(
466 const NativeWebKeyboardEvent& key_event) { 466 const NativeWebKeyboardEvent& key_event) {
467 if (ignore_input_events_ || process_->ignore_input_events()) 467 if (ignore_input_events_ || process_->ignore_input_events())
468 return; 468 return;
469 469
470 if (key_event.type == WebKeyboardEvent::Char && 470 if (key_event.type == WebKeyboardEvent::Char &&
471 (key_event.windowsKeyCode == app::VKEY_RETURN || 471 (key_event.windowsKeyCode == base::VKEY_RETURN ||
472 key_event.windowsKeyCode == app::VKEY_SPACE)) { 472 key_event.windowsKeyCode == base::VKEY_SPACE)) {
473 OnUserGesture(); 473 OnUserGesture();
474 } 474 }
475 475
476 // Double check the type to make sure caller hasn't sent us nonsense that 476 // Double check the type to make sure caller hasn't sent us nonsense that
477 // will mess up our key queue. 477 // will mess up our key queue.
478 if (WebInputEvent::isKeyboardEventType(key_event.type)) { 478 if (WebInputEvent::isKeyboardEventType(key_event.type)) {
479 if (suppress_next_char_events_) { 479 if (suppress_next_char_events_) {
480 // If preceding RawKeyDown event was handled by the browser, then we need 480 // If preceding RawKeyDown event was handled by the browser, then we need
481 // suppress all Char events generated by it. Please note that, one 481 // suppress all Char events generated by it. Please note that, one
482 // RawKeyDown event may generate multiple Char events, so we can't reset 482 // RawKeyDown event may generate multiple Char events, so we can't reset
(...skipping 709 matching lines...)
1192 // of this key event. 1192 // of this key event.
1193 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { 1193 if (!processed && !is_hidden_ && !front_item.skip_in_browser) {
1194 UnhandledKeyboardEvent(front_item); 1194 UnhandledKeyboardEvent(front_item);
1195 1195
1196 // WARNING: This RenderWidgetHost can be deallocated at this point 1196 // WARNING: This RenderWidgetHost can be deallocated at this point
1197 // (i.e. in the case of Ctrl+W, where the call to 1197 // (i.e. in the case of Ctrl+W, where the call to
1198 // UnhandledKeyboardEvent destroys this RenderWidgetHost). 1198 // UnhandledKeyboardEvent destroys this RenderWidgetHost).
1199 } 1199 }
1200 } 1200 }
1201 } 1201 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine