Chromium Code Reviews| 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 "components/mus/public/cpp/lib/in_flight_change.h" | 5 #include "components/mus/public/cpp/lib/in_flight_change.h" |
| 6 | 6 |
| 7 #include "components/mus/public/cpp/lib/window_private.h" | 7 #include "components/mus/public/cpp/lib/window_private.h" |
| 8 #include "components/mus/public/cpp/window_tree_client.h" | 8 #include "components/mus/public/cpp/window_tree_client.h" |
| 9 | 9 |
| 10 namespace mus { | 10 namespace mus { |
| (...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 ----------------------------------------------------- | |
| 43 | |
| 44 InFlightMoveLoopChange::InFlightMoveLoopChange(Window* window, | |
| 45 const gfx::Rect& revert_bounds) | |
| 46 : InFlightChange(window, ChangeType::MOVE_LOOP), | |
| 47 revert_bounds_(revert_bounds) {} | |
| 48 | |
| 49 void InFlightMoveLoopChange::SetRevertValueFrom(const InFlightChange& change) { | |
| 50 revert_bounds_ = | |
| 51 static_cast<const InFlightMoveLoopChange&>(change).revert_bounds_; | |
| 52 } | |
| 53 | |
| 54 void InFlightMoveLoopChange::Revert() { | |
| 55 WindowPrivate(window()).LocalSetBounds(window()->bounds(), revert_bounds_); | |
|
sky
2016/06/22 23:47:56
This is problematic because it may conflict with a
| |
| 56 } | |
| 57 | |
| 42 // CrashInFlightChange -------------------------------------------------------- | 58 // CrashInFlightChange -------------------------------------------------------- |
| 43 | 59 |
| 44 CrashInFlightChange::CrashInFlightChange(Window* window, ChangeType type) | 60 CrashInFlightChange::CrashInFlightChange(Window* window, ChangeType type) |
| 45 : InFlightChange(window, type) {} | 61 : InFlightChange(window, type) {} |
| 46 | 62 |
| 47 CrashInFlightChange::~CrashInFlightChange() {} | 63 CrashInFlightChange::~CrashInFlightChange() {} |
| 48 | 64 |
| 49 void CrashInFlightChange::SetRevertValueFrom(const InFlightChange& change) { | 65 void CrashInFlightChange::SetRevertValueFrom(const InFlightChange& change) { |
| 50 CHECK(false); | 66 CHECK(false); |
| 51 } | 67 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 | 227 |
| 212 InFlightSetModalChange::~InFlightSetModalChange() {} | 228 InFlightSetModalChange::~InFlightSetModalChange() {} |
| 213 | 229 |
| 214 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} | 230 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} |
| 215 | 231 |
| 216 void InFlightSetModalChange::Revert() { | 232 void InFlightSetModalChange::Revert() { |
| 217 WindowPrivate(window()).LocalUnsetModal(); | 233 WindowPrivate(window()).LocalUnsetModal(); |
| 218 } | 234 } |
| 219 | 235 |
| 220 } // namespace mus | 236 } // namespace mus |
| OLD | NEW |