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

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

Issue 1421713002: Explicitly convert Point to PointF for event code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip
Patch Set: pointfconvert-prod: . Created 5 years, 1 month 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 | « ui/views/widget/drop_helper.cc ('k') | ui/views/widget/widget.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/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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 } 449 }
450 450
451 void RootView::OnMouseCaptureLost() { 451 void RootView::OnMouseCaptureLost() {
452 // TODO: this likely needs to reset touch handler too. 452 // TODO: this likely needs to reset touch handler too.
453 453
454 if (mouse_pressed_handler_ || gesture_handler_) { 454 if (mouse_pressed_handler_ || gesture_handler_) {
455 // Synthesize a release event for UpdateCursor. 455 // Synthesize a release event for UpdateCursor.
456 if (mouse_pressed_handler_) { 456 if (mouse_pressed_handler_) {
457 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_); 457 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_);
458 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, last_point, 458 ui::MouseEvent release_event(
459 last_point, ui::EventTimeForNow(), 459 ui::ET_MOUSE_RELEASED, gfx::PointF(last_point),
460 last_mouse_event_flags_, 0); 460 gfx::PointF(last_point), ui::EventTimeForNow(),
461 last_mouse_event_flags_, 0);
461 UpdateCursor(release_event); 462 UpdateCursor(release_event);
462 } 463 }
463 // We allow the view to delete us from OnMouseCaptureLost. As such, 464 // We allow the view to delete us from OnMouseCaptureLost. As such,
464 // configure state such that we're done first, then call View. 465 // configure state such that we're done first, then call View.
465 View* mouse_pressed_handler = mouse_pressed_handler_; 466 View* mouse_pressed_handler = mouse_pressed_handler_;
466 View* gesture_handler = gesture_handler_; 467 View* gesture_handler = gesture_handler_;
467 SetMouseHandler(NULL); 468 SetMouseHandler(NULL);
468 if (mouse_pressed_handler) 469 if (mouse_pressed_handler)
469 mouse_pressed_handler->OnMouseCaptureLost(); 470 mouse_pressed_handler->OnMouseCaptureLost();
470 else 471 else
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 756
756 #ifndef NDEBUG 757 #ifndef NDEBUG
757 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); 758 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_));
758 #endif 759 #endif
759 760
760 return details; 761 return details;
761 } 762 }
762 763
763 } // namespace internal 764 } // namespace internal
764 } // namespace views 765 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/drop_helper.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698