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

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: Do it the other way + explicit checks that it is a mouse pointer. 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
« no previous file with comments | « components/mus/public/cpp/lib/in_flight_change.cc ('k') | components/mus/public/cpp/lib/window_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aa77867da61727ca3344761050f3aab48c9e2980..de3eb7664ab59fbe6c9adc02f9a5f86942094a36 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_,
+ OnWindowPredefinedCursorChanged(this, cursor_id));
+}
+
void Window::LocalSetSharedProperty(const std::string& name,
const std::vector<uint8_t>* value) {
std::vector<uint8_t> old_value;
« no previous file with comments | « components/mus/public/cpp/lib/in_flight_change.cc ('k') | components/mus/public/cpp/lib/window_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698