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

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

Issue 6246001: Move app/key* to ui/base/keycodes/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 "app/win/hwnd_util.h" 11 #include "app/win/hwnd_util.h"
14 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
15 #include "base/logging.h" 13 #include "base/logging.h"
16 #include "base/stl_util-inl.h" 14 #include "base/stl_util-inl.h"
17 #include "base/win/win_util.h" 15 #include "base/win/win_util.h"
18 #include "gfx/canvas_skia.h" 16 #include "gfx/canvas_skia.h"
19 #include "gfx/canvas_skia_paint.h" 17 #include "gfx/canvas_skia_paint.h"
20 #include "gfx/favicon_size.h" 18 #include "gfx/favicon_size.h"
21 #include "gfx/icon_util.h" 19 #include "gfx/icon_util.h"
22 #include "gfx/point.h" 20 #include "gfx/point.h"
23 #include "grit/app_resources.h" 21 #include "grit/app_resources.h"
22 #include "ui/base/keycodes/keyboard_codes.h"
23 #include "ui/base/keycodes/keyboard_code_conversion_win.h"
24 #include "views/focus/focus_manager.h" 24 #include "views/focus/focus_manager.h"
25 #include "views/widget/widget.h" 25 #include "views/widget/widget.h"
26 26
27 namespace views { 27 namespace views {
28 28
29 TreeView::TreeView() 29 TreeView::TreeView()
30 : tree_view_(NULL), 30 : tree_view_(NULL),
31 model_(NULL), 31 model_(NULL),
32 auto_expand_children_(false), 32 auto_expand_children_(false),
33 editable_(true), 33 editable_(true),
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 editing_node_ = NULL; 434 editing_node_ = NULL;
435 // Return value ignored. 435 // Return value ignored.
436 return 0; 436 return 0;
437 } 437 }
438 438
439 case TVN_KEYDOWN: 439 case TVN_KEYDOWN:
440 if (controller_) { 440 if (controller_) {
441 NMTVKEYDOWN* key_down_message = 441 NMTVKEYDOWN* key_down_message =
442 reinterpret_cast<NMTVKEYDOWN*>(l_param); 442 reinterpret_cast<NMTVKEYDOWN*>(l_param);
443 controller_->OnTreeViewKeyDown( 443 controller_->OnTreeViewKeyDown(
444 app::KeyboardCodeForWindowsKeyCode(key_down_message->wVKey)); 444 ui::KeyboardCodeForWindowsKeyCode(key_down_message->wVKey));
445 } 445 }
446 break; 446 break;
447 447
448 default: 448 default:
449 break; 449 break;
450 } 450 }
451 return 0; 451 return 0;
452 } 452 }
453 453
454 bool TreeView::OnKeyDown(app::KeyboardCode virtual_key_code) { 454 bool TreeView::OnKeyDown(ui::KeyboardCode virtual_key_code) {
455 if (virtual_key_code == VK_F2) { 455 if (virtual_key_code == VK_F2) {
456 if (!GetEditingNode()) { 456 if (!GetEditingNode()) {
457 TreeModelNode* selected_node = GetSelectedNode(); 457 TreeModelNode* selected_node = GetSelectedNode();
458 if (selected_node) 458 if (selected_node)
459 StartEditing(selected_node); 459 StartEditing(selected_node);
460 } 460 }
461 return true; 461 return true;
462 } else if (virtual_key_code == app::VKEY_RETURN && !process_enter_) { 462 } else if (virtual_key_code == ui::VKEY_RETURN && !process_enter_) {
463 Widget* widget = GetWidget(); 463 Widget* widget = GetWidget();
464 DCHECK(widget); 464 DCHECK(widget);
465 Accelerator accelerator(Accelerator(virtual_key_code, 465 Accelerator accelerator(Accelerator(virtual_key_code,
466 base::win::IsShiftPressed(), 466 base::win::IsShiftPressed(),
467 base::win::IsCtrlPressed(), 467 base::win::IsCtrlPressed(),
468 base::win::IsAltPressed())); 468 base::win::IsAltPressed()));
469 GetFocusManager()->ProcessAccelerator(accelerator); 469 GetFocusManager()->ProcessAccelerator(accelerator);
470 return true; 470 return true;
471 } 471 }
472 return false; 472 return false;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 759 }
760 // Fall through and let the default handler process as well. 760 // Fall through and let the default handler process as well.
761 break; 761 break;
762 } 762 }
763 WNDPROC handler = tree->original_handler_; 763 WNDPROC handler = tree->original_handler_;
764 DCHECK(handler); 764 DCHECK(handler);
765 return CallWindowProc(handler, window, message, w_param, l_param); 765 return CallWindowProc(handler, window, message, w_param, l_param);
766 } 766 }
767 767
768 } // namespace views 768 } // 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