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

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

Issue 10388198: ash: Add the SYNTHETIC flag to mouse-events generated from gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: EF_FROM_TOUCH Created 8 years, 7 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/aura.gyp ('k') | ui/aura/shared/root_window_event_filter_unittest.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/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
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
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
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/shared/root_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698