summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 20:45:35 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 20:45:35 +0000
commitc00c2b1896e7a62f4cdcf0b42b94ec90a8ae4691 (patch)
tree2a67683bb1f064d3606c9699e41e572cf2125f91 /chrome
parent9d29f2d54d2d388343d43c29a7d154055d57e58c (diff)
downloadchromium_src-c00c2b1896e7a62f4cdcf0b42b94ec90a8ae4691.zip
chromium_src-c00c2b1896e7a62f4cdcf0b42b94ec90a8ae4691.tar.gz
chromium_src-c00c2b1896e7a62f4cdcf0b42b94ec90a8ae4691.tar.bz2
gtk: Only notify the TabContents that the browser window has moved or resized if the window has actually moved or resized. This fixes a ~20ms startup performance regression.
BUG=37975 TEST=none Review URL: http://codereview.chromium.org/844004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 2c1bb32..46adb2f 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1210,11 +1210,16 @@ void BrowserWindowGtk::DestroyBrowser() {
void BrowserWindowGtk::OnBoundsChanged(const gfx::Rect& bounds) {
GetLocationBar()->location_entry()->ClosePopup();
- // Notify the TabContents that the browser window has been resized or moved.
- // This is used to close AutoFill popups in the renderer.
- TabContents* tab_contents = browser_->GetSelectedTabContents();
- if (tab_contents)
- tab_contents->WindowMoveOrResizeStarted();
+ // Only notify the TabContents about the move or resize if we actually have
+ // moved or resized. We also don't need to notify for the initial
+ // configuration when the browser window is created.
+ if (!bounds_.IsEmpty() && !bounds_.Equals(bounds)) {
+ // Notify the TabContents that the browser window has been resized or moved.
+ // This is used to close AutoFill popups in the renderer.
+ TabContents* tab_contents = browser_->GetSelectedTabContents();
+ if (tab_contents)
+ tab_contents->WindowMoveOrResizeStarted();
+ }
if (bounds_.size() != bounds.size())
OnSizeChanged(bounds.width(), bounds.height());