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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 52c77483c61ba7cfbf22cf48046ea13a0ebaecea..e9b29c5efa7ef803a29465a10d87508fed0dbd32 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -647,7 +647,8 @@ ui::NativeTheme* NativeWidgetAura::GetNativeTheme() const {
void NativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) {
FocusManager* focus_manager = GetWidget()->GetFocusManager();
- if (delegate_->OnKeyEvent(key) || !focus_manager)
+ delegate_->OnKeyEvent(const_cast<ui::KeyEvent*>(&key));
+ if (key.handled() || !focus_manager)
return;
focus_manager->OnKeyEvent(key);
}
@@ -768,20 +769,20 @@ scoped_refptr<ui::Texture> NativeWidgetAura::CopyTexture() {
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetAura, ui::EventHandler implementation:
-ui::EventResult NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) {
+void NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) {
if (event->is_char()) {
// If a ui::InputMethod object is attached to the root window, character
// events are handled inside the object and are not passed to this function.
// If such object is not attached, character events might be sent (e.g. on
// Windows). In this case, we just skip these.
- return ui::ER_UNHANDLED;
+ return;
}
// Renderer may send a key event back to us if the key event wasn't handled,
// and the window may be invisible by that time.
if (!window_->IsVisible())
- return ui::ER_UNHANDLED;
+ return;
GetWidget()->GetInputMethod()->DispatchKeyEvent(*event);
- return ui::ER_HANDLED;
+ event->SetHandled();
}
ui::EventResult NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) {
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698