| 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_connection.h" | 8 #include "components/mus/public/cpp/window_tree_connection.h" |
| 9 | 9 |
| 10 namespace mus { | 10 namespace mus { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void InFlightPropertyChange::SetRevertValueFrom(const InFlightChange& change) { | 78 void InFlightPropertyChange::SetRevertValueFrom(const InFlightChange& change) { |
| 79 revert_value_ = | 79 revert_value_ = |
| 80 static_cast<const InFlightPropertyChange&>(change).revert_value_.Clone(); | 80 static_cast<const InFlightPropertyChange&>(change).revert_value_.Clone(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void InFlightPropertyChange::Revert() { | 83 void InFlightPropertyChange::Revert() { |
| 84 WindowPrivate(window()) | 84 WindowPrivate(window()) |
| 85 .LocalSetSharedProperty(property_name_, revert_value_.Pass()); | 85 .LocalSetSharedProperty(property_name_, revert_value_.Pass()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 // InFlightPredefinedCursorChange --------------------------------------------- |
| 89 |
| 90 InFlightPredefinedCursorChange::InFlightPredefinedCursorChange( |
| 91 Window* window, |
| 92 mojom::Cursor revert_value) |
| 93 : InFlightChange(window, ChangeType::PREDEFINED_CURSOR), |
| 94 revert_cursor_(revert_value) {} |
| 95 |
| 96 InFlightPredefinedCursorChange::~InFlightPredefinedCursorChange() {} |
| 97 |
| 98 void InFlightPredefinedCursorChange::SetRevertValueFrom( |
| 99 const InFlightChange& change) { |
| 100 revert_cursor_ = |
| 101 static_cast<const InFlightPredefinedCursorChange&>(change).revert_cursor_; |
| 102 } |
| 103 |
| 104 void InFlightPredefinedCursorChange::Revert() { |
| 105 WindowPrivate(window()).LocalSetPredefinedCursor(revert_cursor_); |
| 106 } |
| 107 |
| 88 // InFlightVisibleChange ------------------------------------------------------- | 108 // InFlightVisibleChange ------------------------------------------------------- |
| 89 | 109 |
| 90 InFlightVisibleChange::InFlightVisibleChange(Window* window, | 110 InFlightVisibleChange::InFlightVisibleChange(Window* window, |
| 91 bool revert_value) | 111 bool revert_value) |
| 92 : InFlightChange(window, ChangeType::VISIBLE), | 112 : InFlightChange(window, ChangeType::VISIBLE), |
| 93 revert_visible_(revert_value) {} | 113 revert_visible_(revert_value) {} |
| 94 | 114 |
| 95 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) { | 115 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) { |
| 96 revert_visible_ = | 116 revert_visible_ = |
| 97 static_cast<const InFlightVisibleChange&>(change).revert_visible_; | 117 static_cast<const InFlightVisibleChange&>(change).revert_visible_; |
| 98 } | 118 } |
| 99 | 119 |
| 100 void InFlightVisibleChange::Revert() { | 120 void InFlightVisibleChange::Revert() { |
| 101 WindowPrivate(window()).LocalSetVisible(revert_visible_); | 121 WindowPrivate(window()).LocalSetVisible(revert_visible_); |
| 102 } | 122 } |
| 103 | 123 |
| 104 } // namespace mus | 124 } // namespace mus |
| OLD | NEW |