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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: WIP Created 3 years, 9 months 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: ui/views/mus/desktop_window_tree_host_mus.cc
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc
index c5a677a40ca0811f84957db15681829173cc25e2..704f8ccfcf242a2ffe1d749cc28dbf730df8e3a2 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -553,6 +553,13 @@ void DesktopWindowTreeHostMus::Minimize() {
window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
}
+void DesktopWindowTreeHostMus::Pin(bool trusted) {
+ aura::client::WindowPinType type =
+ trusted ? aura::client::WindowPinType::TRUSTED_PINNED
+ : aura::client::WindowPinType::PINNED;
+ window()->SetProperty(aura::client::kWindowPinTypeKey, type);
+}
+
void DesktopWindowTreeHostMus::Restore() {
window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
}
@@ -567,6 +574,13 @@ bool DesktopWindowTreeHostMus::IsMinimized() const {
ui::SHOW_STATE_MINIMIZED;
}
+bool DesktopWindowTreeHostMus::IsPinned() const {
+ aura::client::WindowPinType type =
+ window()->GetProperty(aura::client::kWindowPinTypeKey);
+ return type == aura::client::WindowPinType::PINNED ||
+ type == aura::client::WindowPinType::TRUSTED_PINNED;
+}
+
bool DesktopWindowTreeHostMus::HasCapture() const {
// Capture state is held by DesktopNativeWidgetAura::content_window_.
// DesktopNativeWidgetAura::HasCapture() calls content_window_->HasCapture(),

Powered by Google App Engine
This is Rietveld 408576698