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

Unified Diff: components/mus/public/cpp/lib/window.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/window.cc
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc
index 8dffc7f52d010f64002e31389124d3b7af0c2530..33649aeca1388458823af1ded26e9e71b9e588f7 100644
--- a/components/mus/public/cpp/lib/window.cc
+++ b/components/mus/public/cpp/lib/window.cc
@@ -210,6 +210,15 @@ void Window::SetVisible(bool value) {
LocalSetVisible(value);
}
+void Window::SetPredefinedCursor(mus::mojom::Cursor cursor_id) {
+ if (cursor_id_ == cursor_id)
+ return;
+
+ if (connection_)
+ tree_client()->SetPredefinedCursor(id_, cursor_id);
+ LocalSetPredefinedCursor(cursor_id);
+}
+
bool Window::IsDrawn() const {
if (!visible_)
return false;
@@ -604,6 +613,15 @@ void Window::LocalSetVisible(bool visible) {
NotifyWindowVisibilityChanged(this);
}
+void Window::LocalSetPredefinedCursor(mojom::Cursor cursor_id) {
+ if (cursor_id_ == cursor_id)
+ return;
+
+ cursor_id_ = cursor_id;
+ FOR_EACH_OBSERVER(WindowObserver, observers_,
+ OnWindowSetPredefinedCursor(this, cursor_id));
+}
+
void Window::LocalSetSharedProperty(const std::string& name,
const std::vector<uint8_t>* value) {
std::vector<uint8_t> old_value;

Powered by Google App Engine
This is Rietveld 408576698