Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: views/controls/tree/tree_view.cc

Issue 3337006: Revert 58388 - Revert 58215 - Revert 58186 - Move the keyboard files from bas... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/tree/tree_view.h ('k') | views/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 7 #include <vector>
8 8
9 #include "app/keyboard_code_conversion_win.h"
10 #include "app/keyboard_codes.h"
11 #include "app/l10n_util_win.h" 9 #include "app/l10n_util_win.h"
12 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
13 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/keyboard_codes.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
15 #include "base/stl_util-inl.h" 14 #include "base/stl_util-inl.h"
16 #include "base/win_util.h" 15 #include "base/win_util.h"
17 #include "gfx/canvas_skia.h" 16 #include "gfx/canvas_skia.h"
18 #include "gfx/canvas_skia_paint.h" 17 #include "gfx/canvas_skia_paint.h"
19 #include "gfx/favicon_size.h" 18 #include "gfx/favicon_size.h"
20 #include "gfx/icon_util.h" 19 #include "gfx/icon_util.h"
21 #include "gfx/point.h" 20 #include "gfx/point.h"
22 #include "grit/app_resources.h" 21 #include "grit/app_resources.h"
23 #include "views/focus/focus_manager.h" 22 #include "views/focus/focus_manager.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 editing_node_ = NULL; 441 editing_node_ = NULL;
443 // Return value ignored. 442 // Return value ignored.
444 return 0; 443 return 0;
445 } 444 }
446 445
447 case TVN_KEYDOWN: 446 case TVN_KEYDOWN:
448 if (controller_) { 447 if (controller_) {
449 NMTVKEYDOWN* key_down_message = 448 NMTVKEYDOWN* key_down_message =
450 reinterpret_cast<NMTVKEYDOWN*>(l_param); 449 reinterpret_cast<NMTVKEYDOWN*>(l_param);
451 controller_->OnTreeViewKeyDown( 450 controller_->OnTreeViewKeyDown(
452 app::KeyboardCodeForWindowsKeyCode(key_down_message->wVKey)); 451 win_util::WinToKeyboardCode(key_down_message->wVKey));
453 } 452 }
454 break; 453 break;
455 454
456 default: 455 default:
457 break; 456 break;
458 } 457 }
459 return 0; 458 return 0;
460 } 459 }
461 460
462 bool TreeView::OnKeyDown(app::KeyboardCode virtual_key_code) { 461 bool TreeView::OnKeyDown(base::KeyboardCode virtual_key_code) {
463 if (virtual_key_code == VK_F2) { 462 if (virtual_key_code == VK_F2) {
464 if (!GetEditingNode()) { 463 if (!GetEditingNode()) {
465 TreeModelNode* selected_node = GetSelectedNode(); 464 TreeModelNode* selected_node = GetSelectedNode();
466 if (selected_node) 465 if (selected_node)
467 StartEditing(selected_node); 466 StartEditing(selected_node);
468 } 467 }
469 return true; 468 return true;
470 } else if (virtual_key_code == app::VKEY_RETURN && !process_enter_) { 469 } else if (virtual_key_code == base::VKEY_RETURN && !process_enter_) {
471 Widget* widget = GetWidget(); 470 Widget* widget = GetWidget();
472 DCHECK(widget); 471 DCHECK(widget);
473 Accelerator accelerator(Accelerator(virtual_key_code, 472 Accelerator accelerator(Accelerator(virtual_key_code,
474 win_util::IsShiftPressed(), 473 win_util::IsShiftPressed(),
475 win_util::IsCtrlPressed(), 474 win_util::IsCtrlPressed(),
476 win_util::IsAltPressed())); 475 win_util::IsAltPressed()));
477 GetFocusManager()->ProcessAccelerator(accelerator); 476 GetFocusManager()->ProcessAccelerator(accelerator);
478 return true; 477 return true;
479 } 478 }
480 return false; 479 return false;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 766 }
768 // Fall through and let the default handler process as well. 767 // Fall through and let the default handler process as well.
769 break; 768 break;
770 } 769 }
771 WNDPROC handler = tree->original_handler_; 770 WNDPROC handler = tree->original_handler_;
772 DCHECK(handler); 771 DCHECK(handler);
773 return CallWindowProc(handler, window, message, w_param, l_param); 772 return CallWindowProc(handler, window, message, w_param, l_param);
774 } 773 }
775 774
776 } // namespace views 775 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/tree/tree_view.h ('k') | views/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698