| 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 "views/controls/tree/tree_view.h" | 5 #include "views/controls/tree/tree_view.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlmisc.h> | 9 #include <atlmisc.h> |
| 10 | 10 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 if (virtual_key_code == VK_F2) { | 464 if (virtual_key_code == VK_F2) { |
| 465 if (!GetEditingNode()) { | 465 if (!GetEditingNode()) { |
| 466 TreeModelNode* selected_node = GetSelectedNode(); | 466 TreeModelNode* selected_node = GetSelectedNode(); |
| 467 if (selected_node) | 467 if (selected_node) |
| 468 StartEditing(selected_node); | 468 StartEditing(selected_node); |
| 469 } | 469 } |
| 470 return true; | 470 return true; |
| 471 } else if (virtual_key_code == VK_RETURN && !process_enter_) { | 471 } else if (virtual_key_code == VK_RETURN && !process_enter_) { |
| 472 Widget* widget = GetWidget(); | 472 Widget* widget = GetWidget(); |
| 473 DCHECK(widget); | 473 DCHECK(widget); |
| 474 FocusManager* fm = FocusManager::GetFocusManager(widget->GetNativeView()); |
| 475 DCHECK(fm); |
| 474 Accelerator accelerator(Accelerator(static_cast<int>(virtual_key_code), | 476 Accelerator accelerator(Accelerator(static_cast<int>(virtual_key_code), |
| 475 win_util::IsShiftPressed(), | 477 win_util::IsShiftPressed(), |
| 476 win_util::IsCtrlPressed(), | 478 win_util::IsCtrlPressed(), |
| 477 win_util::IsAltPressed())); | 479 win_util::IsAltPressed())); |
| 478 GetFocusManager()->ProcessAccelerator(accelerator); | 480 fm->ProcessAccelerator(accelerator); |
| 479 return true; | 481 return true; |
| 480 } | 482 } |
| 481 return false; | 483 return false; |
| 482 } | 484 } |
| 483 | 485 |
| 484 void TreeView::OnContextMenu(const WTL::CPoint& location) { | 486 void TreeView::OnContextMenu(const WTL::CPoint& location) { |
| 485 if (!GetContextMenuController()) | 487 if (!GetContextMenuController()) |
| 486 return; | 488 return; |
| 487 | 489 |
| 488 if (location.x == -1 && location.y == -1) { | 490 if (location.x == -1 && location.y == -1) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 } | 738 } |
| 737 // Fall through and let the default handler process as well. | 739 // Fall through and let the default handler process as well. |
| 738 break; | 740 break; |
| 739 } | 741 } |
| 740 WNDPROC handler = tree->original_handler_; | 742 WNDPROC handler = tree->original_handler_; |
| 741 DCHECK(handler); | 743 DCHECK(handler); |
| 742 return CallWindowProc(handler, window, message, w_param, l_param); | 744 return CallWindowProc(handler, window, message, w_param, l_param); |
| 743 } | 745 } |
| 744 | 746 |
| 745 } // namespace views | 747 } // namespace views |
| OLD | NEW |