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

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

Issue 3361003: Revert 58215 - Revert 58186 - Move the keyboard files from base/ to app/.... (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"
9 #include "app/l10n_util_win.h" 11 #include "app/l10n_util_win.h"
10 #include "app/resource_bundle.h" 12 #include "app/resource_bundle.h"
11 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
12 #include "base/keyboard_codes.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/stl_util-inl.h" 15 #include "base/stl_util-inl.h"
15 #include "base/win_util.h" 16 #include "base/win_util.h"
16 #include "gfx/canvas_skia.h" 17 #include "gfx/canvas_skia.h"
17 #include "gfx/canvas_skia_paint.h" 18 #include "gfx/canvas_skia_paint.h"
18 #include "gfx/favicon_size.h" 19 #include "gfx/favicon_size.h"
19 #include "gfx/icon_util.h" 20 #include "gfx/icon_util.h"
20 #include "gfx/point.h" 21 #include "gfx/point.h"
21 #include "grit/app_resources.h" 22 #include "grit/app_resources.h"
22 #include "views/focus/focus_manager.h" 23 #include "views/focus/focus_manager.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 editing_node_ = NULL; 442 editing_node_ = NULL;
442 // Return value ignored. 443 // Return value ignored.
443 return 0; 444 return 0;
444 } 445 }
445 446
446 case TVN_KEYDOWN: 447 case TVN_KEYDOWN:
447 if (controller_) { 448 if (controller_) {
448 NMTVKEYDOWN* key_down_message = 449 NMTVKEYDOWN* key_down_message =
449 reinterpret_cast<NMTVKEYDOWN*>(l_param); 450 reinterpret_cast<NMTVKEYDOWN*>(l_param);
450 controller_->OnTreeViewKeyDown( 451 controller_->OnTreeViewKeyDown(
451 win_util::WinToKeyboardCode(key_down_message->wVKey)); 452 app::KeyboardCodeForWindowsKeyCode(key_down_message->wVKey));
452 } 453 }
453 break; 454 break;
454 455
455 default: 456 default:
456 break; 457 break;
457 } 458 }
458 return 0; 459 return 0;
459 } 460 }
460 461
461 bool TreeView::OnKeyDown(base::KeyboardCode virtual_key_code) { 462 bool TreeView::OnKeyDown(app::KeyboardCode virtual_key_code) {
462 if (virtual_key_code == VK_F2) { 463 if (virtual_key_code == VK_F2) {
463 if (!GetEditingNode()) { 464 if (!GetEditingNode()) {
464 TreeModelNode* selected_node = GetSelectedNode(); 465 TreeModelNode* selected_node = GetSelectedNode();
465 if (selected_node) 466 if (selected_node)
466 StartEditing(selected_node); 467 StartEditing(selected_node);
467 } 468 }
468 return true; 469 return true;
469 } else if (virtual_key_code == base::VKEY_RETURN && !process_enter_) { 470 } else if (virtual_key_code == app::VKEY_RETURN && !process_enter_) {
470 Widget* widget = GetWidget(); 471 Widget* widget = GetWidget();
471 DCHECK(widget); 472 DCHECK(widget);
472 Accelerator accelerator(Accelerator(virtual_key_code, 473 Accelerator accelerator(Accelerator(virtual_key_code,
473 win_util::IsShiftPressed(), 474 win_util::IsShiftPressed(),
474 win_util::IsCtrlPressed(), 475 win_util::IsCtrlPressed(),
475 win_util::IsAltPressed())); 476 win_util::IsAltPressed()));
476 GetFocusManager()->ProcessAccelerator(accelerator); 477 GetFocusManager()->ProcessAccelerator(accelerator);
477 return true; 478 return true;
478 } 479 }
479 return false; 480 return false;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 767 }
767 // Fall through and let the default handler process as well. 768 // Fall through and let the default handler process as well.
768 break; 769 break;
769 } 770 }
770 WNDPROC handler = tree->original_handler_; 771 WNDPROC handler = tree->original_handler_;
771 DCHECK(handler); 772 DCHECK(handler);
772 return CallWindowProc(handler, window, message, w_param, l_param); 773 return CallWindowProc(handler, window, message, w_param, l_param);
773 } 774 }
774 775
775 } // namespace views 776 } // 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