Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1622)

Unified Diff: components/mus/public/cpp/lib/in_flight_change.cc

Issue 1465803003: mus: Let clients set the cursor of their window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix WindowTreeAppTest.SetCursor. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/lib/in_flight_change.cc
diff --git a/components/mus/public/cpp/lib/in_flight_change.cc b/components/mus/public/cpp/lib/in_flight_change.cc
index d6017c86beb3a14b41416e526803b6df503776bc..0401a104d8fe07acba33157b75fa745d1f293e1d 100644
--- a/components/mus/public/cpp/lib/in_flight_change.cc
+++ b/components/mus/public/cpp/lib/in_flight_change.cc
@@ -85,4 +85,30 @@ void InFlightPropertyChange::Revert() {
.LocalSetSharedProperty(property_name_, revert_value_.Pass());
}
+// InFlightPredefinedCursorChange ---------------------------------------------
+
+InFlightPredefinedCursorChange::InFlightPredefinedCursorChange(
+ Window* window,
+ mojom::Cursor revert_value)
+ : InFlightChange(window, ChangeType::PREDEFINED_CURSOR),
+ revert_cursor_(revert_value) {}
+
+InFlightPredefinedCursorChange::~InFlightPredefinedCursorChange() {}
+
+bool InFlightPredefinedCursorChange::Matches(
+ const InFlightChange& change) const {
+ return static_cast<const InFlightPredefinedCursorChange&>(change)
sky 2015/12/02 21:42:35 You shouldn't need to override Matches. The reason
+ .revert_cursor_ == revert_cursor_;
+}
+
+void InFlightPredefinedCursorChange::SetRevertValueFrom(
+ const InFlightChange& change) {
+ revert_cursor_ =
+ static_cast<const InFlightPredefinedCursorChange&>(change).revert_cursor_;
+}
+
+void InFlightPredefinedCursorChange::Revert() {
+ WindowPrivate(window()).LocalSetPredefinedCursor(revert_cursor_);
+}
+
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698