| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 bool RemoteWindowTreeHostWin::OnMessageReceived(const IPC::Message& message) { | 213 bool RemoteWindowTreeHostWin::OnMessageReceived(const IPC::Message& message) { |
| 214 bool handled = true; | 214 bool handled = true; |
| 215 IPC_BEGIN_MESSAGE_MAP(RemoteWindowTreeHostWin, message) | 215 IPC_BEGIN_MESSAGE_MAP(RemoteWindowTreeHostWin, message) |
| 216 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) | 216 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) |
| 217 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) | 217 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) |
| 218 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) | 218 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) |
| 219 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyUp, OnKeyUp) | 219 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyUp, OnKeyUp) |
| 220 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_Character, OnChar) | 220 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_Character, OnChar) |
| 221 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_WindowActivated, | 221 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_WindowActivated, |
| 222 OnWindowActivated) | 222 OnWindowActivated) |
| 223 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_EdgeGesture, OnEdgeGesture) |
| 223 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchDown, | 224 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchDown, |
| 224 OnTouchDown) | 225 OnTouchDown) |
| 225 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchUp, | 226 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchUp, |
| 226 OnTouchUp) | 227 OnTouchUp) |
| 227 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchMoved, | 228 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_TouchMoved, |
| 228 OnTouchMoved) | 229 OnTouchMoved) |
| 229 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileSaveAsDone, | 230 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileSaveAsDone, |
| 230 OnFileSaveAsDone) | 231 OnFileSaveAsDone) |
| 231 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileOpenDone, | 232 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_FileOpenDone, |
| 232 OnFileOpenDone) | 233 OnFileOpenDone) |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 uint32 scan_code, | 590 uint32 scan_code, |
| 590 uint32 flags) { | 591 uint32 flags) { |
| 591 DispatchKeyboardMessage(ui::ET_KEY_PRESSED, key_code, repeat_count, | 592 DispatchKeyboardMessage(ui::ET_KEY_PRESSED, key_code, repeat_count, |
| 592 scan_code, flags, true); | 593 scan_code, flags, true); |
| 593 } | 594 } |
| 594 | 595 |
| 595 void RemoteWindowTreeHostWin::OnWindowActivated() { | 596 void RemoteWindowTreeHostWin::OnWindowActivated() { |
| 596 delegate_->OnHostActivated(); | 597 delegate_->OnHostActivated(); |
| 597 } | 598 } |
| 598 | 599 |
| 600 void RemoteWindowTreeHostWin::OnEdgeGesture() { |
| 601 ui::GestureEvent event( |
| 602 ui::ET_GESTURE_WIN8_EDGE_SWIPE, |
| 603 0, |
| 604 0, |
| 605 0, |
| 606 ui::EventTimeForNow(), |
| 607 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0), |
| 608 0); |
| 609 SendEventToProcessor(&event); |
| 610 } |
| 611 |
| 599 void RemoteWindowTreeHostWin::OnTouchDown(int32 x, | 612 void RemoteWindowTreeHostWin::OnTouchDown(int32 x, |
| 600 int32 y, | 613 int32 y, |
| 601 uint64 timestamp, | 614 uint64 timestamp, |
| 602 uint32 pointer_id) { | 615 uint32 pointer_id) { |
| 603 gfx::Point location = PointFromNativeEvent(x, y); | 616 gfx::Point location = PointFromNativeEvent(x, y); |
| 604 ui::TouchEvent event(ui::ET_TOUCH_PRESSED, | 617 ui::TouchEvent event(ui::ET_TOUCH_PRESSED, |
| 605 location, | 618 location, |
| 606 pointer_id, | 619 pointer_id, |
| 607 base::TimeDelta::FromMicroseconds(timestamp)); | 620 base::TimeDelta::FromMicroseconds(timestamp)); |
| 608 SendEventToProcessor(&event); | 621 SendEventToProcessor(&event); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 } | 771 } |
| 759 | 772 |
| 760 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 773 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
| 761 if (flags == event_flags_) | 774 if (flags == event_flags_) |
| 762 return; | 775 return; |
| 763 event_flags_ = flags; | 776 event_flags_ = flags; |
| 764 SetVirtualKeyStates(event_flags_); | 777 SetVirtualKeyStates(event_flags_); |
| 765 } | 778 } |
| 766 | 779 |
| 767 } // namespace aura | 780 } // namespace aura |
| OLD | NEW |