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

Unified Diff: ash/common/wm_window.cc

Issue 2622053004: ash: Restore previous show state after exiting fullscreen. (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/mus/top_level_window_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_window.cc
diff --git a/ash/common/wm_window.cc b/ash/common/wm_window.cc
index 05b781bcc3cb2385b82e2d7edfd01b85901a890b..74c64d6e5a579ac1eb7a2b4aeb4e12862150a424 100644
--- a/ash/common/wm_window.cc
+++ b/ash/common/wm_window.cc
@@ -609,8 +609,19 @@ ui::WindowShowState WmWindow::GetShowState() const {
return window_->GetProperty(aura::client::kShowStateKey);
}
-void WmWindow::SetRestoreShowState(ui::WindowShowState show_state) {
- window_->SetProperty(aura::client::kRestoreShowStateKey, show_state);
+void WmWindow::SetPreMinimizedShowState(ui::WindowShowState show_state) {
+ window_->SetProperty(aura::client::kPreMinimizedShowStateKey, show_state);
+}
+
+ui::WindowShowState WmWindow::GetPreMinimizedShowState() const {
+ return window_->GetProperty(aura::client::kPreMinimizedShowStateKey);
+}
+
+void WmWindow::SetPreFullscreenShowState(ui::WindowShowState show_state) {
+ // We should never store the ui::SHOW_STATE_MINIMIZED as the show state before
+ // fullscreen.
+ DCHECK_NE(show_state, ui::SHOW_STATE_MINIMIZED);
+ window_->SetProperty(aura::client::kPreFullscreenShowStateKey, show_state);
}
void WmWindow::SetRestoreOverrides(const gfx::Rect& bounds_override,
@@ -754,8 +765,16 @@ void WmWindow::Deactivate() {
wm::DeactivateWindow(window_);
}
-void WmWindow::SetFullscreen() {
- window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
+void WmWindow::SetFullscreen(bool fullscreen) {
+ if (fullscreen) {
+ window_->SetProperty(aura::client::kShowStateKey,
+ ui::SHOW_STATE_FULLSCREEN);
+ } else {
+ auto state = window_->GetProperty(aura::client::kPreFullscreenShowStateKey);
+ DCHECK_NE(state, ui::SHOW_STATE_MINIMIZED);
+ window_->SetProperty(aura::client::kShowStateKey, state);
+ window_->ClearProperty(aura::client::kPreFullscreenShowStateKey);
+ }
}
void WmWindow::Maximize() {
@@ -769,8 +788,8 @@ void WmWindow::Minimize() {
void WmWindow::Unminimize() {
window_->SetProperty(
aura::client::kShowStateKey,
- window_->GetProperty(aura::client::kRestoreShowStateKey));
- window_->ClearProperty(aura::client::kRestoreShowStateKey);
+ window_->GetProperty(aura::client::kPreMinimizedShowStateKey));
+ window_->ClearProperty(aura::client::kPreMinimizedShowStateKey);
}
std::vector<WmWindow*> WmWindow::GetChildren() {
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/mus/top_level_window_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698