Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: ui/aura/remote_root_window_host_win.cc

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698