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

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: description 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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 client::CursorClient* cursor_client = client::GetCursorClient(window()); 823 client::CursorClient* cursor_client = client::GetCursorClient(window());
824 if (cursor_client && 824 if (cursor_client &&
825 !cursor_client->IsMouseEventsEnabled() && 825 !cursor_client->IsMouseEventsEnabled() &&
826 (event->flags() & ui::EF_IS_SYNTHESIZED)) { 826 (event->flags() & ui::EF_IS_SYNTHESIZED)) {
827 event->SetHandled(); 827 event->SetHandled();
828 return; 828 return;
829 } 829 }
830 830
831 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) { 831 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) {
832 if (move_hold_count_) { 832 if (move_hold_count_) {
833 if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)
sky 2014/02/14 16:40:05 I think you should be selective here. Meaning use
dgozman 2014/02/17 14:19:59 It's inside PreDispatchMouseEvent. The only mouse
834 SetLastMouseLocation(window(), event->root_location());
833 held_move_event_.reset(new ui::MouseEvent(*event, target, window())); 835 held_move_event_.reset(new ui::MouseEvent(*event, target, window()));
834 event->SetHandled(); 836 event->SetHandled();
835 return; 837 return;
836 } else { 838 } else {
837 // We may have a held event for a period between the time move_hold_count_ 839 // We may have a held event for a period between the time move_hold_count_
838 // fell to 0 and the DispatchHeldEvents executes. Since we're going to 840 // fell to 0 and the DispatchHeldEvents executes. Since we're going to
839 // dispatch the new event directly below, we can reset the old one. 841 // dispatch the new event directly below, we can reset the old one.
840 held_move_event_.reset(); 842 held_move_event_.reset();
841 } 843 }
842 } 844 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 break; 943 break;
942 944
943 default: 945 default:
944 NOTREACHED(); 946 NOTREACHED();
945 break; 947 break;
946 } 948 }
947 PreDispatchLocatedEvent(target, event); 949 PreDispatchLocatedEvent(target, event);
948 } 950 }
949 951
950 } // namespace aura 952 } // 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