| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 ~ScopedServerChange() { window_impl_->RemoveChangeById(server_change_id_); } | 131 ~ScopedServerChange() { window_impl_->RemoveChangeById(server_change_id_); } |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 WindowPortMus* window_impl_; | 134 WindowPortMus* window_impl_; |
| 135 const ServerChangeIdType server_change_id_; | 135 const ServerChangeIdType server_change_id_; |
| 136 | 136 |
| 137 DISALLOW_COPY_AND_ASSIGN(ScopedServerChange); | 137 DISALLOW_COPY_AND_ASSIGN(ScopedServerChange); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 struct WindowMusChangeDataImpl : public WindowMusChangeData { |
| 141 WindowMusChangeDataImpl(); |
| 142 ~WindowMusChangeDataImpl() override; |
| 143 |
| 144 std::unique_ptr<ScopedServerChange> change; |
| 145 }; |
| 146 |
| 140 // Creates and adds a ServerChange to |server_changes_|. Returns the id | 147 // Creates and adds a ServerChange to |server_changes_|. Returns the id |
| 141 // assigned to the ServerChange. | 148 // assigned to the ServerChange. |
| 142 ServerChangeIdType ScheduleChange(const ServerChangeType type, | 149 ServerChangeIdType ScheduleChange(const ServerChangeType type, |
| 143 const ServerChangeData& data); | 150 const ServerChangeData& data); |
| 144 | 151 |
| 145 // Removes a ServerChange by id. | 152 // Removes a ServerChange by id. |
| 146 void RemoveChangeById(ServerChangeIdType change_id); | 153 void RemoveChangeById(ServerChangeIdType change_id); |
| 147 | 154 |
| 148 // If there is a schedule change matching |type| and |data| it is removed and | 155 // If there is a schedule change matching |type| and |data| it is removed and |
| 149 // true is returned. If no matching change is scheduled returns false. | 156 // true is returned. If no matching change is scheduled returns false. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 161 ui::mojom::OrderDirection) override; | 168 ui::mojom::OrderDirection) override; |
| 162 void SetBoundsFromServer(const gfx::Rect& bounds) override; | 169 void SetBoundsFromServer(const gfx::Rect& bounds) override; |
| 163 void SetVisibleFromServer(bool visible) override; | 170 void SetVisibleFromServer(bool visible) override; |
| 164 void SetOpacityFromServer(float opacity) override; | 171 void SetOpacityFromServer(float opacity) override; |
| 165 void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) override; | 172 void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) override; |
| 166 void SetPropertyFromServer( | 173 void SetPropertyFromServer( |
| 167 const std::string& property_name, | 174 const std::string& property_name, |
| 168 const std::vector<uint8_t>* property_data) override; | 175 const std::vector<uint8_t>* property_data) override; |
| 169 void SetSurfaceIdFromServer( | 176 void SetSurfaceIdFromServer( |
| 170 std::unique_ptr<SurfaceInfo> surface_info) override; | 177 std::unique_ptr<SurfaceInfo> surface_info) override; |
| 178 std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( |
| 179 const gfx::Rect& bounds) override; |
| 180 std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( |
| 181 bool value) override; |
| 171 void NotifyEmbeddedAppDisconnected() override; | 182 void NotifyEmbeddedAppDisconnected() override; |
| 172 | 183 |
| 173 // WindowPort: | 184 // WindowPort: |
| 174 std::unique_ptr<WindowPortInitData> OnPreInit(Window* window) override; | 185 std::unique_ptr<WindowPortInitData> OnPreInit(Window* window) override; |
| 175 void OnPostInit(std::unique_ptr<WindowPortInitData> init_data) override; | 186 void OnPostInit(std::unique_ptr<WindowPortInitData> init_data) override; |
| 176 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | 187 void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
| 177 void OnWillAddChild(Window* child) override; | 188 void OnWillAddChild(Window* child) override; |
| 178 void OnWillRemoveChild(Window* child) override; | 189 void OnWillRemoveChild(Window* child) override; |
| 179 void OnWillMoveChild(size_t current_index, size_t dest_index) override; | 190 void OnWillMoveChild(size_t current_index, size_t dest_index) override; |
| 180 void OnVisibilityChanged(bool visible) override; | 191 void OnVisibilityChanged(bool visible) override; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 195 std::unique_ptr<SurfaceInfo> surface_info_; | 206 std::unique_ptr<SurfaceInfo> surface_info_; |
| 196 | 207 |
| 197 ui::mojom::Cursor predefined_cursor_ = ui::mojom::Cursor::CURSOR_NULL; | 208 ui::mojom::Cursor predefined_cursor_ = ui::mojom::Cursor::CURSOR_NULL; |
| 198 | 209 |
| 199 DISALLOW_COPY_AND_ASSIGN(WindowPortMus); | 210 DISALLOW_COPY_AND_ASSIGN(WindowPortMus); |
| 200 }; | 211 }; |
| 201 | 212 |
| 202 } // namespace aura | 213 } // namespace aura |
| 203 | 214 |
| 204 #endif // UI_AURA_MUS_WINDOW_PORT_MUS_H_ | 215 #endif // UI_AURA_MUS_WINDOW_PORT_MUS_H_ |
| OLD | NEW |