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

Side by Side Diff: views/widget/root_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/view_unittest.cc ('k') | views/widget/widget_gtk.cc » ('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/widget/root_view.h" 5 #include "views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/drag_drop_types.h" 9 #include "app/drag_drop_types.h"
10 #include "app/keyboard_codes.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/message_loop.h" 11 #include "base/message_loop.h"
13 #include "gfx/canvas_skia.h" 12 #include "gfx/canvas_skia.h"
13 #include "ui/base/keycodes/keyboard_codes.h"
14 #include "views/fill_layout.h" 14 #include "views/fill_layout.h"
15 #include "views/focus/view_storage.h" 15 #include "views/focus/view_storage.h"
16 #include "views/widget/widget.h" 16 #include "views/widget/widget.h"
17 #include "views/window/window.h" 17 #include "views/window/window.h"
18 18
19 #if defined(TOUCH_UI) 19 #if defined(TOUCH_UI)
20 #include "views/touchui/gesture_manager.h" 20 #include "views/touchui/gesture_manager.h"
21 #endif 21 #endif
22 22
23 #if defined(OS_LINUX) 23 #if defined(OS_LINUX)
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 gfx::NativeView native_view) { 654 gfx::NativeView native_view) {
655 PropagateNativeViewHierarchyChanged(attached, native_view, this); 655 PropagateNativeViewHierarchyChanged(attached, native_view, this);
656 } 656 }
657 657
658 bool RootView::ProcessKeyEvent(const KeyEvent& event) { 658 bool RootView::ProcessKeyEvent(const KeyEvent& event) {
659 bool consumed = false; 659 bool consumed = false;
660 660
661 View* v = GetFocusedView(); 661 View* v = GetFocusedView();
662 // Special case to handle right-click context menus triggered by the 662 // Special case to handle right-click context menus triggered by the
663 // keyboard. 663 // keyboard.
664 if (v && v->IsEnabled() && ((event.GetKeyCode() == app::VKEY_APPS) || 664 if (v && v->IsEnabled() && ((event.GetKeyCode() == ui::VKEY_APPS) ||
665 (event.GetKeyCode() == app::VKEY_F10 && event.IsShiftDown()))) { 665 (event.GetKeyCode() == ui::VKEY_F10 && event.IsShiftDown()))) {
666 v->ShowContextMenu(v->GetKeyboardContextMenuLocation(), false); 666 v->ShowContextMenu(v->GetKeyboardContextMenuLocation(), false);
667 return true; 667 return true;
668 } 668 }
669 for (; v && v != this && !consumed; v = v->GetParent()) { 669 for (; v && v != this && !consumed; v = v->GetParent()) {
670 consumed = (event.GetType() == Event::ET_KEY_PRESSED) ? 670 consumed = (event.GetType() == Event::ET_KEY_PRESSED) ?
671 v->OnKeyPressed(event) : v->OnKeyReleased(event); 671 v->OnKeyPressed(event) : v->OnKeyReleased(event);
672 } 672 }
673 673
674 if (!consumed && default_keyboard_handler_) { 674 if (!consumed && default_keyboard_handler_) {
675 consumed = (event.GetType() == Event::ET_KEY_PRESSED) ? 675 consumed = (event.GetType() == Event::ET_KEY_PRESSED) ?
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 #elif defined(OS_LINUX) 785 #elif defined(OS_LINUX)
786 gfx::NativeView native_view = 786 gfx::NativeView native_view =
787 static_cast<WidgetGtk*>(GetWidget())->window_contents(); 787 static_cast<WidgetGtk*>(GetWidget())->window_contents();
788 if (!native_view) 788 if (!native_view)
789 return; 789 return;
790 gdk_window_set_cursor(native_view->window, cursor); 790 gdk_window_set_cursor(native_view->window, cursor);
791 #endif 791 #endif
792 } 792 }
793 793
794 } // namespace views 794 } // namespace views
OLDNEW
« no previous file with comments | « views/view_unittest.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698