| 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 737 |
| 738 default: | 738 default: |
| 739 break; | 739 break; |
| 740 } | 740 } |
| 741 if (types) { | 741 if (types) { |
| 742 gfx::Point point_in_root(event->location()); | 742 gfx::Point point_in_root(event->location()); |
| 743 Window::ConvertPointToWindow(target, this, &point_in_root); | 743 Window::ConvertPointToWindow(target, this, &point_in_root); |
| 744 // Move the mouse to the new location. | 744 // Move the mouse to the new location. |
| 745 if (generate_move && point_in_root != last_mouse_location_) { | 745 if (generate_move && point_in_root != last_mouse_location_) { |
| 746 MouseEvent synth(ui::ET_MOUSE_MOVED, point_in_root, | 746 MouseEvent synth(ui::ET_MOUSE_MOVED, point_in_root, |
| 747 event->root_location(), event->flags()); | 747 event->root_location(), |
| 748 event->flags() | ui::EF_IS_SYNTHESIZED | |
| 749 ui::EF_FROM_TOUCH); |
| 748 if (DispatchMouseEventToTarget(&synth, target)) | 750 if (DispatchMouseEventToTarget(&synth, target)) |
| 749 status = ui::GESTURE_STATUS_SYNTH_MOUSE; | 751 status = ui::GESTURE_STATUS_SYNTH_MOUSE; |
| 750 } | 752 } |
| 751 for (const ui::EventType* type = types; *type != ui::ET_UNKNOWN; | 753 for (const ui::EventType* type = types; *type != ui::ET_UNKNOWN; |
| 752 ++type) { | 754 ++type) { |
| 753 int flags = event->flags(); | 755 int flags = event->flags() | ui::EF_IS_SYNTHESIZED | ui::EF_FROM_TOUCH; |
| 754 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && | 756 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && |
| 755 *type == ui::ET_MOUSE_PRESSED) | 757 *type == ui::ET_MOUSE_PRESSED) |
| 756 flags |= ui::EF_IS_DOUBLE_CLICK; | 758 flags |= ui::EF_IS_DOUBLE_CLICK; |
| 757 | 759 |
| 758 // It is necessary to set this explicitly when using XI2.2. When using | 760 // It is necessary to set this explicitly when using XI2.2. When using |
| 759 // XI < 2.2, this is always set anyway. | 761 // XI < 2.2, this is always set anyway. |
| 760 flags |= ui::EF_LEFT_MOUSE_BUTTON; | 762 flags |= ui::EF_LEFT_MOUSE_BUTTON; |
| 761 | 763 |
| 762 // DispatchMouseEventToTarget() expects coordinates in root, it'll | 764 // DispatchMouseEventToTarget() expects coordinates in root, it'll |
| 763 // convert back to |target|. | 765 // convert back to |target|. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 void RootWindow::UnlockCompositor() { | 1019 void RootWindow::UnlockCompositor() { |
| 1018 DCHECK(compositor_lock_); | 1020 DCHECK(compositor_lock_); |
| 1019 compositor_lock_ = NULL; | 1021 compositor_lock_ = NULL; |
| 1020 if (draw_on_compositor_unlock_) { | 1022 if (draw_on_compositor_unlock_) { |
| 1021 draw_on_compositor_unlock_ = false; | 1023 draw_on_compositor_unlock_ = false; |
| 1022 ScheduleDraw(); | 1024 ScheduleDraw(); |
| 1023 } | 1025 } |
| 1024 } | 1026 } |
| 1025 | 1027 |
| 1026 } // namespace aura | 1028 } // namespace aura |
| OLD | NEW |