Commit d9a49f86 authored by derat@chromium.org's avatar derat@chromium.org

aura: Make tab-dragging Escape code be cross-platform.

This gets rid of a noisy NOTIMPLEMENTED() in
DraggedTabController::DidProcessEvent().

BUG=98345
TEST=manual: checked that escape aborts tab dragging in aura

Review URL: http://codereview.chromium.org/8372001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106990 0039d316-1c4b-4281-b951-d872f2087c98
parent 5978af5e
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "ui/base/animation/animation.h" #include "ui/base/animation/animation.h"
#include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h" #include "ui/base/animation/slide_animation.h"
#include "ui/base/events.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas_skia.h" #include "ui/gfx/canvas_skia.h"
#include "ui/gfx/screen.h" #include "ui/gfx/screen.h"
...@@ -501,7 +502,7 @@ void DraggedTabController::Observe( ...@@ -501,7 +502,7 @@ void DraggedTabController::Observe(
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// DraggedTabController, MessageLoop::Observer implementation: // DraggedTabController, MessageLoop::Observer implementation:
#if defined(OS_WIN) #if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA)
base::EventStatus DraggedTabController::WillProcessEvent( base::EventStatus DraggedTabController::WillProcessEvent(
const base::NativeEvent& event) { const base::NativeEvent& event) {
return base::EVENT_CONTINUE; return base::EVENT_CONTINUE;
...@@ -512,17 +513,10 @@ void DraggedTabController::DidProcessEvent(const base::NativeEvent& event) { ...@@ -512,17 +513,10 @@ void DraggedTabController::DidProcessEvent(const base::NativeEvent& event) {
// to the way they were. This is the most reliable way to do this since no // to the way they were. This is the most reliable way to do this since no
// single view or window reliably receives events throughout all the various // single view or window reliably receives events throughout all the various
// kinds of tab dragging. // kinds of tab dragging.
if (event.message == WM_KEYDOWN && event.wParam == VK_ESCAPE) if (ui::EventTypeFromNative(event) == ui::ET_KEY_PRESSED &&
ui::KeyboardCodeFromNative(event) == ui::VKEY_ESCAPE) {
EndDrag(true); EndDrag(true);
} }
#elif defined(TOUCH_UI) || defined(USE_AURA)
base::EventStatus DraggedTabController::WillProcessEvent(
const base::NativeEvent& event) {
return base::EVENT_CONTINUE;
}
void DraggedTabController::DidProcessEvent(const base::NativeEvent& event) {
NOTIMPLEMENTED();
} }
#elif defined(TOOLKIT_USES_GTK) #elif defined(TOOLKIT_USES_GTK)
void DraggedTabController::WillProcessEvent(GdkEvent* event) { void DraggedTabController::WillProcessEvent(GdkEvent* event) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment