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

Side by Side Diff: ash/common/wm_window.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: Address review issues 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/common/wm_window.h" 5 #include "ash/common/wm_window.h"
6 6
7 #include "ash/aura/aura_layout_manager_adapter.h" 7 #include "ash/aura/aura_layout_manager_adapter.h"
8 #include "ash/aura/wm_shell_aura.h" 8 #include "ash/aura/wm_shell_aura.h"
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 } 483 }
484 484
485 void WmWindow::SetShowState(ui::WindowShowState show_state) { 485 void WmWindow::SetShowState(ui::WindowShowState show_state) {
486 window_->SetProperty(aura::client::kShowStateKey, show_state); 486 window_->SetProperty(aura::client::kShowStateKey, show_state);
487 } 487 }
488 488
489 ui::WindowShowState WmWindow::GetShowState() const { 489 ui::WindowShowState WmWindow::GetShowState() const {
490 return window_->GetProperty(aura::client::kShowStateKey); 490 return window_->GetProperty(aura::client::kShowStateKey);
491 } 491 }
492 492
493 void WmWindow::SetPinType(WindowPinType type) {
494 window_->SetProperty(kWindowPinTypeKey, type);
495 }
496
497 WindowPinType WmWindow::GetPinType() const {
498 return window_->GetProperty(kWindowPinTypeKey);
499 }
500
493 void WmWindow::SetPreMinimizedShowState(ui::WindowShowState show_state) { 501 void WmWindow::SetPreMinimizedShowState(ui::WindowShowState show_state) {
494 window_->SetProperty(aura::client::kPreMinimizedShowStateKey, show_state); 502 window_->SetProperty(aura::client::kPreMinimizedShowStateKey, show_state);
495 } 503 }
496 504
497 ui::WindowShowState WmWindow::GetPreMinimizedShowState() const { 505 ui::WindowShowState WmWindow::GetPreMinimizedShowState() const {
498 return window_->GetProperty(aura::client::kPreMinimizedShowStateKey); 506 return window_->GetProperty(aura::client::kPreMinimizedShowStateKey);
499 } 507 }
500 508
501 void WmWindow::SetPreFullscreenShowState(ui::WindowShowState show_state) { 509 void WmWindow::SetPreFullscreenShowState(ui::WindowShowState show_state) {
502 // We should never store the ui::SHOW_STATE_MINIMIZED as the show state before 510 // We should never store the ui::SHOW_STATE_MINIMIZED as the show state before
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 intptr_t old) { 777 intptr_t old) {
770 if (key == aura::client::kShowStateKey) { 778 if (key == aura::client::kShowStateKey) {
771 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); 779 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged();
772 return; 780 return;
773 } 781 }
774 if (key == aura::client::kImmersiveFullscreenKey) { 782 if (key == aura::client::kImmersiveFullscreenKey) {
775 bool enable = window_->GetProperty(aura::client::kImmersiveFullscreenKey); 783 bool enable = window_->GetProperty(aura::client::kImmersiveFullscreenKey);
776 GetWindowState()->set_in_immersive_fullscreen(enable); 784 GetWindowState()->set_in_immersive_fullscreen(enable);
777 return; 785 return;
778 } 786 }
787 if (key == kWindowPinTypeKey) {
788 ash::wm::GetWindowState(window_)->OnWindowPinTypeChanged();
789 return;
790 }
779 } 791 }
780 792
781 void WmWindow::OnTransientChildAdded(aura::Window* window, 793 void WmWindow::OnTransientChildAdded(aura::Window* window,
782 aura::Window* transient) { 794 aura::Window* transient) {
783 for (auto& observer : transient_observers_) 795 for (auto& observer : transient_observers_)
784 observer.OnTransientChildAdded(this, Get(transient)); 796 observer.OnTransientChildAdded(this, Get(transient));
785 } 797 }
786 798
787 void WmWindow::OnTransientChildRemoved(aura::Window* window, 799 void WmWindow::OnTransientChildRemoved(aura::Window* window,
788 aura::Window* transient) { 800 aura::Window* transient) {
789 for (auto& observer : transient_observers_) 801 for (auto& observer : transient_observers_)
790 observer.OnTransientChildRemoved(this, Get(transient)); 802 observer.OnTransientChildRemoved(this, Get(transient));
791 } 803 }
792 804
793 } // namespace ash 805 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698