Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 | 446 |
| 447 ///////////////////////////////////////////////////////////////////////////// | 447 ///////////////////////////////////////////////////////////////////////////// |
| 448 // | 448 // |
| 449 // View - tree | 449 // View - tree |
| 450 // | 450 // |
| 451 ///////////////////////////////////////////////////////////////////////////// | 451 ///////////////////////////////////////////////////////////////////////////// |
| 452 | 452 |
| 453 bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) { | 453 bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) { |
| 454 const bool enabled = enabled_; | 454 const bool enabled = enabled_; |
| 455 int drag_operations; | 455 int drag_operations; |
| 456 if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location())) | 456 if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location())) |
|
Peter Kasting
2009/02/18 16:58:25
Nit: Maybe this should also be changed to IsLeftMo
idanan
2009/02/18 18:02:23
Tried to drag with both left and right buttons on
Peter Kasting
2009/02/18 18:04:30
Did you try left + middle?
idanan
2009/02/18 18:12:25
Seems like Windows has some complicated logic ther
| |
| 457 drag_operations = GetDragOperations(e.x(), e.y()); | 457 drag_operations = GetDragOperations(e.x(), e.y()); |
| 458 else | 458 else |
| 459 drag_operations = 0; | 459 drag_operations = 0; |
| 460 ContextMenuController* context_menu_controller = context_menu_controller_; | 460 ContextMenuController* context_menu_controller = |
| 461 e.IsRightMouseButton()? context_menu_controller_ : 0; | |
| 461 | 462 |
| 462 const bool result = OnMousePressed(e); | 463 const bool result = OnMousePressed(e); |
| 463 // WARNING: we may have been deleted, don't use any View variables; | 464 // WARNING: we may have been deleted, don't use any View variables; |
| 464 | 465 |
| 465 if (!enabled) | 466 if (!enabled) |
| 466 return result; | 467 return result; |
| 467 | 468 |
| 468 if (drag_operations != DragDropTypes::DRAG_NONE) { | 469 if (drag_operations != DragDropTypes::DRAG_NONE) { |
| 469 drag_info->PossibleDrag(e.x(), e.y()); | 470 drag_info->PossibleDrag(e.x(), e.y()); |
| 470 return true; | 471 return true; |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1589 } | 1590 } |
| 1590 | 1591 |
| 1591 void View::DragInfo::PossibleDrag(int x, int y) { | 1592 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1592 possible_drag = true; | 1593 possible_drag = true; |
| 1593 start_x = x; | 1594 start_x = x; |
| 1594 start_y = y; | 1595 start_y = y; |
| 1595 } | 1596 } |
| 1596 | 1597 |
| 1597 } // namespace | 1598 } // namespace |
| 1598 | 1599 |
| OLD | NEW |