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 "ui/wm/core/window_modality_controller.h" | 5 #include "ui/wm/core/window_modality_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/capture_client.h" | 10 #include "ui/aura/client/capture_client.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 window->RemoveObserver(this); | 177 window->RemoveObserver(this); |
178 } | 178 } |
179 | 179 |
180 bool WindowModalityController::ProcessLocatedEvent(aura::Window* target, | 180 bool WindowModalityController::ProcessLocatedEvent(aura::Window* target, |
181 ui::LocatedEvent* event) { | 181 ui::LocatedEvent* event) { |
182 if (event->handled()) | 182 if (event->handled()) |
183 return false; | 183 return false; |
184 aura::Window* modal_transient_child = GetModalTransient(target); | 184 aura::Window* modal_transient_child = GetModalTransient(target); |
185 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || | 185 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || |
186 event->type() == ui::ET_TOUCH_PRESSED)) { | 186 event->type() == ui::ET_TOUCH_PRESSED)) { |
| 187 // Activate top window if transient child window is window modal. |
| 188 if (TransientChildIsWindowModal(modal_transient_child)) { |
| 189 aura::Window* toplevel = GetToplevelWindow(target); |
| 190 DCHECK(toplevel); |
| 191 ActivateWindow(toplevel); |
| 192 } |
| 193 |
187 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); | 194 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); |
188 } | 195 } |
189 if (event->type() == ui::ET_TOUCH_CANCELLED) | 196 if (event->type() == ui::ET_TOUCH_CANCELLED) |
190 return false; | 197 return false; |
191 return !!modal_transient_child; | 198 return !!modal_transient_child; |
192 } | 199 } |
193 | 200 |
194 } // namespace wm | 201 } // namespace wm |
OLD | NEW |