| 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 #ifndef ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ | 5 #ifndef ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ |
| 6 #define ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ | 6 #define ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ui/aura/env_observer.h" | 12 #include "ui/aura/env_observer.h" |
| 13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
| 14 #include "ui/base/events/event_handler.h" | 14 #include "ui/base/events/event_handler.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 class LocatedEvent; | 17 class LocatedEvent; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 | 21 |
| 22 namespace wm { | |
| 23 | |
| 24 // Sets the modal parent for the child. | 22 // Sets the modal parent for the child. |
| 25 ASH_EXPORT void SetModalParent(aura::Window* child, aura::Window* parent); | 23 ASH_EXPORT void SetModalParent(aura::Window* child, aura::Window* parent); |
| 26 | 24 |
| 27 // Returns the modal transient child of |window|, or NULL if |window| does not | 25 // Returns the modal transient child of |window|, or NULL if |window| does not |
| 28 // have any modal transient children. | 26 // have any modal transient children. |
| 29 ASH_EXPORT aura::Window* GetModalTransient(aura::Window* window); | 27 ASH_EXPORT aura::Window* GetModalTransient(aura::Window* window); |
| 30 | 28 |
| 31 } | |
| 32 | |
| 33 namespace internal { | 29 namespace internal { |
| 34 | 30 |
| 35 // WindowModalityController is an event filter that consumes events sent to | 31 // WindowModalityController is an event filter that consumes events sent to |
| 36 // windows that are the transient parents of window-modal windows. This filter | 32 // windows that are the transient parents of window-modal windows. This filter |
| 37 // must be added to the CompoundEventFilter so that activation works properly. | 33 // must be added to the CompoundEventFilter so that activation works properly. |
| 38 class WindowModalityController : public ui::EventHandler, | 34 class WindowModalityController : public ui::EventHandler, |
| 39 public aura::EnvObserver, | 35 public aura::EnvObserver, |
| 40 public aura::WindowObserver { | 36 public aura::WindowObserver { |
| 41 public: | 37 public: |
| 42 WindowModalityController(); | 38 WindowModalityController(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 | 59 |
| 64 std::vector<aura::Window*> windows_; | 60 std::vector<aura::Window*> windows_; |
| 65 | 61 |
| 66 DISALLOW_COPY_AND_ASSIGN(WindowModalityController); | 62 DISALLOW_COPY_AND_ASSIGN(WindowModalityController); |
| 67 }; | 63 }; |
| 68 | 64 |
| 69 } // namespace internal | 65 } // namespace internal |
| 70 } // namespace ash | 66 } // namespace ash |
| 71 | 67 |
| 72 #endif // ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ | 68 #endif // ASH_WM_WINDOW_MODALITY_CONTROLLER_H_ |
| OLD | NEW |