Chromium Code Reviews| Index: ui/wm/core/transient_window_manager.h |
| diff --git a/ui/wm/core/transient_window_manager.h b/ui/wm/core/transient_window_manager.h |
| index 7d37679f924d0cbf8b6b684b92eaa2430b3f518a..38179eb183b3cff7405265b7e547c54a1eb0cf3e 100644 |
| --- a/ui/wm/core/transient_window_manager.h |
| +++ b/ui/wm/core/transient_window_manager.h |
| @@ -23,6 +23,8 @@ class TransientWindowObserver; |
| // or transient parent is destroyed. |
| // . If a transient child and its transient parent share the same parent, then |
| // transient children are always ordered above the transient parent. |
| +// . If a transient parent is hidden, it hides all transient children. |
| +// For show operation, please refer to |set_parent_control_visibility(bool)|. |
| // Transient windows are typically used for popups and menus. |
| // TODO(sky): when we nuke TransientWindowClient rename this to |
| // TransientWindowController. |
| @@ -46,6 +48,14 @@ class WM_EXPORT TransientWindowManager : public aura::WindowObserver { |
| void AddTransientChild(aura::Window* child); |
| void RemoveTransientChild(aura::Window* child); |
| + // Setting true lets the transient parent show this transient |
| + // child when the parent is shown. If this was shown when the |
| + // transient parent is hidden, it remains hidden and gets shown |
| + // when the transient parent is shown. |
| + void set_parent_control_visibility(bool parent_control_visibility) { |
|
sky
2014/10/07 15:19:14
parent_controls_visibility. Also, document the def
oshima
2014/10/07 17:41:14
Done.
|
| + parent_control_visibility_ = parent_control_visibility; |
| + } |
| + |
| const Windows& transient_children() const { return transient_children_; } |
| aura::Window* transient_parent() { return transient_parent_; } |
| @@ -65,11 +75,17 @@ class WM_EXPORT TransientWindowManager : public aura::WindowObserver { |
| // above it. |
| void RestackTransientDescendants(); |
| + // Update the window's visibility following the transient parent's |
| + // visibility. See |set_parent_control_visibility(bool)| for more details. |
| + void UpdateTransientChildVisibility(bool visible); |
| + |
| // WindowObserver: |
| virtual void OnWindowParentChanged(aura::Window* window, |
| aura::Window* parent) OVERRIDE; |
| virtual void OnWindowVisibilityChanging(aura::Window* window, |
| bool visible) OVERRIDE; |
| + virtual void OnWindowVisibilityChanged(aura::Window* window, |
| + bool visible) OVERRIDE; |
| virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; |
| virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| @@ -81,6 +97,10 @@ class WM_EXPORT TransientWindowManager : public aura::WindowObserver { |
| // transient ancestor changing. |
| aura::Window* stacking_target_; |
| + bool parent_control_visibility_; |
| + bool show_on_parent_visible_; |
| + bool ignore_visibility_changed_event_; |
| + |
| ObserverList<TransientWindowObserver> observers_; |
| DISALLOW_COPY_AND_ASSIGN(TransientWindowManager); |