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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: WIP Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 return; // Nothing to do. 625 return; // Nothing to do.
626 626
627 wm::SetWindowFullscreen(window_, fullscreen); 627 wm::SetWindowFullscreen(window_, fullscreen);
628 } 628 }
629 629
630 bool NativeWidgetAura::IsFullscreen() const { 630 bool NativeWidgetAura::IsFullscreen() const {
631 return window_ && window_->GetProperty(aura::client::kShowStateKey) == 631 return window_ && window_->GetProperty(aura::client::kShowStateKey) ==
632 ui::SHOW_STATE_FULLSCREEN; 632 ui::SHOW_STATE_FULLSCREEN;
633 } 633 }
634 634
635 void NativeWidgetAura::Pin(bool trusted) {
636 aura::client::WindowPinType type =
637 trusted ? aura::client::WindowPinType::TRUSTED_PINNED
638 : aura::client::WindowPinType::PINNED;
639 if (!window_ || window_->GetProperty(aura::client::kWindowPinTypeKey) == type)
640 return; // Nothing to do.
641
642 window_->SetProperty(aura::client::kWindowPinTypeKey, type);
643 }
644
645 bool NativeWidgetAura::IsPinned() const {
646 aura::client::WindowPinType type =
647 window_->GetProperty(aura::client::kWindowPinTypeKey);
648 return type == aura::client::WindowPinType::PINNED ||
649 type == aura::client::WindowPinType::TRUSTED_PINNED;
650 }
651
635 void NativeWidgetAura::SetOpacity(float opacity) { 652 void NativeWidgetAura::SetOpacity(float opacity) {
636 if (window_) 653 if (window_)
637 window_->layer()->SetOpacity(opacity); 654 window_->layer()->SetOpacity(opacity);
638 } 655 }
639 656
640 void NativeWidgetAura::FlashFrame(bool flash) { 657 void NativeWidgetAura::FlashFrame(bool flash) {
641 if (window_) 658 if (window_)
642 window_->SetProperty(aura::client::kDrawAttentionKey, flash); 659 window_->SetProperty(aura::client::kDrawAttentionKey, flash);
643 } 660 }
644 661
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 gfx::NativeView native_view) { 1206 gfx::NativeView native_view) {
1190 aura::client::CaptureClient* capture_client = 1207 aura::client::CaptureClient* capture_client =
1191 aura::client::GetCaptureClient(native_view->GetRootWindow()); 1208 aura::client::GetCaptureClient(native_view->GetRootWindow());
1192 if (!capture_client) 1209 if (!capture_client)
1193 return nullptr; 1210 return nullptr;
1194 return capture_client->GetGlobalCaptureWindow(); 1211 return capture_client->GetGlobalCaptureWindow();
1195 } 1212 }
1196 1213
1197 } // namespace internal 1214 } // namespace internal
1198 } // namespace views 1215 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698