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_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 bool InFlightPredefinedCursorChange::Matches( | |
| 99 const InFlightChange& change) const { | |
| 100 return static_cast<const InFlightPredefinedCursorChange&>(change) | |
|
sky
2015/12/02 21:42:35
You shouldn't need to override Matches. The reason
| |
| 101 .revert_cursor_ == revert_cursor_; | |
| 102 } | |
| 103 | |
| 104 void InFlightPredefinedCursorChange::SetRevertValueFrom( | |
| 105 const InFlightChange& change) { | |
| 106 revert_cursor_ = | |
| 107 static_cast<const InFlightPredefinedCursorChange&>(change).revert_cursor_; | |
| 108 } | |
| 109 | |
| 110 void InFlightPredefinedCursorChange::Revert() { | |
| 111 WindowPrivate(window()).LocalSetPredefinedCursor(revert_cursor_); | |
| 112 } | |
| 113 | |
| 88 } // namespace mus | 114 } // namespace mus |
| OLD | NEW |