| 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/lib/window_tree_client_impl.h" | 8 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" |
| 9 #include "components/mus/public/cpp/window_tree_connection.h" | 9 #include "components/mus/public/cpp/window_tree_connection.h" |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 void CrashInFlightChange::ChangeFailed() { | 54 void CrashInFlightChange::ChangeFailed() { |
| 55 CHECK(false); | 55 CHECK(false); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void CrashInFlightChange::Revert() { | 58 void CrashInFlightChange::Revert() { |
| 59 CHECK(false); | 59 CHECK(false); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // InFlightCaptureChange ------------------------------------------------------ |
| 63 |
| 64 InFlightCaptureChange::InFlightCaptureChange(Window* window, bool revert_value) |
| 65 : InFlightChange( |
| 66 window, |
| 67 revert_value ? ChangeType::RELEASE_CAPTURE : ChangeType::SET_CAPTURE), |
| 68 revert_value_(revert_value) {} |
| 69 |
| 70 InFlightCaptureChange::~InFlightCaptureChange() {} |
| 71 |
| 72 void InFlightCaptureChange::SetRevertValueFrom(const InFlightChange& change) { |
| 73 revert_value_ = |
| 74 static_cast<const InFlightCaptureChange&>(change).revert_value_; |
| 75 } |
| 76 |
| 77 void InFlightCaptureChange::Revert() { |
| 78 WindowPrivate(window()).LocalSetCapture(revert_value_); |
| 79 } |
| 80 |
| 62 // InFlightFocusChange -------------------------------------------------------- | 81 // InFlightFocusChange -------------------------------------------------------- |
| 63 | 82 |
| 64 InFlightFocusChange::InFlightFocusChange(WindowTreeClientImpl* connection, | 83 InFlightFocusChange::InFlightFocusChange(WindowTreeClientImpl* connection, |
| 65 Window* window) | 84 Window* window) |
| 66 : InFlightChange(nullptr, ChangeType::FOCUS), | 85 : InFlightChange(nullptr, ChangeType::FOCUS), |
| 67 connection_(connection), | 86 connection_(connection), |
| 68 revert_window_(nullptr) { | 87 revert_window_(nullptr) { |
| 69 SetRevertWindow(window); | 88 SetRevertWindow(window); |
| 70 } | 89 } |
| 71 | 90 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) { | 170 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) { |
| 152 revert_visible_ = | 171 revert_visible_ = |
| 153 static_cast<const InFlightVisibleChange&>(change).revert_visible_; | 172 static_cast<const InFlightVisibleChange&>(change).revert_visible_; |
| 154 } | 173 } |
| 155 | 174 |
| 156 void InFlightVisibleChange::Revert() { | 175 void InFlightVisibleChange::Revert() { |
| 157 WindowPrivate(window()).LocalSetVisible(revert_visible_); | 176 WindowPrivate(window()).LocalSetVisible(revert_visible_); |
| 158 } | 177 } |
| 159 | 178 |
| 160 } // namespace mus | 179 } // namespace mus |
| OLD | NEW |