| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // | 454 // |
| 455 ///////////////////////////////////////////////////////////////////////////// | 455 ///////////////////////////////////////////////////////////////////////////// |
| 456 | 456 |
| 457 bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) { | 457 bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) { |
| 458 const bool enabled = enabled_; | 458 const bool enabled = enabled_; |
| 459 int drag_operations; | 459 int drag_operations; |
| 460 if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location())) | 460 if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.location())) |
| 461 drag_operations = GetDragOperations(e.x(), e.y()); | 461 drag_operations = GetDragOperations(e.x(), e.y()); |
| 462 else | 462 else |
| 463 drag_operations = 0; | 463 drag_operations = 0; |
| 464 ContextMenuController* context_menu_controller = | 464 ContextMenuController* context_menu_controller = context_menu_controller_; |
| 465 e.IsRightMouseButton()? context_menu_controller_ : 0; | |
| 466 | 465 |
| 467 const bool result = OnMousePressed(e); | 466 const bool result = OnMousePressed(e); |
| 468 // WARNING: we may have been deleted, don't use any View variables; | 467 // WARNING: we may have been deleted, don't use any View variables; |
| 469 | 468 |
| 470 if (!enabled) | 469 if (!enabled) |
| 471 return result; | 470 return result; |
| 472 | 471 |
| 473 if (drag_operations != DragDropTypes::DRAG_NONE) { | 472 if (drag_operations != DragDropTypes::DRAG_NONE) { |
| 474 drag_info->PossibleDrag(e.x(), e.y()); | 473 drag_info->PossibleDrag(e.x(), e.y()); |
| 475 return true; | 474 return true; |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 } | 1602 } |
| 1604 | 1603 |
| 1605 void View::DragInfo::PossibleDrag(int x, int y) { | 1604 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1606 possible_drag = true; | 1605 possible_drag = true; |
| 1607 start_x = x; | 1606 start_x = x; |
| 1608 start_y = y; | 1607 start_y = y; |
| 1609 } | 1608 } |
| 1610 | 1609 |
| 1611 } // namespace | 1610 } // namespace |
| 1612 | 1611 |
| OLD | NEW |