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

Unified Diff: ui/views/widget/native_widget_aura.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/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 4904f00c228f44d1686a8e7a59ee0e275e82fe82..bbb6981434fcf43c9f8c7145824df2303f110bab 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -632,6 +632,23 @@ bool NativeWidgetAura::IsFullscreen() const {
ui::SHOW_STATE_FULLSCREEN;
}
+void NativeWidgetAura::Pin(bool trusted) {
+ aura::client::WindowPinType type =
+ trusted ? aura::client::WindowPinType::TRUSTED_PINNED
+ : aura::client::WindowPinType::PINNED;
+ if (!window_ || window_->GetProperty(aura::client::kWindowPinTypeKey) == type)
+ return; // Nothing to do.
+
+ window_->SetProperty(aura::client::kWindowPinTypeKey, type);
+}
+
+bool NativeWidgetAura::IsPinned() const {
+ aura::client::WindowPinType type =
+ window_->GetProperty(aura::client::kWindowPinTypeKey);
+ return type == aura::client::WindowPinType::PINNED ||
+ type == aura::client::WindowPinType::TRUSTED_PINNED;
+}
+
void NativeWidgetAura::SetOpacity(float opacity) {
if (window_)
window_->layer()->SetOpacity(opacity);

Powered by Google App Engine
This is Rietveld 408576698