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

Unified Diff: services/ui/public/cpp/window_observer.h

Issue 2387013003: Adds OnChildWindowVisibilityChanged to ui::WindowObserver (Closed)
Patch Set: fix test Created 4 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
Index: services/ui/public/cpp/window_observer.h
diff --git a/services/ui/public/cpp/window_observer.h b/services/ui/public/cpp/window_observer.h
index 83ed271c2cfeecefe10268c5be4fa85ae4f26641..03fafa858ad659edd0ff7dbdd34b43791e16952e 100644
--- a/services/ui/public/cpp/window_observer.h
+++ b/services/ui/public/cpp/window_observer.h
@@ -64,8 +64,24 @@ class WindowObserver {
virtual void OnWindowPredefinedCursorChanged(Window* window,
mojom::Cursor cursor) {}
- virtual void OnWindowVisibilityChanging(Window* window) {}
- virtual void OnWindowVisibilityChanged(Window* window) {}
+
+ // Changing the visibility of a window results in the following sequence of
+ // functions being called:
+ // . OnWindowVisibilityChanging(): called on observers added to the window
+ // whose visibility is changing. This is called before the visibility has
+ // changed internally.
+ // The following are called after the visibility changes:
+ // . OnChildWindowVisibilityChanged(): called on observers added to the
+ // parent of the window whose visibility changed. This function is generally
+ // intended for layout managers that need to do processing before
+ // OnWindowVisibilityChanged() is called on observers of the window.
+ // . OnWindowVisibilityChanged(): called on observers added to the window
+ // whose visibility changed, as well as observers added to the ancestor and
James Cook 2016/10/03 20:33:08 All ancestors or immediate ancestor only?
sky 2016/10/03 20:52:13 Added 'all' for both ancestors and descendants.
+ // descendants of the window.
James Cook 2016/10/03 20:33:08 Nice docs, btw.
+ virtual void OnWindowVisibilityChanging(Window* window, bool visible) {}
+ virtual void OnChildWindowVisibilityChanged(Window* window, bool visible) {}
+ virtual void OnWindowVisibilityChanged(Window* window, bool visible) {}
+
virtual void OnWindowOpacityChanged(Window* window,
float old_opacity,
float new_opacity) {}

Powered by Google App Engine
This is Rietveld 408576698