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

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

Issue 2625113004: Unify window fullscreen and minimizing implementation (Closed)
Patch Set: Fix review issue Created 3 years, 11 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
« no previous file with comments | « ash/common/wm/default_state.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shelf/shelf_item_types.h" 10 #include "ash/common/shelf/shelf_item_types.h"
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 759
760 void WmWindow::Activate() { 760 void WmWindow::Activate() {
761 wm::ActivateWindow(window_); 761 wm::ActivateWindow(window_);
762 } 762 }
763 763
764 void WmWindow::Deactivate() { 764 void WmWindow::Deactivate() {
765 wm::DeactivateWindow(window_); 765 wm::DeactivateWindow(window_);
766 } 766 }
767 767
768 void WmWindow::SetFullscreen(bool fullscreen) { 768 void WmWindow::SetFullscreen(bool fullscreen) {
769 if (fullscreen) { 769 ::wm::SetWindowFullscreen(window_, fullscreen);
770 window_->SetProperty(aura::client::kShowStateKey,
771 ui::SHOW_STATE_FULLSCREEN);
772 } else {
773 auto state = window_->GetProperty(aura::client::kPreFullscreenShowStateKey);
774 DCHECK_NE(state, ui::SHOW_STATE_MINIMIZED);
775 window_->SetProperty(aura::client::kShowStateKey, state);
776 window_->ClearProperty(aura::client::kPreFullscreenShowStateKey);
777 }
778 } 770 }
779 771
780 void WmWindow::Maximize() { 772 void WmWindow::Maximize() {
781 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 773 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
782 } 774 }
783 775
784 void WmWindow::Minimize() { 776 void WmWindow::Minimize() {
785 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 777 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
786 } 778 }
787 779
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 observer.OnTransientChildAdded(this, Get(transient)); 1004 observer.OnTransientChildAdded(this, Get(transient));
1013 } 1005 }
1014 1006
1015 void WmWindow::OnTransientChildRemoved(aura::Window* window, 1007 void WmWindow::OnTransientChildRemoved(aura::Window* window,
1016 aura::Window* transient) { 1008 aura::Window* transient) {
1017 for (auto& observer : transient_observers_) 1009 for (auto& observer : transient_observers_)
1018 observer.OnTransientChildRemoved(this, Get(transient)); 1010 observer.OnTransientChildRemoved(this, Get(transient));
1019 } 1011 }
1020 1012
1021 } // namespace ash 1013 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/default_state.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698