Commit ef677f6b authored by zhchbin@gmail.com's avatar zhchbin@gmail.com

App windows with ids should remember fullscreen state.

BUG=242790
TEST=PlatformAppBrowserTest.ShellWindowRestoreState
TEST=1. Install window-state-sample: https://chrome.google.com/webstore/detail/window-state-sample/hcbhfbnaaancmblfhdknlnojpafjohbi; 2. Run the app and create a new window with id. 3. Fullscreen the new window by clicking "Fullscreen" of "chrome.app.window" section; 4. Close the window (You can use "Alt+F4" etc.) and recreate the new window with the same id. 5. A fullscreen window should be shown.

Review URL: https://chromiumcodereview.appspot.com/23672029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222226 0039d316-1c4b-4281-b951-d872f2087c98
parent 92e1da96
......@@ -468,6 +468,8 @@ gfx::Rect NativeAppWindowCocoa::GetRestoredBounds() const {
ui::WindowShowState NativeAppWindowCocoa::GetRestoredState() const {
if (IsMaximized())
return ui::SHOW_STATE_MAXIMIZED;
if (IsFullscreen())
return ui::SHOW_STATE_FULLSCREEN;
return ui::SHOW_STATE_NORMAL;
}
......
......@@ -211,6 +211,8 @@ gfx::Rect NativeAppWindowGtk::GetRestoredBounds() const {
ui::WindowShowState NativeAppWindowGtk::GetRestoredState() const {
if (IsMaximized())
return ui::SHOW_STATE_MAXIMIZED;
if (IsFullscreen())
return ui::SHOW_STATE_FULLSCREEN;
return ui::SHOW_STATE_NORMAL;
}
......
......@@ -326,11 +326,9 @@ gfx::Rect NativeAppWindowViews::GetRestoredBounds() const {
ui::WindowShowState NativeAppWindowViews::GetRestoredState() const {
if (IsMaximized())
return ui::SHOW_STATE_MAXIMIZED;
#if defined(USE_ASH)
// On Ash, restore fullscreen.
if (IsFullscreen())
return ui::SHOW_STATE_FULLSCREEN;
#if defined(USE_ASH)
// Use kRestoreShowStateKey in case a window is minimized/hidden.
ui::WindowShowState restore_state =
window_->GetNativeWindow()->GetProperty(
......
......@@ -6,10 +6,17 @@ var assertState = function(win) {
if (win.id == 'normal') {
chrome.test.assertFalse(win.isMinimized());
chrome.test.assertFalse(win.isMaximized());
chrome.test.assertFalse(win.isFullscreen());
}
if (win.id == 'maximized') {
chrome.test.assertFalse(win.isMinimized());
chrome.test.assertTrue(win.isMaximized());
chrome.test.assertFalse(win.isFullscreen());
}
if (win.id == 'fullscreen') {
chrome.test.assertFalse(win.isMinimized());
chrome.test.assertFalse(win.isMaximized());
chrome.test.assertTrue(win.isFullscreen());
}
}
......@@ -41,6 +48,9 @@ chrome.app.runtime.onLaunched.addListener(function() {
function testRestoreMaximized() {
testRestoreState('maximized');
},
function testRestoreFullscreen() {
testRestoreState('fullscreen');
},
// Minimize and fullscreen behavior are platform dependent.
]);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment