OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 enum class ChangeType { | 28 enum class ChangeType { |
29 ADD_CHILD, | 29 ADD_CHILD, |
30 ADD_TRANSIENT_WINDOW, | 30 ADD_TRANSIENT_WINDOW, |
31 BOUNDS, | 31 BOUNDS, |
32 DELETE_WINDOW, | 32 DELETE_WINDOW, |
33 FOCUS, | 33 FOCUS, |
34 NEW_WINDOW, | 34 NEW_WINDOW, |
35 NEW_TOP_LEVEL_WINDOW, | 35 NEW_TOP_LEVEL_WINDOW, |
36 PREDEFINED_CURSOR, | 36 PREDEFINED_CURSOR, |
37 PROPERTY, | 37 PROPERTY, |
| 38 RELEASE_CAPTURE, |
38 REMOVE_CHILD, | 39 REMOVE_CHILD, |
39 REMOVE_TRANSIENT_WINDOW_FROM_PARENT, | 40 REMOVE_TRANSIENT_WINDOW_FROM_PARENT, |
40 REORDER, | 41 REORDER, |
| 42 SET_CAPTURE, |
41 VISIBLE, | 43 VISIBLE, |
42 }; | 44 }; |
43 | 45 |
44 // InFlightChange is used to track function calls to the server and take the | 46 // InFlightChange is used to track function calls to the server and take the |
45 // appropriate action when the call fails, or the same property changes while | 47 // appropriate action when the call fails, or the same property changes while |
46 // waiting for the response. When a function is called on the server an | 48 // waiting for the response. When a function is called on the server an |
47 // InFlightChange is created. The function call is complete when | 49 // InFlightChange is created. The function call is complete when |
48 // OnChangeCompleted() is received from the server. The following may occur | 50 // OnChangeCompleted() is received from the server. The following may occur |
49 // while waiting for a response: | 51 // while waiting for a response: |
50 // . A new value is encountered from the server. For example, the bounds of | 52 // . A new value is encountered from the server. For example, the bounds of |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 150 |
149 // InFlightChange: | 151 // InFlightChange: |
150 void SetRevertValueFrom(const InFlightChange& change) override; | 152 void SetRevertValueFrom(const InFlightChange& change) override; |
151 void ChangeFailed() override; | 153 void ChangeFailed() override; |
152 void Revert() override; | 154 void Revert() override; |
153 | 155 |
154 private: | 156 private: |
155 DISALLOW_COPY_AND_ASSIGN(CrashInFlightChange); | 157 DISALLOW_COPY_AND_ASSIGN(CrashInFlightChange); |
156 }; | 158 }; |
157 | 159 |
| 160 class InFlightCaptureChange : public InFlightChange { |
| 161 public: |
| 162 InFlightCaptureChange(Window* window, bool revert_value); |
| 163 ~InFlightCaptureChange() override; |
| 164 |
| 165 // InFlightChange: |
| 166 void SetRevertValueFrom(const InFlightChange& change) override; |
| 167 void Revert() override; |
| 168 |
| 169 private: |
| 170 bool revert_value_; |
| 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(InFlightCaptureChange); |
| 173 }; |
| 174 |
158 // Focus is really a property of the WindowTreeConnection and not the Window. | 175 // Focus is really a property of the WindowTreeConnection and not the Window. |
159 // As such, InFlightFocusChange is special in that it is not associated with | 176 // As such, InFlightFocusChange is special in that it is not associated with |
160 // a particular window (InFlightFocusChange::window() returns null). Internally | 177 // a particular window (InFlightFocusChange::window() returns null). Internally |
161 // InFlightFocusChange tracks a window to give focus to, but it may be null. | 178 // InFlightFocusChange tracks a window to give focus to, but it may be null. |
162 class InFlightFocusChange : public InFlightChange, public WindowObserver { | 179 class InFlightFocusChange : public InFlightChange, public WindowObserver { |
163 public: | 180 public: |
164 InFlightFocusChange(WindowTreeClientImpl* connection, Window* revert_window); | 181 InFlightFocusChange(WindowTreeClientImpl* connection, Window* revert_window); |
165 ~InFlightFocusChange() override; | 182 ~InFlightFocusChange() override; |
166 | 183 |
167 // InFlightChange: | 184 // InFlightChange: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 241 |
225 private: | 242 private: |
226 bool revert_visible_; | 243 bool revert_visible_; |
227 | 244 |
228 DISALLOW_COPY_AND_ASSIGN(InFlightVisibleChange); | 245 DISALLOW_COPY_AND_ASSIGN(InFlightVisibleChange); |
229 }; | 246 }; |
230 | 247 |
231 } // namespace mus | 248 } // namespace mus |
232 | 249 |
233 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ | 250 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_IN_FLIGHT_CHANGE_H_ |
OLD | NEW |