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

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

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "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/accessibility/accessible_view_state.h" 14 #include "ui/base/accessibility/accessible_view_state.h"
15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" 15 #include "ui/base/keycodes/keyboard_code_conversion_win.h"
16 #include "ui/base/keycodes/keyboard_codes.h" 16 #include "ui/base/keycodes/keyboard_codes.h"
17 #include "ui/base/l10n/l10n_util_win.h" 17 #include "ui/base/l10n/l10n_util_win.h"
18 #include "ui/base/models/accelerator.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/base/win/hwnd_util.h" 20 #include "ui/base/win/hwnd_util.h"
20 #include "ui/gfx/canvas_skia.h" 21 #include "ui/gfx/canvas_skia.h"
21 #include "ui/gfx/canvas_skia_paint.h" 22 #include "ui/gfx/canvas_skia_paint.h"
22 #include "ui/gfx/favicon_size.h" 23 #include "ui/gfx/favicon_size.h"
23 #include "ui/gfx/icon_util.h" 24 #include "ui/gfx/icon_util.h"
24 #include "ui/gfx/point.h" 25 #include "ui/gfx/point.h"
25 #include "views/focus/focus_manager.h" 26 #include "views/focus/focus_manager.h"
26 #include "views/widget/widget.h" 27 #include "views/widget/widget.h"
27 28
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (virtual_key_code == VK_F2) { 468 if (virtual_key_code == VK_F2) {
468 if (!GetEditingNode()) { 469 if (!GetEditingNode()) {
469 TreeModelNode* selected_node = GetSelectedNode(); 470 TreeModelNode* selected_node = GetSelectedNode();
470 if (selected_node) 471 if (selected_node)
471 StartEditing(selected_node); 472 StartEditing(selected_node);
472 } 473 }
473 return true; 474 return true;
474 } else if (virtual_key_code == ui::VKEY_RETURN && !process_enter_) { 475 } else if (virtual_key_code == ui::VKEY_RETURN && !process_enter_) {
475 Widget* widget = GetWidget(); 476 Widget* widget = GetWidget();
476 DCHECK(widget); 477 DCHECK(widget);
477 Accelerator accelerator(Accelerator(virtual_key_code, 478 ui::Accelerator accelerator(ui::Accelerator(virtual_key_code,
478 base::win::IsShiftPressed(), 479 base::win::IsShiftPressed(),
479 base::win::IsCtrlPressed(), 480 base::win::IsCtrlPressed(),
480 base::win::IsAltPressed())); 481 base::win::IsAltPressed()));
481 GetFocusManager()->ProcessAccelerator(accelerator); 482 GetFocusManager()->ProcessAccelerator(accelerator);
482 return true; 483 return true;
483 } 484 }
484 return false; 485 return false;
485 } 486 }
486 487
487 void TreeView::OnContextMenu(const POINT& location) { 488 void TreeView::OnContextMenu(const POINT& location) {
488 if (!context_menu_controller()) 489 if (!context_menu_controller())
489 return; 490 return;
490 491
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 } 802 }
802 // Fall through and let the default handler process as well. 803 // Fall through and let the default handler process as well.
803 break; 804 break;
804 } 805 }
805 WNDPROC handler = tree->original_handler_; 806 WNDPROC handler = tree->original_handler_;
806 DCHECK(handler); 807 DCHECK(handler);
807 return CallWindowProc(handler, window, message, w_param, l_param); 808 return CallWindowProc(handler, window, message, w_param, l_param);
808 } 809 }
809 810
810 } // namespace views 811 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_win.cc ('k') | views/focus/accelerator_handler_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698