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

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

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/view_unittest.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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 void RootView::OnMouseCaptureLost() { 518 void RootView::OnMouseCaptureLost() {
519 // TODO: this likely needs to reset touch handler too. 519 // TODO: this likely needs to reset touch handler too.
520 520
521 if (mouse_pressed_handler_ || gesture_handler_) { 521 if (mouse_pressed_handler_ || gesture_handler_) {
522 // Synthesize a release event for UpdateCursor. 522 // Synthesize a release event for UpdateCursor.
523 if (mouse_pressed_handler_) { 523 if (mouse_pressed_handler_) {
524 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_); 524 gfx::Point last_point(last_mouse_event_x_, last_mouse_event_y_);
525 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, 525 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED,
526 last_point, last_point, 526 last_point, last_point,
527 last_mouse_event_flags_); 527 last_mouse_event_flags_,
528 0);
528 UpdateCursor(release_event); 529 UpdateCursor(release_event);
529 } 530 }
530 // We allow the view to delete us from OnMouseCaptureLost. As such, 531 // We allow the view to delete us from OnMouseCaptureLost. As such,
531 // configure state such that we're done first, then call View. 532 // configure state such that we're done first, then call View.
532 View* mouse_pressed_handler = mouse_pressed_handler_; 533 View* mouse_pressed_handler = mouse_pressed_handler_;
533 View* gesture_handler = gesture_handler_; 534 View* gesture_handler = gesture_handler_;
534 SetMouseHandler(NULL); 535 SetMouseHandler(NULL);
535 if (mouse_pressed_handler) 536 if (mouse_pressed_handler)
536 mouse_pressed_handler->OnMouseCaptureLost(); 537 mouse_pressed_handler->OnMouseCaptureLost();
537 else 538 else
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 return; 739 return;
739 } 740 }
740 } 741 }
741 742
742 bool RootView::CanDispatchToTarget(ui::EventTarget* target) { 743 bool RootView::CanDispatchToTarget(ui::EventTarget* target) {
743 return event_dispatch_target_ == target; 744 return event_dispatch_target_ == target;
744 } 745 }
745 746
746 } // namespace internal 747 } // namespace internal
747 } // namespace views 748 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view_unittest.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698