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 "ui/aura/remote_root_window_host_win.h" | 5 #include "ui/aura/remote_root_window_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 void RemoteRootWindowHostWin::OnWindowActivated(bool active) { | 467 void RemoteRootWindowHostWin::OnWindowActivated(bool active) { |
468 active ? GetRootWindow()->Focus() : GetRootWindow()->Blur(); | 468 active ? GetRootWindow()->Focus() : GetRootWindow()->Blur(); |
469 } | 469 } |
470 | 470 |
471 void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type, | 471 void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type, |
472 uint32 vkey, | 472 uint32 vkey, |
473 uint32 repeat_count, | 473 uint32 repeat_count, |
474 uint32 scan_code, | 474 uint32 scan_code, |
475 uint32 flags, | 475 uint32 flags, |
476 bool is_character) { | 476 bool is_character) { |
477 if (MessageLoop::current()->IsNested()) { | 477 if (base::MessageLoop::current()->IsNested()) { |
478 SetVirtualKeyStates(flags); | 478 SetVirtualKeyStates(flags); |
479 | 479 |
480 uint32 message = is_character ? WM_CHAR : | 480 uint32 message = is_character ? WM_CHAR : |
481 (type == ui::ET_KEY_PRESSED ? WM_KEYDOWN : WM_KEYUP); | 481 (type == ui::ET_KEY_PRESSED ? WM_KEYDOWN : WM_KEYUP); |
482 ::PostThreadMessage(::GetCurrentThreadId(), | 482 ::PostThreadMessage(::GetCurrentThreadId(), |
483 message, | 483 message, |
484 vkey, | 484 vkey, |
485 repeat_count | scan_code >> 15); | 485 repeat_count | scan_code >> 15); |
486 } else { | 486 } else { |
487 ui::KeyEvent event(type, | 487 ui::KeyEvent event(type, |
488 ui::KeyboardCodeForWindowsKeyCode(vkey), | 488 ui::KeyboardCodeForWindowsKeyCode(vkey), |
489 flags, | 489 flags, |
490 is_character); | 490 is_character); |
491 delegate_->OnHostKeyEvent(&event); | 491 delegate_->OnHostKeyEvent(&event); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 } // namespace aura | 495 } // namespace aura |
OLD | NEW |