| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 UI_AURA_MUS_WINDOW_MUS_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_MUS_H_ |
| 6 #define UI_AURA_MUS_WINDOW_MUS_H_ | 6 #define UI_AURA_MUS_WINDOW_MUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // These functions are called in response to a change from the server. The | 70 // These functions are called in response to a change from the server. The |
| 71 // expectation is that in calling these WindowTreeClient is not called | 71 // expectation is that in calling these WindowTreeClient is not called |
| 72 // back. For example, SetBoundsFromServer() should not result in calling back | 72 // back. For example, SetBoundsFromServer() should not result in calling back |
| 73 // to WindowTreeClient::OnWindowMusBoundsChanged(). | 73 // to WindowTreeClient::OnWindowMusBoundsChanged(). |
| 74 virtual void AddChildFromServer(WindowMus* window) = 0; | 74 virtual void AddChildFromServer(WindowMus* window) = 0; |
| 75 virtual void RemoveChildFromServer(WindowMus* child) = 0; | 75 virtual void RemoveChildFromServer(WindowMus* child) = 0; |
| 76 virtual void ReorderFromServer(WindowMus* child, | 76 virtual void ReorderFromServer(WindowMus* child, |
| 77 WindowMus* relative, | 77 WindowMus* relative, |
| 78 ui::mojom::OrderDirection) = 0; | 78 ui::mojom::OrderDirection) = 0; |
| 79 virtual void SetBoundsFromServer(const gfx::Rect& bounds) = 0; | 79 virtual void SetBoundsFromServer( |
| 80 const gfx::Rect& bounds, |
| 81 const base::Optional<cc::LocalSurfaceId>& local_surface_id) = 0; |
| 80 virtual void SetVisibleFromServer(bool visible) = 0; | 82 virtual void SetVisibleFromServer(bool visible) = 0; |
| 81 virtual void SetOpacityFromServer(float opacity) = 0; | 83 virtual void SetOpacityFromServer(float opacity) = 0; |
| 82 virtual void SetPredefinedCursorFromServer(ui::mojom::CursorType cursor) = 0; | 84 virtual void SetPredefinedCursorFromServer(ui::mojom::CursorType cursor) = 0; |
| 83 virtual void SetPropertyFromServer(const std::string& property_name, | 85 virtual void SetPropertyFromServer(const std::string& property_name, |
| 84 const std::vector<uint8_t>* data) = 0; | 86 const std::vector<uint8_t>* data) = 0; |
| 85 virtual void SetFrameSinkIdFromServer( | 87 virtual void SetFrameSinkIdFromServer( |
| 86 const cc::FrameSinkId& frame_sink_id) = 0; | 88 const cc::FrameSinkId& frame_sink_id) = 0; |
| 89 virtual const cc::LocalSurfaceId& GetOrAllocateLocalSurfaceId( |
| 90 const gfx::Size& new_size) = 0; |
| 87 virtual void SetSurfaceInfoFromServer( | 91 virtual void SetSurfaceInfoFromServer( |
| 88 const cc::SurfaceInfo& surface_info) = 0; | 92 const cc::SurfaceInfo& surface_info) = 0; |
| 89 // The window was deleted on the server side. DestroyFromServer() should | 93 // The window was deleted on the server side. DestroyFromServer() should |
| 90 // result in deleting |this|. | 94 // result in deleting |this|. |
| 91 virtual void DestroyFromServer() = 0; | 95 virtual void DestroyFromServer() = 0; |
| 92 virtual void AddTransientChildFromServer(WindowMus* child) = 0; | 96 virtual void AddTransientChildFromServer(WindowMus* child) = 0; |
| 93 virtual void RemoveTransientChildFromServer(WindowMus* child) = 0; | 97 virtual void RemoveTransientChildFromServer(WindowMus* child) = 0; |
| 94 // Called when a window was added/removed as a transient child. | 98 // Called when a window was added/removed as a transient child. |
| 95 virtual ChangeSource OnTransientChildAdded(WindowMus* child) = 0; | 99 virtual ChangeSource OnTransientChildAdded(WindowMus* child) = 0; |
| 96 virtual ChangeSource OnTransientChildRemoved(WindowMus* child) = 0; | 100 virtual ChangeSource OnTransientChildRemoved(WindowMus* child) = 0; |
| 97 | 101 |
| 102 // Returns the currently used cc::LocalSurfaceId to embed this Window. Local |
| 103 // windows or windows that have not been embedded yet will have an invalid |
| 104 // cc::LocalSurfaceId. |
| 105 virtual const cc::LocalSurfaceId& GetLocalSurfaceId() = 0; |
| 106 |
| 98 // Called in the rare case when WindowTreeClient needs to change state and | 107 // Called in the rare case when WindowTreeClient needs to change state and |
| 99 // can't go through one of the SetFooFromServer() functions above. Generally | 108 // can't go through one of the SetFooFromServer() functions above. Generally |
| 100 // because it needs to call another function that as a side effect changes the | 109 // because it needs to call another function that as a side effect changes the |
| 101 // window. Once the call to the underlying window has completed the returned | 110 // window. Once the call to the underlying window has completed the returned |
| 102 // object should be destroyed. | 111 // object should be destroyed. |
| 103 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( | 112 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( |
| 104 const gfx::Rect& bounds) = 0; | 113 const gfx::Rect& bounds) = 0; |
| 105 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( | 114 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( |
| 106 bool value) = 0; | 115 bool value) = 0; |
| 107 | 116 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 123 | 132 |
| 124 void set_server_id(Id id) { server_id_ = id; } | 133 void set_server_id(Id id) { server_id_ = id; } |
| 125 | 134 |
| 126 Id server_id_ = kInvalidServerId; | 135 Id server_id_ = kInvalidServerId; |
| 127 const WindowMusType window_mus_type_; | 136 const WindowMusType window_mus_type_; |
| 128 }; | 137 }; |
| 129 | 138 |
| 130 } // namespace aura | 139 } // namespace aura |
| 131 | 140 |
| 132 #endif // UI_AURA_MUS_WINDOW_MUS_H_ | 141 #endif // UI_AURA_MUS_WINDOW_MUS_H_ |
| OLD | NEW |