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

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

Issue 2387013003: Adds OnChildWindowVisibilityChanged to ui::WindowObserver (Closed)
Patch Set: merge 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
« no previous file with comments | « services/ui/public/cpp/window.cc ('k') | services/ui/ws/window_manager_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a5c003be32873277113004988ccc890d6725487d 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 all ancestors and
+ // all descendants of the window.
+ 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) {}
« no previous file with comments | « services/ui/public/cpp/window.cc ('k') | services/ui/ws/window_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698