Commit a3545f54 authored by oshima@chromium.org's avatar oshima@chromium.org

Use the window's bounds if available instead of restore bounds for the initial...

Use the window's bounds if available instead of restore bounds for the initial size of the restored web contents.

BUG=378924

Review URL: https://codereview.chromium.org/394653005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283703 0039d316-1c4b-4281-b951-d872f2087c98
parent 977db4a4
......@@ -122,8 +122,12 @@ content::WebContents* AddRestoredTab(
// location calculations to be incorrect even after a new layout with
// proper view dimensions. TabStripModel::AddWebContents() contains similar
// logic.
apps::ResizeWebContents(web_contents,
browser->window()->GetRestoredBounds().size());
gfx::Size size = browser->window()->GetBounds().size();
// Fallback to the restore bounds if it's empty as the window is not shown
// yet and the bounds may not be available on all platforms.
if (size.IsEmpty())
size = browser->window()->GetRestoredBounds().size();
apps::ResizeWebContents(web_contents, size);
web_contents->WasHidden();
}
SessionService* session_service =
......
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