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

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

Issue 12093075: Move the panel to the root window where the mouse click occurred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comment Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc ('k') | no next file » | 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.h" 10 #include "base/message_loop.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 return false; 492 return false;
493 } 493 }
494 494
495 void RootView::OnMouseReleased(const ui::MouseEvent& event) { 495 void RootView::OnMouseReleased(const ui::MouseEvent& event) {
496 UpdateCursor(event); 496 UpdateCursor(event);
497 497
498 if (mouse_pressed_handler_) { 498 if (mouse_pressed_handler_) {
499 ui::MouseEvent mouse_released(event, static_cast<View*>(this), 499 ui::MouseEvent mouse_released(event, static_cast<View*>(this),
500 mouse_pressed_handler_); 500 mouse_pressed_handler_);
501 // TODO(sadrul|oshima): This is tentative solution to pass target
502 // to LauncherDelegate::ItemClicked. Remove this once crbug.com/173235
503 // is implemented.
504 ui::Event::DispatcherApi api(&mouse_released);
505 api.set_target(this);
506
501 // We allow the view to delete us from ProcessMouseReleased. As such, 507 // We allow the view to delete us from ProcessMouseReleased. As such,
502 // configure state such that we're done first, then call View. 508 // configure state such that we're done first, then call View.
503 View* mouse_pressed_handler = mouse_pressed_handler_; 509 View* mouse_pressed_handler = mouse_pressed_handler_;
504 SetMouseHandler(NULL); 510 SetMouseHandler(NULL);
505 mouse_pressed_handler->ProcessMouseReleased(mouse_released); 511 mouse_pressed_handler->ProcessMouseReleased(mouse_released);
506 // WARNING: we may have been deleted. 512 // WARNING: we may have been deleted.
507 } 513 }
508 } 514 }
509 515
510 void RootView::OnMouseCaptureLost() { 516 void RootView::OnMouseCaptureLost() {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 668 }
663 669
664 void RootView::SetMouseLocationAndFlags(const ui::MouseEvent& event) { 670 void RootView::SetMouseLocationAndFlags(const ui::MouseEvent& event) {
665 last_mouse_event_flags_ = event.flags(); 671 last_mouse_event_flags_ = event.flags();
666 last_mouse_event_x_ = event.x(); 672 last_mouse_event_x_ = event.x();
667 last_mouse_event_y_ = event.y(); 673 last_mouse_event_y_ = event.y();
668 } 674 }
669 675
670 } // namespace internal 676 } // namespace internal
671 } // namespace views 677 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698