Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: ui/wm/core/transient_window_manager.h

Issue 628413002: Show transient child when the transient parent is shown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/wm/core/transient_window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7a7ee466373e90a1960b4a672a4b95f7bfc99f63 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_controls_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. This is false by default.
+ void set_parent_controls_visibility(bool parent_controls_visibility) {
+ parent_controls_visibility_ = parent_controls_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_controls_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_controls_visibility_;
+ bool show_on_parent_visible_;
+ bool ignore_visibility_changed_event_;
+
ObserverList<TransientWindowObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(TransientWindowManager);
« no previous file with comments | « no previous file | ui/wm/core/transient_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698