diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 17:16:21 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 17:16:21 +0000 |
commit | 5eebaf46e7ea120921c3fcfce64ea45047659641 (patch) | |
tree | 6afa9a413c557de459ee0ad4c997bd26404ebffe /ash | |
parent | 25cc762f00cbc1904e997f789078162e51e91418 (diff) | |
download | chromium_src-5eebaf46e7ea120921c3fcfce64ea45047659641.zip chromium_src-5eebaf46e7ea120921c3fcfce64ea45047659641.tar.gz chromium_src-5eebaf46e7ea120921c3fcfce64ea45047659641.tar.bz2 |
events: Update key-event handlers to not return EventResult.
BUG=163618
Review URL: https://codereview.chromium.org/11570012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
24 files changed, 58 insertions, 60 deletions
diff --git a/ash/accelerators/accelerator_dispatcher.cc b/ash/accelerators/accelerator_dispatcher.cc index ee56cef..41a292f 100644 --- a/ash/accelerators/accelerator_dispatcher.cc +++ b/ash/accelerators/accelerator_dispatcher.cc @@ -74,8 +74,8 @@ bool AcceleratorDispatcher::Dispatch(const base::NativeEvent& event) { ui::EventHandler* event_rewriter = ash::Shell::GetInstance()->event_rewriter_filter(); DCHECK(event_rewriter); - ui::EventResult result = event_rewriter->OnKeyEvent(&key_event); - if (result & ui::ER_CONSUMED) + event_rewriter->OnKeyEvent(&key_event); + if (key_event.stopped_propagation()) return true; ash::AcceleratorController* accelerator_controller = ash::Shell::GetInstance()->accelerator_controller(); diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc index 51c4450..892beab 100644 --- a/ash/accelerators/accelerator_filter.cc +++ b/ash/accelerators/accelerator_filter.cc @@ -67,12 +67,12 @@ AcceleratorFilter::~AcceleratorFilter() { //////////////////////////////////////////////////////////////////////////////// // AcceleratorFilter, EventFilter implementation: -ui::EventResult AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) { +void AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) { const ui::EventType type = event->type(); if (type != ui::ET_KEY_PRESSED && type != ui::ET_KEY_RELEASED) - return ui::ER_UNHANDLED; + return; if (event->is_char()) - return ui::ER_UNHANDLED; + return; ui::Accelerator accelerator(event->key_code(), event->flags() & kModifierFlagMask); @@ -85,9 +85,9 @@ ui::EventResult AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); if (!ShouldProcessAcceleratorsNow(accelerator, target)) - return ui::ER_UNHANDLED; - return Shell::GetInstance()->accelerator_controller()->Process(accelerator) ? - ui::ER_CONSUMED : ui::ER_UNHANDLED; + return; + if (Shell::GetInstance()->accelerator_controller()->Process(accelerator)) + event->StopPropagation(); } } // namespace internal diff --git a/ash/accelerators/accelerator_filter.h b/ash/accelerators/accelerator_filter.h index 2f125c4..a43241a 100644 --- a/ash/accelerators/accelerator_filter.h +++ b/ash/accelerators/accelerator_filter.h @@ -21,7 +21,7 @@ class ASH_EXPORT AcceleratorFilter : public ui::EventHandler { virtual ~AcceleratorFilter(); // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(AcceleratorFilter); diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index f3d0343..91aa4a7 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -285,12 +285,11 @@ bool DragDropController::IsDragDropInProgress() { return !!drag_drop_tracker_.get(); } -ui::EventResult DragDropController::OnKeyEvent(ui::KeyEvent* event) { +void DragDropController::OnKeyEvent(ui::KeyEvent* event) { if (IsDragDropInProgress() && event->key_code() == ui::VKEY_ESCAPE) { DragCancel(); - return ui::ER_CONSUMED; + event->StopPropagation(); } - return ui::ER_UNHANDLED; } ui::EventResult DragDropController::OnMouseEvent(ui::MouseEvent* event) { diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h index bef79a0..49dfb65ed 100644 --- a/ash/drag_drop/drag_drop_controller.h +++ b/ash/drag_drop/drag_drop_controller.h @@ -65,7 +65,7 @@ class ASH_EXPORT DragDropController virtual bool IsDragDropInProgress() OVERRIDE; // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; diff --git a/ash/launcher/launcher_tooltip_manager_unittest.cc b/ash/launcher/launcher_tooltip_manager_unittest.cc index e1464da..0fcbe28 100644 --- a/ash/launcher/launcher_tooltip_manager_unittest.cc +++ b/ash/launcher/launcher_tooltip_manager_unittest.cc @@ -156,8 +156,8 @@ TEST_F(LauncherTooltipManagerTest, ShouldHideForEvents) { // Should not hide for key events. ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); SetEventTarget(root_window, &key_event); - EXPECT_EQ(ui::ER_UNHANDLED, - event_handler->OnKeyEvent(&key_event)); + event_handler->OnKeyEvent(&key_event); + EXPECT_FALSE(key_event.handled()); EXPECT_TRUE(TooltipIsVisible()); // Should hide for touch events. diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index 21dcab5..ef80f9b 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -249,7 +249,7 @@ void TooltipController::SetTooltipsEnabled(bool enable) { UpdateTooltip(tooltip_window_); } -ui::EventResult TooltipController::OnKeyEvent(ui::KeyEvent* event) { +void TooltipController::OnKeyEvent(ui::KeyEvent* event) { // On key press, we want to hide the tooltip and not show it until change. // This is the same behavior as hiding tooltips on timeout. Hence, we can // simply simulate a timeout. @@ -257,7 +257,6 @@ ui::EventResult TooltipController::OnKeyEvent(ui::KeyEvent* event) { tooltip_shown_timer_.Stop(); TooltipShownTimerFired(); } - return ui::ER_UNHANDLED; } ui::EventResult TooltipController::OnMouseEvent(ui::MouseEvent* event) { diff --git a/ash/tooltips/tooltip_controller.h b/ash/tooltips/tooltip_controller.h index d07f181..6ac7b27 100644 --- a/ash/tooltips/tooltip_controller.h +++ b/ash/tooltips/tooltip_controller.h @@ -44,7 +44,7 @@ class ASH_EXPORT TooltipController : public aura::client::TooltipClient, virtual void SetTooltipsEnabled(bool enable) OVERRIDE; // Overridden from ui::EventHandler. - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc index 5544078..a17109e 100644 --- a/ash/wm/activation_controller.cc +++ b/ash/wm/activation_controller.cc @@ -272,8 +272,7 @@ void ActivationController::OnWindowFocused(aura::Window* gained_focus, //////////////////////////////////////////////////////////////////////////////// // ActivationController, ui::EventHandler implementation: -ui::EventResult ActivationController::OnKeyEvent(ui::KeyEvent* event) { - return ui::ER_UNHANDLED; +void ActivationController::OnKeyEvent(ui::KeyEvent* event) { } ui::EventResult ActivationController::OnMouseEvent(ui::MouseEvent* event) { diff --git a/ash/wm/activation_controller.h b/ash/wm/activation_controller.h index 23fe737..f9b023f 100644 --- a/ash/wm/activation_controller.h +++ b/ash/wm/activation_controller.h @@ -75,7 +75,7 @@ class ASH_EXPORT ActivationController private: // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; diff --git a/ash/wm/event_rewriter_event_filter.cc b/ash/wm/event_rewriter_event_filter.cc index fc36c0c..81ed7e5 100644 --- a/ash/wm/event_rewriter_event_filter.cc +++ b/ash/wm/event_rewriter_event_filter.cc @@ -20,25 +20,23 @@ void EventRewriterEventFilter::SetEventRewriterDelegate( delegate_.swap(delegate); } -ui::EventResult EventRewriterEventFilter::OnKeyEvent(ui::KeyEvent* event) { +void EventRewriterEventFilter::OnKeyEvent(ui::KeyEvent* event) { if (!delegate_.get()) - return ui::ER_UNHANDLED; + return; // Do not consume a translated key event which is generated by an IME. if (event->type() == ui::ET_TRANSLATED_KEY_PRESS || event->type() == ui::ET_TRANSLATED_KEY_RELEASE) { - return ui::ER_UNHANDLED; + return; } switch (delegate_->RewriteOrFilterKeyEvent(event)) { case EventRewriterDelegate::ACTION_REWRITE_EVENT: - return ui::ER_UNHANDLED; + break; case EventRewriterDelegate::ACTION_DROP_EVENT: - return ui::ER_CONSUMED; + event->StopPropagation(); + break; } - - NOTREACHED(); - return ui::ER_UNHANDLED; } ui::EventResult EventRewriterEventFilter::OnMouseEvent(ui::MouseEvent* event) { diff --git a/ash/wm/event_rewriter_event_filter.h b/ash/wm/event_rewriter_event_filter.h index f839064..6939001 100644 --- a/ash/wm/event_rewriter_event_filter.h +++ b/ash/wm/event_rewriter_event_filter.h @@ -27,7 +27,7 @@ class ASH_EXPORT EventRewriterEventFilter : public ui::EventHandler { private: // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; scoped_ptr<EventRewriterDelegate> delegate_; diff --git a/ash/wm/overlay_event_filter.cc b/ash/wm/overlay_event_filter.cc index 1a333b7..2319d2f 100644 --- a/ash/wm/overlay_event_filter.cc +++ b/ash/wm/overlay_event_filter.cc @@ -21,9 +21,9 @@ OverlayEventFilter::~OverlayEventFilter() { delegate_ = NULL; } -ui::EventResult OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { +void OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { if (!delegate_) - return ui::ER_UNHANDLED; + return; // Do not consume a translated key event which is generated by an IME (e.g., // ui::VKEY_PROCESSKEY) since the key event is generated in response to a key @@ -31,7 +31,7 @@ ui::EventResult OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { // confuse key event handling JavaScript code in a page. if (event->type() == ui::ET_TRANSLATED_KEY_PRESS || event->type() == ui::ET_TRANSLATED_KEY_RELEASE) { - return ui::ER_UNHANDLED; + return; } if (delegate_ && delegate_->IsCancelingKeyEvent(event)) @@ -46,7 +46,7 @@ ui::EventResult OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { // Always handled: other windows shouldn't receive input while we're // displaying an overlay. - return ui::ER_CONSUMED; + event->StopPropagation(); } void OverlayEventFilter::OnLoginStateChanged( diff --git a/ash/wm/overlay_event_filter.h b/ash/wm/overlay_event_filter.h index 87c115c..1989e45 100644 --- a/ash/wm/overlay_event_filter.h +++ b/ash/wm/overlay_event_filter.h @@ -52,7 +52,7 @@ class OverlayEventFilter : public ui::EventHandler, void Cancel(); // ui::EventHandler overrides: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; // ShellObserver overrides: virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; diff --git a/ash/wm/system_modal_container_event_filter.cc b/ash/wm/system_modal_container_event_filter.cc index 5103d2d..da9600f 100644 --- a/ash/wm/system_modal_container_event_filter.cc +++ b/ash/wm/system_modal_container_event_filter.cc @@ -19,11 +19,10 @@ SystemModalContainerEventFilter::SystemModalContainerEventFilter( SystemModalContainerEventFilter::~SystemModalContainerEventFilter() { } -ui::EventResult SystemModalContainerEventFilter::OnKeyEvent( - ui::KeyEvent* event) { +void SystemModalContainerEventFilter::OnKeyEvent(ui::KeyEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); - return delegate_->CanWindowReceiveEvents(target) ? ui::ER_UNHANDLED : - ui::ER_CONSUMED; + if (!delegate_->CanWindowReceiveEvents(target)) + event->StopPropagation(); } ui::EventResult SystemModalContainerEventFilter::OnMouseEvent( diff --git a/ash/wm/system_modal_container_event_filter.h b/ash/wm/system_modal_container_event_filter.h index 64653ee..f1ac513 100644 --- a/ash/wm/system_modal_container_event_filter.h +++ b/ash/wm/system_modal_container_event_filter.h @@ -22,7 +22,7 @@ class ASH_EXPORT SystemModalContainerEventFilter : public ui::EventHandler { virtual ~SystemModalContainerEventFilter(); // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; private: diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc index 865fcda..96f26e2 100644 --- a/ash/wm/toplevel_window_event_handler.cc +++ b/ash/wm/toplevel_window_event_handler.cc @@ -123,12 +123,11 @@ ToplevelWindowEventHandler::~ToplevelWindowEventHandler() { *destroyed_ = true; } -ui::EventResult ToplevelWindowEventHandler::OnKeyEvent(ui::KeyEvent* event) { +void ToplevelWindowEventHandler::OnKeyEvent(ui::KeyEvent* event) { if (window_resizer_.get() && event->type() == ui::ET_KEY_PRESSED && event->key_code() == ui::VKEY_ESCAPE) { CompleteDrag(DRAG_REVERT, event->flags()); } - return ui::ER_UNHANDLED; } ui::EventResult ToplevelWindowEventHandler::OnMouseEvent( diff --git a/ash/wm/toplevel_window_event_handler.h b/ash/wm/toplevel_window_event_handler.h index 4277cf4..1340937 100644 --- a/ash/wm/toplevel_window_event_handler.h +++ b/ash/wm/toplevel_window_event_handler.h @@ -38,7 +38,7 @@ class ASH_EXPORT ToplevelWindowEventHandler virtual ~ToplevelWindowEventHandler(); // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; diff --git a/ash/wm/user_activity_detector.cc b/ash/wm/user_activity_detector.cc index 4338acc..6c55f89 100644 --- a/ash/wm/user_activity_detector.cc +++ b/ash/wm/user_activity_detector.cc @@ -34,9 +34,8 @@ void UserActivityDetector::OnAllOutputsTurnedOff() { ignore_next_mouse_event_ = true; } -ui::EventResult UserActivityDetector::OnKeyEvent(ui::KeyEvent* event) { +void UserActivityDetector::OnKeyEvent(ui::KeyEvent* event) { MaybeNotify(); - return ui::ER_UNHANDLED; } ui::EventResult UserActivityDetector::OnMouseEvent(ui::MouseEvent* event) { diff --git a/ash/wm/user_activity_detector.h b/ash/wm/user_activity_detector.h index 89a2518..9d8ec28 100644 --- a/ash/wm/user_activity_detector.h +++ b/ash/wm/user_activity_detector.h @@ -35,7 +35,7 @@ class ASH_EXPORT UserActivityDetector : public ui::EventHandler { void OnAllOutputsTurnedOff(); // ui::EventHandler implementation. - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; diff --git a/ash/wm/user_activity_detector_unittest.cc b/ash/wm/user_activity_detector_unittest.cc index 1e3105b..979c9ea 100644 --- a/ash/wm/user_activity_detector_unittest.cc +++ b/ash/wm/user_activity_detector_unittest.cc @@ -92,7 +92,8 @@ TEST_F(UserActivityDetectorTest, Basic) { ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); SetEventTarget(window.get(), &key_event); - EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&key_event)); + detector_->OnKeyEvent(&key_event); + EXPECT_FALSE(key_event.handled()); EXPECT_EQ(1, observer_->num_invocations()); observer_->reset_stats(); @@ -141,13 +142,15 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) { // The observer should be notified about a key event. ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); SetEventTarget(window.get(), &event); - EXPECT_FALSE(detector_->OnKeyEvent(&event)); + detector_->OnKeyEvent(&event); + EXPECT_FALSE(event.handled()); EXPECT_EQ(1, observer_->num_invocations()); observer_->reset_stats(); // It shouldn't be notified if a second event occurs // in the same instant in time. - EXPECT_FALSE(detector_->OnKeyEvent(&event)); + detector_->OnKeyEvent(&event); + EXPECT_FALSE(event.handled()); EXPECT_EQ(0, observer_->num_invocations()); observer_->reset_stats(); @@ -155,7 +158,8 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) { AdvanceTime( base::TimeDelta::FromMilliseconds( UserActivityDetector::kNotifyIntervalMs - 100)); - EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&event)); + detector_->OnKeyEvent(&event); + EXPECT_FALSE(event.handled()); EXPECT_EQ(0, observer_->num_invocations()); observer_->reset_stats(); @@ -164,7 +168,8 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) { AdvanceTime(base::TimeDelta::FromMilliseconds( UserActivityDetector::kNotifyIntervalMs)); - EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&event)); + detector_->OnKeyEvent(&event); + EXPECT_FALSE(event.handled()); EXPECT_EQ(1, observer_->num_invocations()); } diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc index 4158451..2aae2a6 100644 --- a/ash/wm/window_cycle_controller.cc +++ b/ash/wm/window_cycle_controller.cc @@ -34,7 +34,7 @@ class WindowCycleEventFilter : public ui::EventHandler { virtual ~WindowCycleEventFilter(); // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(WindowCycleEventFilter); }; @@ -46,14 +46,13 @@ WindowCycleEventFilter::WindowCycleEventFilter() { WindowCycleEventFilter::~WindowCycleEventFilter() { } -ui::EventResult WindowCycleEventFilter::OnKeyEvent(ui::KeyEvent* event) { +void WindowCycleEventFilter::OnKeyEvent(ui::KeyEvent* event) { // Views uses VKEY_MENU for both left and right Alt keys. if (event->key_code() == ui::VKEY_MENU && event->type() == ui::ET_KEY_RELEASED) { Shell::GetInstance()->window_cycle_controller()->AltKeyReleased(); // Warning: |this| will be deleted from here on. } - return ui::ER_UNHANDLED; // Always let the event propagate. } // Adds all the children of |window| to |windows|. diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index 98568e4..773a4a6 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -54,9 +54,12 @@ class CustomEventHandler : public aura::test::TestEventHandler { } // Overridden from ui::EventHandler: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE { - ui::EventResult result = aura::test::TestEventHandler::OnKeyEvent(event); - return key_result_ == ui::ER_UNHANDLED ? result : key_result_; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE { + aura::test::TestEventHandler::OnKeyEvent(event); + if (key_result_ & ui::ER_HANDLED) + event->SetHandled(); + if (key_result_ & ui::ER_CONSUMED) + event->StopPropagation(); } virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE { diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc index f650cdb..bf25172 100644 --- a/ash/wm/workspace/frame_maximize_button.cc +++ b/ash/wm/workspace/frame_maximize_button.cc @@ -47,7 +47,7 @@ class FrameMaximizeButton::EscapeEventFilter : public ui::EventHandler { virtual ~EscapeEventFilter(); // EventFilter overrides: - virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; + virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; private: FrameMaximizeButton* button_; @@ -65,13 +65,12 @@ FrameMaximizeButton::EscapeEventFilter::~EscapeEventFilter() { Shell::GetInstance()->RemovePreTargetHandler(this); } -ui::EventResult FrameMaximizeButton::EscapeEventFilter::OnKeyEvent( +void FrameMaximizeButton::EscapeEventFilter::OnKeyEvent( ui::KeyEvent* event) { if (event->type() == ui::ET_KEY_PRESSED && event->key_code() == ui::VKEY_ESCAPE) { button_->Cancel(false); } - return ui::ER_UNHANDLED; } // FrameMaximizeButton --------------------------------------------------------- |