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

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 10836324: Panels test cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: chrome/browser/ui/panels/panel.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index b8a2790deb6e5792aa232db996e3ab54c1c76e2d..ac995394bfeebeb01ec39b4da3c441bad5c0c070 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -506,9 +506,17 @@ void Panel::OnContentsAutoResized(const gfx::Size& new_content_size) {
if (!panel_strip_)
return;
- panel_strip_->ResizePanelWindow(
- this,
- native_panel_->WindowSizeFromContentSize(new_content_size));
+ gfx::Size new_window_size =
+ native_panel_->WindowSizeFromContentSize(new_content_size);
+
+ // Ignore content auto resizes until window frame size is known.
+ // This reduces extra resizes when panel is first shown.
+ // After window frame size is known, it will trigger another content
+ // auto resize.
+ if (new_content_size == new_window_size)
+ return;
+
+ panel_strip_->ResizePanelWindow(this, new_window_size);
}
void Panel::OnWindowResizedByMouse(const gfx::Rect& new_bounds) {

Powered by Google App Engine
This is Rietveld 408576698