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 "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/message_loop.h" | 9 #include "base/message_loop.h" |
11 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
12 #include "chrome/browser/accessibility/browser_accessibility_state.h" | 11 #include "chrome/browser/accessibility/browser_accessibility_state.h" |
13 #include "chrome/browser/metrics/user_metrics.h" | 12 #include "chrome/browser/metrics/user_metrics.h" |
14 #include "chrome/browser/renderer_host/backing_store.h" | 13 #include "chrome/browser/renderer_host/backing_store.h" |
15 #include "chrome/browser/renderer_host/backing_store_manager.h" | 14 #include "chrome/browser/renderer_host/backing_store_manager.h" |
16 #include "chrome/browser/renderer_host/render_process_host.h" | 15 #include "chrome/browser/renderer_host/render_process_host.h" |
17 #include "chrome/browser/renderer_host/render_widget_helper.h" | 16 #include "chrome/browser/renderer_host/render_widget_helper.h" |
18 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h" | 17 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h" |
19 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 18 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
20 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/result_codes.h" | 20 #include "chrome/common/result_codes.h" |
22 #include "chrome/common/native_web_keyboard_event.h" | 21 #include "chrome/common/native_web_keyboard_event.h" |
23 #include "chrome/common/notification_service.h" | 22 #include "chrome/common/notification_service.h" |
24 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
25 #include "chrome/common/render_messages_params.h" | 24 #include "chrome/common/render_messages_params.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" |
| 26 #include "ui/base/keycodes/keyboard_codes.h" |
27 #include "webkit/glue/webcursor.h" | 27 #include "webkit/glue/webcursor.h" |
28 #include "webkit/plugins/npapi/webplugin.h" | 28 #include "webkit/plugins/npapi/webplugin.h" |
29 | 29 |
30 #if defined(TOOLKIT_VIEWS) | 30 #if defined(TOOLKIT_VIEWS) |
31 #include "views/view.h" | 31 #include "views/view.h" |
32 #endif | 32 #endif |
33 | 33 |
34 #if defined (OS_MACOSX) | 34 #if defined (OS_MACOSX) |
35 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
36 #include "third_party/WebKit/WebKit/chromium/public/mac/WebScreenInfoFactory.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/mac/WebScreenInfoFactory.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 535 |
536 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false); | 536 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false); |
537 } | 537 } |
538 | 538 |
539 void RenderWidgetHost::ForwardKeyboardEvent( | 539 void RenderWidgetHost::ForwardKeyboardEvent( |
540 const NativeWebKeyboardEvent& key_event) { | 540 const NativeWebKeyboardEvent& key_event) { |
541 if (ignore_input_events_ || process_->ignore_input_events()) | 541 if (ignore_input_events_ || process_->ignore_input_events()) |
542 return; | 542 return; |
543 | 543 |
544 if (key_event.type == WebKeyboardEvent::Char && | 544 if (key_event.type == WebKeyboardEvent::Char && |
545 (key_event.windowsKeyCode == app::VKEY_RETURN || | 545 (key_event.windowsKeyCode == ui::VKEY_RETURN || |
546 key_event.windowsKeyCode == app::VKEY_SPACE)) { | 546 key_event.windowsKeyCode == ui::VKEY_SPACE)) { |
547 OnUserGesture(); | 547 OnUserGesture(); |
548 } | 548 } |
549 | 549 |
550 // Double check the type to make sure caller hasn't sent us nonsense that | 550 // Double check the type to make sure caller hasn't sent us nonsense that |
551 // will mess up our key queue. | 551 // will mess up our key queue. |
552 if (WebInputEvent::isKeyboardEventType(key_event.type)) { | 552 if (WebInputEvent::isKeyboardEventType(key_event.type)) { |
553 if (suppress_next_char_events_) { | 553 if (suppress_next_char_events_) { |
554 // If preceding RawKeyDown event was handled by the browser, then we need | 554 // If preceding RawKeyDown event was handled by the browser, then we need |
555 // suppress all Char events generated by it. Please note that, one | 555 // suppress all Char events generated by it. Please note that, one |
556 // RawKeyDown event may generate multiple Char events, so we can't reset | 556 // RawKeyDown event may generate multiple Char events, so we can't reset |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 return; | 1248 return; |
1249 | 1249 |
1250 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) { | 1250 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) { |
1251 #if defined(TOOLKIT_USES_GTK) | 1251 #if defined(TOOLKIT_USES_GTK) |
1252 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 1252 view_->CreatePluginContainer(deferred_plugin_handles_[i]); |
1253 #endif | 1253 #endif |
1254 } | 1254 } |
1255 | 1255 |
1256 deferred_plugin_handles_.clear(); | 1256 deferred_plugin_handles_.clear(); |
1257 } | 1257 } |
OLD | NEW |