| 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_PORT_MUS_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_PORT_MUS_H_ |
| 6 #define UI_AURA_MUS_WINDOW_PORT_MUS_H_ | 6 #define UI_AURA_MUS_WINDOW_PORT_MUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // ScopedServerChange change(this, ServerChangeType::FOO, data); | 86 // ScopedServerChange change(this, ServerChangeType::FOO, data); |
| 87 // window_->SetFoo(...); | 87 // window_->SetFoo(...); |
| 88 // | 88 // |
| 89 // And the call from the Window (by way of WindowPort interface) looks like: | 89 // And the call from the Window (by way of WindowPort interface) looks like: |
| 90 // ServerChangeData change_data; | 90 // ServerChangeData change_data; |
| 91 // change_data.foo = ...; | 91 // change_data.foo = ...; |
| 92 // if (!RemoveChangeByTypeAndData(ServerChangeType::FOO, change_data)) | 92 // if (!RemoveChangeByTypeAndData(ServerChangeType::FOO, change_data)) |
| 93 // window_tree_client_->OnFooChanged(this, ...); | 93 // window_tree_client_->OnFooChanged(this, ...); |
| 94 enum ServerChangeType { | 94 enum ServerChangeType { |
| 95 ADD, | 95 ADD, |
| 96 ADD_TRANSIENT, |
| 96 BOUNDS, | 97 BOUNDS, |
| 97 PROPERTY, | 98 PROPERTY, |
| 98 REMOVE, | 99 REMOVE, |
| 100 REMOVE_TRANSIENT, |
| 99 REORDER, | 101 REORDER, |
| 100 VISIBLE, | 102 VISIBLE, |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 // Contains data needed to identify a change from the server. | 105 // Contains data needed to identify a change from the server. |
| 104 struct ServerChangeData { | 106 struct ServerChangeData { |
| 105 // Applies to ADD, REMOVE and REORDER. | 107 // Applies to ADD, ADD_TRANSIENT, REMOVE and REORDER. |
| 106 Id child_id; | 108 Id child_id; |
| 107 // Applies to BOUNDS. | 109 // Applies to BOUNDS. |
| 108 gfx::Rect bounds; | 110 gfx::Rect bounds; |
| 109 // Applies to VISIBLE. | 111 // Applies to VISIBLE. |
| 110 bool visible; | 112 bool visible; |
| 111 // Applies to PROPERTY. | 113 // Applies to PROPERTY. |
| 112 std::string property_name; | 114 std::string property_name; |
| 113 }; | 115 }; |
| 114 | 116 |
| 115 // Used to identify a change the server. | 117 // Used to identify a change the server. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ui::mojom::OrderDirection) override; | 172 ui::mojom::OrderDirection) override; |
| 171 void SetBoundsFromServer(const gfx::Rect& bounds) override; | 173 void SetBoundsFromServer(const gfx::Rect& bounds) override; |
| 172 void SetVisibleFromServer(bool visible) override; | 174 void SetVisibleFromServer(bool visible) override; |
| 173 void SetOpacityFromServer(float opacity) override; | 175 void SetOpacityFromServer(float opacity) override; |
| 174 void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) override; | 176 void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) override; |
| 175 void SetPropertyFromServer( | 177 void SetPropertyFromServer( |
| 176 const std::string& property_name, | 178 const std::string& property_name, |
| 177 const std::vector<uint8_t>* property_data) override; | 179 const std::vector<uint8_t>* property_data) override; |
| 178 void SetSurfaceIdFromServer( | 180 void SetSurfaceIdFromServer( |
| 179 std::unique_ptr<SurfaceInfo> surface_info) override; | 181 std::unique_ptr<SurfaceInfo> surface_info) override; |
| 182 void AddTransientChildFromServer(WindowMus* child) override; |
| 183 void RemoveTransientChildFromServer(WindowMus* child) override; |
| 184 ChangeSource OnTransientChildAdded(WindowMus* child) override; |
| 185 ChangeSource OnTransientChildRemoved(WindowMus* child) override; |
| 180 std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( | 186 std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( |
| 181 const gfx::Rect& bounds) override; | 187 const gfx::Rect& bounds) override; |
| 182 std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( | 188 std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( |
| 183 bool value) override; | 189 bool value) override; |
| 184 void NotifyEmbeddedAppDisconnected() override; | 190 void NotifyEmbeddedAppDisconnected() override; |
| 185 | 191 |
| 186 // WindowPort: | 192 // WindowPort: |
| 187 std::unique_ptr<WindowPortInitData> OnPreInit(Window* window) override; | 193 std::unique_ptr<WindowPortInitData> OnPreInit(Window* window) override; |
| 188 void OnPostInit(std::unique_ptr<WindowPortInitData> init_data) override; | 194 void OnPostInit(std::unique_ptr<WindowPortInitData> init_data) override; |
| 189 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | 195 void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 209 std::unique_ptr<SurfaceInfo> surface_info_; | 215 std::unique_ptr<SurfaceInfo> surface_info_; |
| 210 | 216 |
| 211 ui::mojom::Cursor predefined_cursor_ = ui::mojom::Cursor::CURSOR_NULL; | 217 ui::mojom::Cursor predefined_cursor_ = ui::mojom::Cursor::CURSOR_NULL; |
| 212 | 218 |
| 213 DISALLOW_COPY_AND_ASSIGN(WindowPortMus); | 219 DISALLOW_COPY_AND_ASSIGN(WindowPortMus); |
| 214 }; | 220 }; |
| 215 | 221 |
| 216 } // namespace aura | 222 } // namespace aura |
| 217 | 223 |
| 218 #endif // UI_AURA_MUS_WINDOW_PORT_MUS_H_ | 224 #endif // UI_AURA_MUS_WINDOW_PORT_MUS_H_ |
| OLD | NEW |