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

Side by Side Diff: ui/views/widget/root_view.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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
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/views/widget/root_view.h" 5 #include "ui/views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 } 443 }
444 } 444 }
445 445
446 void RootView::OnMouseCaptureLost() { 446 void RootView::OnMouseCaptureLost() {
447 // TODO: this likely needs to reset touch handler too. 447 // TODO: this likely needs to reset touch handler too.
448 448
449 if (mouse_pressed_handler_ || gesture_handler_) { 449 if (mouse_pressed_handler_ || gesture_handler_) {
450 // Synthesize a release event for UpdateCursor. 450 // Synthesize a release event for UpdateCursor.
451 if (mouse_pressed_handler_) { 451 if (mouse_pressed_handler_) {
452 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_); 452 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_);
453 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, last_point, 453 ui::MouseEvent release_event(
454 last_point, ui::EventTimeForNow(), 454 ui::ET_MOUSE_RELEASED, last_point, last_point, ui::EventTimeForNow(),
455 last_mouse_event_flags_, 0); 455 last_mouse_event_flags_, 0,
456 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE,
457 ui::PointerEvent::kMousePointerId));
456 UpdateCursor(release_event); 458 UpdateCursor(release_event);
457 } 459 }
458 // We allow the view to delete us from OnMouseCaptureLost. As such, 460 // We allow the view to delete us from OnMouseCaptureLost. As such,
459 // configure state such that we're done first, then call View. 461 // configure state such that we're done first, then call View.
460 View* mouse_pressed_handler = mouse_pressed_handler_; 462 View* mouse_pressed_handler = mouse_pressed_handler_;
461 View* gesture_handler = gesture_handler_; 463 View* gesture_handler = gesture_handler_;
462 SetMouseHandler(NULL); 464 SetMouseHandler(NULL);
463 if (mouse_pressed_handler) 465 if (mouse_pressed_handler)
464 mouse_pressed_handler->OnMouseCaptureLost(); 466 mouse_pressed_handler->OnMouseCaptureLost();
465 else 467 else
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 752
751 #ifndef NDEBUG 753 #ifndef NDEBUG
752 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); 754 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_));
753 #endif 755 #endif
754 756
755 return details; 757 return details;
756 } 758 }
757 759
758 } // namespace internal 760 } // namespace internal
759 } // namespace views 761 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698