diff options
author | bryeung@google.com <bryeung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 16:40:30 +0000 |
---|---|---|
committer | bryeung@google.com <bryeung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 16:40:30 +0000 |
commit | 5fcbeca1c495a7e3ef8e8c6d2d11e275c7430002 (patch) | |
tree | 7bd7c6b28d178693b5432c2151ef784930217a5b /views/focus/accelerator_handler_touch.cc | |
parent | 2953b506591d6f4a52e443831d43c0a996b7819a (diff) | |
download | chromium_src-5fcbeca1c495a7e3ef8e8c6d2d11e275c7430002.zip chromium_src-5fcbeca1c495a7e3ef8e8c6d2d11e275c7430002.tar.gz chromium_src-5fcbeca1c495a7e3ef8e8c6d2d11e275c7430002.tar.bz2 |
Hijack mouse-related events for TOUCH_UI builds
With this change, which is specifically for TOUCH_UI builds, mouse-related
messages are hijacked from the normal Gdk event dispatcher and processed
manually in the file touchui/touchui.cc. GdkEvents are converted directly
to views events, and dispatched to the RootView. This is preliminary work
that will be followed by more elaborate message pump changes, and ultimately
is in the spirit of removing Gtk entirely for TOUCH_UI (Chromium-Views-Gtk).
Patch from Chad Faragher <wyck@chromium.org>
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3704005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus/accelerator_handler_touch.cc')
-rw-r--r-- | views/focus/accelerator_handler_touch.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc new file mode 100644 index 0000000..ddcdc04 --- /dev/null +++ b/views/focus/accelerator_handler_touch.cc @@ -0,0 +1,32 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <gtk/gtk.h> + +#include "views/accelerator.h" +#include "views/focus/accelerator_handler.h" +#include "views/focus/focus_manager.h" +#include "views/touchui/touch_event_dispatcher_gtk.h" +#include "views/widget/widget_gtk.h" + +namespace views { + +AcceleratorHandler::AcceleratorHandler() {} + +bool AcceleratorHandler::Dispatch(GdkEvent* event) { + // The logic for handling keyboard accelerators has been moved into + // WidgetGtk::OnKeyEvent handler (views/widget/widget_gtk.cc). + + // TODO(wyck): Hijack TouchUI events at other calls to gtk_main_do_event. + // There are more places where we call gtk_main_do_event. + // In particular: the message pump itself, and the menu controller, + // as well as native_menu_gtk. + // This function contains the most important one important one, though. + if (!DispatchEventForTouchUIGtk(event)) + gtk_main_do_event(event); + + return true; +} + +} // namespace views |