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

Unified Diff: ash/wm/window_modality_controller.cc

Issue 10763004: ash: Fix touch-event handling for modal windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-win-aura Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_modality_controller.h ('k') | ash/wm/window_modality_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_modality_controller.cc
diff --git a/ash/wm/window_modality_controller.cc b/ash/wm/window_modality_controller.cc
index cd920bd434d1317b028161154d2de21fe3a018e0..50fe51655eaf4390ed5eab57810492f88f17d0af 100644
--- a/ash/wm/window_modality_controller.cc
+++ b/ash/wm/window_modality_controller.cc
@@ -81,17 +81,14 @@ bool WindowModalityController::PreHandleKeyEvent(aura::Window* target,
bool WindowModalityController::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
- aura::Window* modal_transient_child = wm::GetWindowModalTransient(target);
- if (modal_transient_child && event->type() == ui::ET_MOUSE_PRESSED)
- wm::ActivateWindow(modal_transient_child);
- return !!modal_transient_child;
+ return ProcessLocatedEvent(target, event);
}
ui::TouchStatus WindowModalityController::PreHandleTouchEvent(
aura::Window* target,
aura::TouchEvent* event) {
- // TODO: make touch work with modals.
- return ui::TOUCH_STATUS_UNKNOWN;
+ return ProcessLocatedEvent(target, event) ? ui::TOUCH_STATUS_CONTINUE :
+ ui::TOUCH_STATUS_UNKNOWN;
}
ui::GestureStatus WindowModalityController::PreHandleGestureEvent(
@@ -124,5 +121,15 @@ void WindowModalityController::OnWindowDestroyed(aura::Window* window) {
window->RemoveObserver(this);
}
+bool WindowModalityController::ProcessLocatedEvent(aura::Window* target,
+ aura::LocatedEvent* event) {
+ aura::Window* modal_transient_child = wm::GetWindowModalTransient(target);
+ if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED ||
+ event->type() == ui::ET_TOUCH_PRESSED)) {
+ wm::ActivateWindow(modal_transient_child);
+ }
+ return !!modal_transient_child;
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/window_modality_controller.h ('k') | ash/wm/window_modality_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698