OLD | NEW |
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/controls/tree/tree_view_win.h" | 5 #include "ui/views/controls/tree/tree_view_win.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 return; | 489 return; |
490 } | 490 } |
491 | 491 |
492 if (show_context_menu_only_when_node_selected_) { | 492 if (show_context_menu_only_when_node_selected_) { |
493 if (!GetSelectedNode()) | 493 if (!GetSelectedNode()) |
494 return; | 494 return; |
495 | 495 |
496 // Make sure the mouse is over the selected node. | 496 // Make sure the mouse is over the selected node. |
497 TVHITTESTINFO hit_info; | 497 TVHITTESTINFO hit_info; |
498 gfx::Point local_loc(location); | 498 gfx::Point local_loc(location); |
499 ConvertPointToView(NULL, this, &local_loc); | 499 ConvertPointToTarget(NULL, this, &local_loc); |
500 hit_info.pt = local_loc.ToPOINT(); | 500 hit_info.pt = local_loc.ToPOINT(); |
501 HTREEITEM hit_item = TreeView_HitTest(tree_view_, &hit_info); | 501 HTREEITEM hit_item = TreeView_HitTest(tree_view_, &hit_info); |
502 if (!hit_item || | 502 if (!hit_item || |
503 GetNodeDetails(GetSelectedNode())->tree_item != hit_item || | 503 GetNodeDetails(GetSelectedNode())->tree_item != hit_item || |
504 (hit_info.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT | | 504 (hit_info.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT | |
505 TVHT_ONITEMINDENT)) == 0) { | 505 TVHT_ONITEMINDENT)) == 0) { |
506 return; | 506 return; |
507 } | 507 } |
508 } | 508 } |
509 ShowContextMenu(gfx::Point(location), true); | 509 ShowContextMenu(gfx::Point(location), true); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 795 } |
796 // Fall through and let the default handler process as well. | 796 // Fall through and let the default handler process as well. |
797 break; | 797 break; |
798 } | 798 } |
799 WNDPROC handler = tree->original_handler_; | 799 WNDPROC handler = tree->original_handler_; |
800 DCHECK(handler); | 800 DCHECK(handler); |
801 return CallWindowProc(handler, window, message, w_param, l_param); | 801 return CallWindowProc(handler, window, message, w_param, l_param); |
802 } | 802 } |
803 | 803 |
804 } // namespace views | 804 } // namespace views |
OLD | NEW |