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

Side by Side Diff: ui/events/event.cc

Issue 2033743003: Map ET_POINTER_MOVED to ET_MOUSE_DRAGGED when a mouse button is down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/events/event_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/events/event.h" 5 #include "ui/events/event.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 10
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 MouseEvent::MouseEvent(const PointerEvent& pointer_event) 465 MouseEvent::MouseEvent(const PointerEvent& pointer_event)
466 : LocatedEvent(pointer_event), 466 : LocatedEvent(pointer_event),
467 pointer_details_(pointer_event.pointer_details()) { 467 pointer_details_(pointer_event.pointer_details()) {
468 DCHECK(pointer_event.IsMousePointerEvent()); 468 DCHECK(pointer_event.IsMousePointerEvent());
469 switch (pointer_event.type()) { 469 switch (pointer_event.type()) {
470 case ET_POINTER_DOWN: 470 case ET_POINTER_DOWN:
471 SetType(ET_MOUSE_PRESSED); 471 SetType(ET_MOUSE_PRESSED);
472 break; 472 break;
473 473
474 case ET_POINTER_MOVED: 474 case ET_POINTER_MOVED:
475 SetType(ET_MOUSE_MOVED); 475 if (pointer_event.flags() &
476 (EF_LEFT_MOUSE_BUTTON | EF_MIDDLE_MOUSE_BUTTON |
477 EF_RIGHT_MOUSE_BUTTON)) {
478 SetType(ET_MOUSE_DRAGGED);
479 } else {
480 SetType(ET_MOUSE_MOVED);
481 }
476 break; 482 break;
477 483
478 case ET_POINTER_ENTERED: 484 case ET_POINTER_ENTERED:
479 SetType(ET_MOUSE_ENTERED); 485 SetType(ET_MOUSE_ENTERED);
480 break; 486 break;
481 487
482 case ET_POINTER_EXITED: 488 case ET_POINTER_EXITED:
483 SetType(ET_MOUSE_EXITED); 489 SetType(ET_MOUSE_EXITED);
484 break; 490 break;
485 491
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 gfx::PointF(x, y), 1282 gfx::PointF(x, y),
1277 time_stamp, 1283 time_stamp,
1278 flags | EF_FROM_TOUCH), 1284 flags | EF_FROM_TOUCH),
1279 details_(details) { 1285 details_(details) {
1280 } 1286 }
1281 1287
1282 GestureEvent::~GestureEvent() { 1288 GestureEvent::~GestureEvent() {
1283 } 1289 }
1284 1290
1285 } // namespace ui 1291 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698