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 #include "services/ui/public/cpp/in_flight_change.h" | 5 #include "services/ui/public/cpp/in_flight_change.h" |
6 | 6 |
7 #include "services/ui/public/cpp/window_private.h" | 7 #include "services/ui/public/cpp/window_private.h" |
8 #include "services/ui/public/cpp/window_tree_client.h" | 8 #include "services/ui/public/cpp/window_tree_client.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) { | 33 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) { |
34 revert_bounds_ = | 34 revert_bounds_ = |
35 static_cast<const InFlightBoundsChange&>(change).revert_bounds_; | 35 static_cast<const InFlightBoundsChange&>(change).revert_bounds_; |
36 } | 36 } |
37 | 37 |
38 void InFlightBoundsChange::Revert() { | 38 void InFlightBoundsChange::Revert() { |
39 WindowPrivate(window()).LocalSetBounds(window()->bounds(), revert_bounds_); | 39 WindowPrivate(window()).LocalSetBounds(window()->bounds(), revert_bounds_); |
40 } | 40 } |
41 | 41 |
42 // InFlightMoveLoopChange ----------------------------------------------------- | 42 // InFlightDragChange ----------------------------------------------------- |
43 | 43 |
44 InFlightMoveLoopChange::InFlightMoveLoopChange(Window* window) | 44 InFlightDragChange::InFlightDragChange(Window* window, ChangeType type) |
45 : InFlightChange(window, ChangeType::MOVE_LOOP) {} | 45 : InFlightChange(window, type) { |
| 46 DCHECK(type == ChangeType::MOVE_LOOP || type == ChangeType::DRAG_LOOP); |
| 47 } |
46 | 48 |
47 void InFlightMoveLoopChange::SetRevertValueFrom(const InFlightChange& change) {} | 49 void InFlightDragChange::SetRevertValueFrom(const InFlightChange& change) {} |
48 | 50 |
49 void InFlightMoveLoopChange::Revert() { | 51 void InFlightDragChange::Revert() {} |
50 // Reverting bounds happens in the window server in the error case; it cannot | |
51 // happen in the client because this could conflict with a | |
52 // InFlightBoundsChange. | |
53 } | |
54 | 52 |
55 // CrashInFlightChange -------------------------------------------------------- | 53 // CrashInFlightChange -------------------------------------------------------- |
56 | 54 |
57 CrashInFlightChange::CrashInFlightChange(Window* window, ChangeType type) | 55 CrashInFlightChange::CrashInFlightChange(Window* window, ChangeType type) |
58 : InFlightChange(window, type) {} | 56 : InFlightChange(window, type) {} |
59 | 57 |
60 CrashInFlightChange::~CrashInFlightChange() {} | 58 CrashInFlightChange::~CrashInFlightChange() {} |
61 | 59 |
62 void CrashInFlightChange::SetRevertValueFrom(const InFlightChange& change) { | 60 void CrashInFlightChange::SetRevertValueFrom(const InFlightChange& change) { |
63 CHECK(false); | 61 CHECK(false); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 222 |
225 InFlightSetModalChange::~InFlightSetModalChange() {} | 223 InFlightSetModalChange::~InFlightSetModalChange() {} |
226 | 224 |
227 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} | 225 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} |
228 | 226 |
229 void InFlightSetModalChange::Revert() { | 227 void InFlightSetModalChange::Revert() { |
230 WindowPrivate(window()).LocalUnsetModal(); | 228 WindowPrivate(window()).LocalUnsetModal(); |
231 } | 229 } |
232 | 230 |
233 } // namespace ui | 231 } // namespace ui |
OLD | NEW |