OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/window_modality_controller.h" | 5 #include "ash/wm/window_modality_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 bool WindowModalityController::PreHandleKeyEvent(aura::Window* target, | 77 bool WindowModalityController::PreHandleKeyEvent(aura::Window* target, |
78 ui::KeyEvent* event) { | 78 ui::KeyEvent* event) { |
79 return !!wm::GetWindowModalTransient(target); | 79 return !!wm::GetWindowModalTransient(target); |
80 } | 80 } |
81 | 81 |
82 bool WindowModalityController::PreHandleMouseEvent(aura::Window* target, | 82 bool WindowModalityController::PreHandleMouseEvent(aura::Window* target, |
83 ui::MouseEvent* event) { | 83 ui::MouseEvent* event) { |
84 return ProcessLocatedEvent(target, event); | 84 return ProcessLocatedEvent(target, event); |
85 } | 85 } |
86 | 86 |
87 ui::TouchStatus WindowModalityController::PreHandleTouchEvent( | 87 ui::EventResult WindowModalityController::PreHandleTouchEvent( |
88 aura::Window* target, | 88 aura::Window* target, |
89 ui::TouchEvent* event) { | 89 ui::TouchEvent* event) { |
90 return ProcessLocatedEvent(target, event) ? ui::TOUCH_STATUS_CONTINUE : | 90 return ProcessLocatedEvent(target, event) ? ui::ER_CONSUMED : |
91 ui::TOUCH_STATUS_UNKNOWN; | 91 ui::ER_UNHANDLED; |
92 } | 92 } |
93 | 93 |
94 ui::EventResult WindowModalityController::PreHandleGestureEvent( | 94 ui::EventResult WindowModalityController::PreHandleGestureEvent( |
95 aura::Window* target, | 95 aura::Window* target, |
96 ui::GestureEvent* event) { | 96 ui::GestureEvent* event) { |
97 // TODO: make gestures work with modals. | 97 // TODO: make gestures work with modals. |
98 return ui::ER_UNHANDLED; | 98 return ui::ER_UNHANDLED; |
99 } | 99 } |
100 | 100 |
101 void WindowModalityController::OnWindowInitialized(aura::Window* window) { | 101 void WindowModalityController::OnWindowInitialized(aura::Window* window) { |
(...skipping 24 matching lines...) Expand all Loading... |
126 aura::Window* modal_transient_child = wm::GetWindowModalTransient(target); | 126 aura::Window* modal_transient_child = wm::GetWindowModalTransient(target); |
127 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || | 127 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || |
128 event->type() == ui::ET_TOUCH_PRESSED)) { | 128 event->type() == ui::ET_TOUCH_PRESSED)) { |
129 wm::ActivateWindow(modal_transient_child); | 129 wm::ActivateWindow(modal_transient_child); |
130 } | 130 } |
131 return !!modal_transient_child; | 131 return !!modal_transient_child; |
132 } | 132 } |
133 | 133 |
134 } // namespace internal | 134 } // namespace internal |
135 } // namespace ash | 135 } // namespace ash |
OLD | NEW |