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

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

Issue 160563002: Aura: don't synthesize mouse moves while holding pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added check for synthetic event Created 6 years, 10 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
« no previous file with comments | « no previous file | ui/aura/root_window_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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 client::CursorClient* cursor_client = client::GetCursorClient(window()); 784 client::CursorClient* cursor_client = client::GetCursorClient(window());
785 if (cursor_client && 785 if (cursor_client &&
786 !cursor_client->IsMouseEventsEnabled() && 786 !cursor_client->IsMouseEventsEnabled() &&
787 (event->flags() & ui::EF_IS_SYNTHESIZED)) { 787 (event->flags() & ui::EF_IS_SYNTHESIZED)) {
788 event->SetHandled(); 788 event->SetHandled();
789 return; 789 return;
790 } 790 }
791 791
792 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) { 792 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) {
793 if (move_hold_count_) { 793 if (move_hold_count_) {
794 if (!(event->flags() & ui::EF_IS_SYNTHESIZED) &&
795 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) {
796 SetLastMouseLocation(window(), event->root_location());
797 }
794 held_move_event_.reset(new ui::MouseEvent(*event, target, window())); 798 held_move_event_.reset(new ui::MouseEvent(*event, target, window()));
795 event->SetHandled(); 799 event->SetHandled();
796 return; 800 return;
797 } else { 801 } else {
798 // We may have a held event for a period between the time move_hold_count_ 802 // We may have a held event for a period between the time move_hold_count_
799 // fell to 0 and the DispatchHeldEvents executes. Since we're going to 803 // fell to 0 and the DispatchHeldEvents executes. Since we're going to
800 // dispatch the new event directly below, we can reset the old one. 804 // dispatch the new event directly below, we can reset the old one.
801 held_move_event_.reset(); 805 held_move_event_.reset();
802 } 806 }
803 } 807 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 break; 906 break;
903 907
904 default: 908 default:
905 NOTREACHED(); 909 NOTREACHED();
906 break; 910 break;
907 } 911 }
908 PreDispatchLocatedEvent(target, event); 912 PreDispatchLocatedEvent(target, event);
909 } 913 }
910 914
911 } // namespace aura 915 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698