Index: chrome/browser/views/old_frames/vista_frame.cc |
=================================================================== |
--- chrome/browser/views/old_frames/vista_frame.cc (revision 3362) |
+++ chrome/browser/views/old_frames/vista_frame.cc (working copy) |
@@ -128,6 +128,7 @@ |
shelf_view_(NULL), |
bookmark_bar_view_(NULL), |
info_bar_view_(NULL), |
+ needs_layout_(false), |
is_off_the_record_(false), |
off_the_record_image_(NULL), |
distributor_logo_(NULL), |
@@ -386,6 +387,7 @@ |
browser_view_->LayoutStatusBubble(browser_y + browser_h); |
frame_view_->SchedulePaint(); |
+ needs_layout_ = false; |
} |
//////////////////////////////////////////////////////////////////////////////// |
@@ -1607,30 +1609,28 @@ |
void VistaFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { |
// Coalesce layouts. |
- bool changed = false; |
- |
ChromeViews::View* new_shelf = NULL; |
if (current_tab && current_tab->IsDownloadShelfVisible()) |
new_shelf = current_tab->GetDownloadShelfView(); |
- changed |= UpdateChildViewAndLayout(new_shelf, &shelf_view_); |
+ needs_layout_ |= UpdateChildViewAndLayout(new_shelf, &shelf_view_); |
ChromeViews::View* new_info_bar = NULL; |
WebContents* web_contents = current_tab ? current_tab->AsWebContents() : NULL; |
if (web_contents && web_contents->view()->IsInfoBarVisible()) |
new_info_bar = web_contents->view()->GetInfoBarView(); |
- changed |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); |
+ needs_layout_ |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); |
ChromeViews::View* new_bookmark_bar_view = NULL; |
if (SupportsBookmarkBar()) |
new_bookmark_bar_view = GetBookmarkBarView(); |
- changed |= UpdateChildViewAndLayout(new_bookmark_bar_view, |
- &active_bookmark_bar_); |
+ needs_layout_ |= UpdateChildViewAndLayout(new_bookmark_bar_view, |
+ &active_bookmark_bar_); |
// Only do a layout if the current contents is non-null. We assume that if the |
// contents is NULL, we're either being destroyed, or ShowTabContents is going |
// to be invoked with a non-null TabContents again so that there is no need |
// in doing a layout now (and would result in extra work/invalidation on |
// tab switches). |
- if (changed && current_tab) |
+ if (needs_layout_ && current_tab) |
Layout(); |
} |