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

Side by Side Diff: chrome/views/view.cc

Issue 43009: Context menus only opens if the mouse are released in the same view as it was... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/views/view.h" 5 #include "chrome/views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #ifndef NDEBUG 9 #ifndef NDEBUG
10 #include <iostream> 10 #include <iostream>
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 } 492 }
493 // WARNING: we may have been deleted. 493 // WARNING: we may have been deleted.
494 return (context_menu_controller != NULL) || possible_drag; 494 return (context_menu_controller != NULL) || possible_drag;
495 } 495 }
496 496
497 void View::ProcessMouseReleased(const MouseEvent& e, bool canceled) { 497 void View::ProcessMouseReleased(const MouseEvent& e, bool canceled) {
498 if (!canceled && context_menu_controller_ && e.IsOnlyRightMouseButton()) { 498 if (!canceled && context_menu_controller_ && e.IsOnlyRightMouseButton()) {
499 // Assume that if there is a context menu controller we won't be deleted 499 // Assume that if there is a context menu controller we won't be deleted
500 // from mouse released. 500 // from mouse released.
501 gfx::Point location(e.location()); 501 gfx::Point location(e.location());
502 ConvertPointToScreen(this, &location);
503 OnMouseReleased(e, canceled); 502 OnMouseReleased(e, canceled);
504 ShowContextMenu(location.x(), location.y(), true); 503 if (HitTest(location)) {
504 ConvertPointToScreen(this, &location);
505 ShowContextMenu(location.x(), location.y(), true);
506 }
505 } else { 507 } else {
506 OnMouseReleased(e, canceled); 508 OnMouseReleased(e, canceled);
507 } 509 }
508 // WARNING: we may have been deleted. 510 // WARNING: we may have been deleted.
509 } 511 }
510 512
511 void View::AddChildView(View* v) { 513 void View::AddChildView(View* v) {
512 AddChildView(static_cast<int>(child_views_.size()), v, false); 514 AddChildView(static_cast<int>(child_views_.size()), v, false);
513 } 515 }
514 516
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 start_x = start_y = 0; 1612 start_x = start_y = 0;
1611 } 1613 }
1612 1614
1613 void View::DragInfo::PossibleDrag(int x, int y) { 1615 void View::DragInfo::PossibleDrag(int x, int y) {
1614 possible_drag = true; 1616 possible_drag = true;
1615 start_x = x; 1617 start_x = x;
1616 start_y = y; 1618 start_y = y;
1617 } 1619 }
1618 1620
1619 } // namespace 1621 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698