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" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
13 #include "grit/ui_resources.h" | 13 #include "grit/ui_resources.h" |
14 #include "ui/base/accelerators/accelerator.h" | 14 #include "ui/base/accelerators/accelerator.h" |
15 #include "ui/base/accessibility/accessible_view_state.h" | 15 #include "ui/base/accessibility/accessible_view_state.h" |
| 16 #include "ui/base/events.h" |
16 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 17 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
17 #include "ui/base/keycodes/keyboard_codes.h" | 18 #include "ui/base/keycodes/keyboard_codes.h" |
18 #include "ui/base/l10n/l10n_util_win.h" | 19 #include "ui/base/l10n/l10n_util_win.h" |
19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/base/win/hwnd_util.h" | 21 #include "ui/base/win/hwnd_util.h" |
21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
22 #include "ui/gfx/canvas_skia_paint.h" | 23 #include "ui/gfx/canvas_skia_paint.h" |
23 #include "ui/gfx/favicon_size.h" | 24 #include "ui/gfx/favicon_size.h" |
24 #include "ui/gfx/icon_util.h" | 25 #include "ui/gfx/icon_util.h" |
25 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 if (virtual_key_code == VK_F2) { | 466 if (virtual_key_code == VK_F2) { |
466 if (!GetEditingNode()) { | 467 if (!GetEditingNode()) { |
467 TreeModelNode* selected_node = GetSelectedNode(); | 468 TreeModelNode* selected_node = GetSelectedNode(); |
468 if (selected_node) | 469 if (selected_node) |
469 StartEditing(selected_node); | 470 StartEditing(selected_node); |
470 } | 471 } |
471 return true; | 472 return true; |
472 } else if (virtual_key_code == ui::VKEY_RETURN && !process_enter_) { | 473 } else if (virtual_key_code == ui::VKEY_RETURN && !process_enter_) { |
473 Widget* widget = GetWidget(); | 474 Widget* widget = GetWidget(); |
474 DCHECK(widget); | 475 DCHECK(widget); |
475 ui::Accelerator accelerator(virtual_key_code, GetModifiersFromKeyState()); | 476 ui::Accelerator accelerator(virtual_key_code, |
| 477 ui::GetModifiersFromKeyState()); |
476 GetFocusManager()->ProcessAccelerator(accelerator); | 478 GetFocusManager()->ProcessAccelerator(accelerator); |
477 return true; | 479 return true; |
478 } | 480 } |
479 return false; | 481 return false; |
480 } | 482 } |
481 | 483 |
482 void TreeView::OnContextMenu(const POINT& location) { | 484 void TreeView::OnContextMenu(const POINT& location) { |
483 if (!context_menu_controller()) | 485 if (!context_menu_controller()) |
484 return; | 486 return; |
485 | 487 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 797 } |
796 // Fall through and let the default handler process as well. | 798 // Fall through and let the default handler process as well. |
797 break; | 799 break; |
798 } | 800 } |
799 WNDPROC handler = tree->original_handler_; | 801 WNDPROC handler = tree->original_handler_; |
800 DCHECK(handler); | 802 DCHECK(handler); |
801 return CallWindowProc(handler, window, message, w_param, l_param); | 803 return CallWindowProc(handler, window, message, w_param, l_param); |
802 } | 804 } |
803 | 805 |
804 } // namespace views | 806 } // namespace views |
OLD | NEW |