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

Side by Side Diff: views/widget/root_view.cc

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resore most InputMethod code. Created 9 years, 8 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
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/widget/root_view.h" 5 #include "views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Layout(); 75 Layout();
76 } 76 }
77 77
78 void RootView::NotifyNativeViewHierarchyChanged(bool attached, 78 void RootView::NotifyNativeViewHierarchyChanged(bool attached,
79 gfx::NativeView native_view) { 79 gfx::NativeView native_view) {
80 PropagateNativeViewHierarchyChanged(attached, native_view, this); 80 PropagateNativeViewHierarchyChanged(attached, native_view, this);
81 } 81 }
82 82
83 // Input ----------------------------------------------------------------------- 83 // Input -----------------------------------------------------------------------
84 84
85 bool RootView::ProcessKeyEvent(const KeyEvent& event) { 85 bool RootView::OnKeyEvent(const KeyEvent& event) {
86 bool consumed = false; 86 bool consumed = false;
87 87
88 View* v = GetFocusManager()->GetFocusedView(); 88 View* v = GetFocusManager()->GetFocusedView();
89 // Special case to handle right-click context menus triggered by the 89 // Special case to handle right-click context menus triggered by the
90 // keyboard. 90 // keyboard.
91 if (v && v->IsEnabled() && ((event.key_code() == ui::VKEY_APPS) || 91 if (v && v->IsEnabled() && ((event.key_code() == ui::VKEY_APPS) ||
92 (event.key_code() == ui::VKEY_F10 && event.IsShiftDown()))) { 92 (event.key_code() == ui::VKEY_F10 && event.IsShiftDown()))) {
93 v->ShowContextMenu(v->GetKeyboardContextMenuLocation(), false); 93 v->ShowContextMenu(v->GetKeyboardContextMenuLocation(), false);
94 return true; 94 return true;
95 } 95 }
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 widget_->SetCursor(cursor); 473 widget_->SetCursor(cursor);
474 } 474 }
475 475
476 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { 476 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) {
477 last_mouse_event_flags_ = event.flags(); 477 last_mouse_event_flags_ = event.flags();
478 last_mouse_event_x_ = event.x(); 478 last_mouse_event_x_ = event.x();
479 last_mouse_event_y_ = event.y(); 479 last_mouse_event_y_ = event.y();
480 } 480 }
481 481
482 } // namespace views 482 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698