| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 2507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2518 event->SetHandled(); | 2518 event->SetHandled(); |
| 2519 return; | 2519 return; |
| 2520 } | 2520 } |
| 2521 } | 2521 } |
| 2522 } | 2522 } |
| 2523 if (!in_shutdown_) { | 2523 if (!in_shutdown_) { |
| 2524 in_shutdown_ = true; | 2524 in_shutdown_ = true; |
| 2525 host_->Shutdown(); | 2525 host_->Shutdown(); |
| 2526 } | 2526 } |
| 2527 } else { | 2527 } else { |
| 2528 // Windows does not have a specific key code for AltGr and sends | |
| 2529 // left-Control and right-Alt when the AltGr key is pressed. Also | |
| 2530 // Windows translates AltGr modifier to Ctrl+Alt modifier. To be compatible | |
| 2531 // with this behavior, we re-write keyboard event from AltGr to Alt + Ctrl | |
| 2532 // key event here. | |
| 2533 if (event->key_code() == ui::VKEY_ALTGR) { | |
| 2534 // Synthesize Ctrl & Alt events. | |
| 2535 NativeWebKeyboardEvent ctrl_webkit_event( | |
| 2536 event->type(), | |
| 2537 false, | |
| 2538 ui::VKEY_CONTROL, | |
| 2539 event->flags(), | |
| 2540 ui::EventTimeForNow().InSecondsF()); | |
| 2541 host_->ForwardKeyboardEvent(ctrl_webkit_event); | |
| 2542 | |
| 2543 NativeWebKeyboardEvent alt_webkit_event( | |
| 2544 event->type(), | |
| 2545 false, | |
| 2546 ui::VKEY_MENU, | |
| 2547 event->flags(), | |
| 2548 ui::EventTimeForNow().InSecondsF()); | |
| 2549 host_->ForwardKeyboardEvent(alt_webkit_event); | |
| 2550 event->SetHandled(); | |
| 2551 return; | |
| 2552 } | |
| 2553 | |
| 2554 // We don't have to communicate with an input method here. | 2528 // We don't have to communicate with an input method here. |
| 2555 if (!event->HasNativeEvent()) { | 2529 if (!event->HasNativeEvent()) { |
| 2556 NativeWebKeyboardEvent webkit_event( | 2530 NativeWebKeyboardEvent webkit_event( |
| 2557 event->type(), | 2531 event->type(), |
| 2558 event->is_char(), | 2532 event->is_char(), |
| 2559 event->is_char() ? event->GetCharacter() : event->key_code(), | 2533 event->is_char() ? event->GetCharacter() : event->key_code(), |
| 2560 event->flags(), | 2534 event->flags(), |
| 2561 ui::EventTimeForNow().InSecondsF()); | 2535 ui::EventTimeForNow().InSecondsF()); |
| 2562 host_->ForwardKeyboardEvent(webkit_event); | 2536 host_->ForwardKeyboardEvent(webkit_event); |
| 2563 } else { | 2537 } else { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3241 RenderWidgetHost* widget) { | 3215 RenderWidgetHost* widget) { |
| 3242 return new RenderWidgetHostViewAura(widget); | 3216 return new RenderWidgetHostViewAura(widget); |
| 3243 } | 3217 } |
| 3244 | 3218 |
| 3245 // static | 3219 // static |
| 3246 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3220 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3247 GetScreenInfoForWindow(results, NULL); | 3221 GetScreenInfoForWindow(results, NULL); |
| 3248 } | 3222 } |
| 3249 | 3223 |
| 3250 } // namespace content | 3224 } // namespace content |
| OLD | NEW |