| 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); | |
| 476 Accelerator accelerator(Accelerator(static_cast<int>(virtual_key_code), | 474 Accelerator accelerator(Accelerator(static_cast<int>(virtual_key_code), |
| 477 win_util::IsShiftPressed(), | 475 win_util::IsShiftPressed(), |
| 478 win_util::IsCtrlPressed(), | 476 win_util::IsCtrlPressed(), |
| 479 win_util::IsAltPressed())); | 477 win_util::IsAltPressed())); |
| 480 fm->ProcessAccelerator(accelerator); | 478 GetFocusManager()->ProcessAccelerator(accelerator); |
| 481 return true; | 479 return true; |
| 482 } | 480 } |
| 483 return false; | 481 return false; |
| 484 } | 482 } |
| 485 | 483 |
| 486 void TreeView::OnContextMenu(const WTL::CPoint& location) { | 484 void TreeView::OnContextMenu(const WTL::CPoint& location) { |
| 487 if (!GetContextMenuController()) | 485 if (!GetContextMenuController()) |
| 488 return; | 486 return; |
| 489 | 487 |
| 490 if (location.x == -1 && location.y == -1) { | 488 if (location.x == -1 && location.y == -1) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 736 } |
| 739 // Fall through and let the default handler process as well. | 737 // Fall through and let the default handler process as well. |
| 740 break; | 738 break; |
| 741 } | 739 } |
| 742 WNDPROC handler = tree->original_handler_; | 740 WNDPROC handler = tree->original_handler_; |
| 743 DCHECK(handler); | 741 DCHECK(handler); |
| 744 return CallWindowProc(handler, window, message, w_param, l_param); | 742 return CallWindowProc(handler, window, message, w_param, l_param); |
| 745 } | 743 } |
| 746 | 744 |
| 747 } // namespace views | 745 } // namespace views |
| OLD | NEW |