| 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" | 
|   11 #include "ui/aura/env.h" |   11 #include "ui/aura/env.h" | 
|   12 #include "ui/aura/window.h" |   12 #include "ui/aura/window.h" | 
|   13 #include "ui/aura/window_event_dispatcher.h" |   13 #include "ui/aura/window_event_dispatcher.h" | 
|   14 #include "ui/aura/window_property.h" |   14 #include "ui/aura/window_property.h" | 
|   15 #include "ui/base/ui_base_types.h" |   15 #include "ui/base/ui_base_types.h" | 
|   16 #include "ui/events/event.h" |   16 #include "ui/events/event.h" | 
|   17 #include "ui/events/event_target.h" |   17 #include "ui/events/event_target.h" | 
|   18 #include "ui/events/gestures/gesture_recognizer.h" |   18 #include "ui/events/gestures/gesture_recognizer.h" | 
|   19 #include "ui/wm/core/window_animations.h" |   19 #include "ui/wm/core/window_animations.h" | 
|   20 #include "ui/wm/core/window_util.h" |   20 #include "ui/wm/core/window_util.h" | 
|   21  |   21  | 
|   22 namespace views { |   22 namespace wm { | 
|   23 namespace corewm { |  | 
|   24  |   23  | 
|   25 // Transient child's modal parent. |   24 // Transient child's modal parent. | 
|   26 extern const aura::WindowProperty<aura::Window*>* const kModalParentKey; |   25 extern const aura::WindowProperty<aura::Window*>* const kModalParentKey; | 
|   27 DEFINE_WINDOW_PROPERTY_KEY(aura::Window*, kModalParentKey, NULL); |   26 DEFINE_WINDOW_PROPERTY_KEY(aura::Window*, kModalParentKey, NULL); | 
|   28  |   27  | 
|   29 namespace { |   28 namespace { | 
|   30  |   29  | 
|   31 bool HasAncestor(aura::Window* window, aura::Window* ancestor) { |   30 bool HasAncestor(aura::Window* window, aura::Window* ancestor) { | 
|   32   if (!window) |   31   if (!window) | 
|   33     return false; |   32     return false; | 
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  185   aura::Window* modal_transient_child = GetModalTransient(target); |  184   aura::Window* modal_transient_child = GetModalTransient(target); | 
|  186   if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || |  185   if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || | 
|  187                                 event->type() == ui::ET_TOUCH_PRESSED)) { |  186                                 event->type() == ui::ET_TOUCH_PRESSED)) { | 
|  188     AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); |  187     AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); | 
|  189   } |  188   } | 
|  190   if (event->type() == ui::ET_TOUCH_CANCELLED) |  189   if (event->type() == ui::ET_TOUCH_CANCELLED) | 
|  191     return false; |  190     return false; | 
|  192   return !!modal_transient_child; |  191   return !!modal_transient_child; | 
|  193 } |  192 } | 
|  194  |  193  | 
|  195 }  // namespace corewm |  194 }  // namespace wm | 
|  196 }  // namespace views |  | 
| OLD | NEW |