| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void OnWindowLostCapture(Window* window) {} | 57 virtual void OnWindowLostCapture(Window* window) {} |
| 58 virtual void OnWindowClientAreaChanged( | 58 virtual void OnWindowClientAreaChanged( |
| 59 Window* window, | 59 Window* window, |
| 60 const gfx::Insets& old_client_area, | 60 const gfx::Insets& old_client_area, |
| 61 const std::vector<gfx::Rect>& old_additional_client_areas) {} | 61 const std::vector<gfx::Rect>& old_additional_client_areas) {} |
| 62 | 62 |
| 63 virtual void OnWindowFocusChanged(Window* gained_focus, Window* lost_focus) {} | 63 virtual void OnWindowFocusChanged(Window* gained_focus, Window* lost_focus) {} |
| 64 | 64 |
| 65 virtual void OnWindowPredefinedCursorChanged(Window* window, | 65 virtual void OnWindowPredefinedCursorChanged(Window* window, |
| 66 mojom::Cursor cursor) {} | 66 mojom::Cursor cursor) {} |
| 67 virtual void OnWindowVisibilityChanging(Window* window) {} | 67 |
| 68 virtual void OnWindowVisibilityChanged(Window* window) {} | 68 // Changing the visibility of a window results in the following sequence of |
| 69 // functions being called: |
| 70 // . OnWindowVisibilityChanging(): called on observers added to the window |
| 71 // whose visibility is changing. This is called before the visibility has |
| 72 // changed internally. |
| 73 // The following are called after the visibility changes: |
| 74 // . OnChildWindowVisibilityChanged(): called on observers added to the |
| 75 // parent of the window whose visibility changed. This function is generally |
| 76 // intended for layout managers that need to do processing before |
| 77 // OnWindowVisibilityChanged() is called on observers of the window. |
| 78 // . OnWindowVisibilityChanged(): called on observers added to the window |
| 79 // whose visibility changed, as well as observers added to all ancestors and |
| 80 // all descendants of the window. |
| 81 virtual void OnWindowVisibilityChanging(Window* window, bool visible) {} |
| 82 virtual void OnChildWindowVisibilityChanged(Window* window, bool visible) {} |
| 83 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} |
| 84 |
| 69 virtual void OnWindowOpacityChanged(Window* window, | 85 virtual void OnWindowOpacityChanged(Window* window, |
| 70 float old_opacity, | 86 float old_opacity, |
| 71 float new_opacity) {} | 87 float new_opacity) {} |
| 72 | 88 |
| 73 // Invoked when this Window's shared properties have changed. This can either | 89 // Invoked when this Window's shared properties have changed. This can either |
| 74 // be caused by SetSharedProperty() being called locally, or by us receiving | 90 // be caused by SetSharedProperty() being called locally, or by us receiving |
| 75 // a mojo message that this property has changed. If this property has been | 91 // a mojo message that this property has changed. If this property has been |
| 76 // added, |old_data| is null. If this property was removed, |new_data| is | 92 // added, |old_data| is null. If this property was removed, |new_data| is |
| 77 // null. | 93 // null. |
| 78 virtual void OnWindowSharedPropertyChanged( | 94 virtual void OnWindowSharedPropertyChanged( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 106 // allows the close it should destroy the window as appropriate. | 122 // allows the close it should destroy the window as appropriate. |
| 107 virtual void OnRequestClose(Window* window) {} | 123 virtual void OnRequestClose(Window* window) {} |
| 108 | 124 |
| 109 protected: | 125 protected: |
| 110 virtual ~WindowObserver() {} | 126 virtual ~WindowObserver() {} |
| 111 }; | 127 }; |
| 112 | 128 |
| 113 } // namespace ui | 129 } // namespace ui |
| 114 | 130 |
| 115 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 131 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
| OLD | NEW |