| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 487 } |
| 488 host_->Send(new MetroViewerHostMsg_ImeTextInputClientUpdated( | 488 host_->Send(new MetroViewerHostMsg_ImeTextInputClientUpdated( |
| 489 input_scopes, character_bounds)); | 489 input_scopes, character_bounds)); |
| 490 } | 490 } |
| 491 | 491 |
| 492 void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { | 492 void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { |
| 493 if (ignore_mouse_moves_until_set_cursor_ack_) | 493 if (ignore_mouse_moves_until_set_cursor_ack_) |
| 494 return; | 494 return; |
| 495 | 495 |
| 496 gfx::Point location(x, y); | 496 gfx::Point location(x, y); |
| 497 ui::MouseEvent event(ui::ET_MOUSE_MOVED, location, location, flags); | 497 ui::MouseEvent event(ui::ET_MOUSE_MOVED, location, location, flags, 0); |
| 498 delegate_->OnHostMouseEvent(&event); | 498 delegate_->OnHostMouseEvent(&event); |
| 499 } | 499 } |
| 500 | 500 |
| 501 void RemoteRootWindowHostWin::OnMouseButton( | 501 void RemoteRootWindowHostWin::OnMouseButton( |
| 502 int32 x, | 502 int32 x, |
| 503 int32 y, | 503 int32 y, |
| 504 int32 extra, | 504 int32 extra, |
| 505 ui::EventType type, | 505 ui::EventType type, |
| 506 ui::EventFlags flags) { | 506 ui::EventFlags flags) { |
| 507 gfx::Point location(x, y); | 507 gfx::Point location(x, y); |
| 508 ui::MouseEvent mouse_event(type, location, location, flags); | 508 // TODO: this needs to pass in changed flags. |
| 509 ui::MouseEvent mouse_event(type, location, location, flags, 0); |
| 509 | 510 |
| 510 SetEventFlags(flags | key_event_flags()); | 511 SetEventFlags(flags | key_event_flags()); |
| 511 if (type == ui::ET_MOUSEWHEEL) { | 512 if (type == ui::ET_MOUSEWHEEL) { |
| 512 ui::MouseWheelEvent wheel_event(mouse_event, 0, extra); | 513 ui::MouseWheelEvent wheel_event(mouse_event, 0, extra); |
| 513 delegate_->OnHostMouseEvent(&wheel_event); | 514 delegate_->OnHostMouseEvent(&wheel_event); |
| 514 } else if (type == ui::ET_MOUSE_PRESSED) { | 515 } else if (type == ui::ET_MOUSE_PRESSED) { |
| 515 // TODO(shrikant): Ideally modify code in event.cc by adding automatic | 516 // TODO(shrikant): Ideally modify code in event.cc by adding automatic |
| 516 // tracking of double clicks in synthetic MouseEvent constructor code. | 517 // tracking of double clicks in synthetic MouseEvent constructor code. |
| 517 // Non-synthetic MouseEvent constructor code does automatically track | 518 // Non-synthetic MouseEvent constructor code does automatically track |
| 518 // this. Need to use some caution while modifying synthetic constructor | 519 // this. Need to use some caution while modifying synthetic constructor |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 } | 726 } |
| 726 | 727 |
| 727 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { | 728 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { |
| 728 if (flags == event_flags_) | 729 if (flags == event_flags_) |
| 729 return; | 730 return; |
| 730 event_flags_ = flags; | 731 event_flags_ = flags; |
| 731 SetVirtualKeyStates(event_flags_); | 732 SetVirtualKeyStates(event_flags_); |
| 732 } | 733 } |
| 733 | 734 |
| 734 } // namespace aura | 735 } // namespace aura |
| OLD | NEW |