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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { | 146 bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { |
147 bool handled = true; | 147 bool handled = true; |
148 IPC_BEGIN_MESSAGE_MAP(RemoteRootWindowHostWin, message) | 148 IPC_BEGIN_MESSAGE_MAP(RemoteRootWindowHostWin, message) |
149 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) | 149 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) |
150 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) | 150 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) |
151 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) | 151 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) |
152 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyUp, OnKeyUp) | 152 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyUp, OnKeyUp) |
153 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_Character, OnChar) | 153 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_Character, OnChar) |
154 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_VisibilityChanged, | 154 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_WindowActivated, |
155 OnVisibilityChanged) | 155 OnWindowActivated) |
156 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchDown, | 156 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchDown, |
157 OnTouchDown) | 157 OnTouchDown) |
158 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchUp, | 158 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchUp, |
159 OnTouchUp) | 159 OnTouchUp) |
160 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchMoved, | 160 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchMoved, |
161 OnTouchMoved) | 161 OnTouchMoved) |
162 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileSaveAsDone, | 162 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileSaveAsDone, |
163 OnFileSaveAsDone) | 163 OnFileSaveAsDone) |
164 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileOpenDone, | 164 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileOpenDone, |
165 OnFileOpenDone) | 165 OnFileOpenDone) |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 453 } |
454 | 454 |
455 void RemoteRootWindowHostWin::OnChar(uint32 key_code, | 455 void RemoteRootWindowHostWin::OnChar(uint32 key_code, |
456 uint32 repeat_count, | 456 uint32 repeat_count, |
457 uint32 scan_code, | 457 uint32 scan_code, |
458 uint32 flags) { | 458 uint32 flags) { |
459 DispatchKeyboardMessage(ui::ET_KEY_PRESSED, key_code, repeat_count, | 459 DispatchKeyboardMessage(ui::ET_KEY_PRESSED, key_code, repeat_count, |
460 scan_code, flags, true); | 460 scan_code, flags, true); |
461 } | 461 } |
462 | 462 |
463 void RemoteRootWindowHostWin::OnVisibilityChanged(bool visible) { | 463 void RemoteRootWindowHostWin::OnWindowActivated() { |
464 if (visible) | 464 delegate_->OnHostActivated(); |
465 delegate_->OnHostActivated(); | |
466 } | 465 } |
467 | 466 |
468 void RemoteRootWindowHostWin::OnTouchDown(int32 x, | 467 void RemoteRootWindowHostWin::OnTouchDown(int32 x, |
469 int32 y, | 468 int32 y, |
470 uint64 timestamp, | 469 uint64 timestamp, |
471 uint32 pointer_id) { | 470 uint32 pointer_id) { |
472 ui::TouchEvent event(ui::ET_TOUCH_PRESSED, | 471 ui::TouchEvent event(ui::ET_TOUCH_PRESSED, |
473 gfx::Point(x, y), | 472 gfx::Point(x, y), |
474 pointer_id, | 473 pointer_id, |
475 base::TimeDelta::FromMicroseconds(timestamp)); | 474 base::TimeDelta::FromMicroseconds(timestamp)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 } else { | 568 } else { |
570 ui::KeyEvent event(type, | 569 ui::KeyEvent event(type, |
571 ui::KeyboardCodeForWindowsKeyCode(vkey), | 570 ui::KeyboardCodeForWindowsKeyCode(vkey), |
572 flags, | 571 flags, |
573 is_character); | 572 is_character); |
574 delegate_->OnHostKeyEvent(&event); | 573 delegate_->OnHostKeyEvent(&event); |
575 } | 574 } |
576 } | 575 } |
577 | 576 |
578 } // namespace aura | 577 } // namespace aura |
OLD | NEW |