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

Unified Diff: chrome/browser/ui/browser_tabrestore.cc

Issue 394653005: Use the window's bounds if available instead of restore bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_tabrestore.cc
diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc
index abe591c09c9cef4174b053a11c3f143c9e974572..c5af58f03c2de18ff361fb89949dc26ed22a07da 100644
--- a/chrome/browser/ui/browser_tabrestore.cc
+++ b/chrome/browser/ui/browser_tabrestore.cc
@@ -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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698