OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 views::View::ConvertPointToScreen(this, &screen_origin); | 183 views::View::ConvertPointToScreen(this, &screen_origin); |
184 DCHECK_GT(max_autocomplete_y, screen_origin.y()); | 184 DCHECK_GT(max_autocomplete_y, screen_origin.y()); |
185 int preview_origin = max_autocomplete_y - screen_origin.y(); | 185 int preview_origin = max_autocomplete_y - screen_origin.y(); |
186 if (preview_origin < height()) { | 186 if (preview_origin < height()) { |
187 preview_->SetBounds(0, preview_origin, width(), | 187 preview_->SetBounds(0, preview_origin, width(), |
188 height() - preview_origin); | 188 height() - preview_origin); |
189 } else { | 189 } else { |
190 preview_->SetBounds(0, 0, 0, 0); | 190 preview_->SetBounds(0, 0, 0, 0); |
191 } | 191 } |
192 } | 192 } |
| 193 |
| 194 // Need to invoke views::View in case any views whose bounds didn't change |
| 195 // still need a layout. |
| 196 views::View::Layout(); |
193 } | 197 } |
194 | 198 |
195 private: | 199 private: |
196 BrowserView* browser_view_; | 200 BrowserView* browser_view_; |
197 views::View* active_; | 201 views::View* active_; |
198 views::View* preview_; | 202 views::View* preview_; |
199 | 203 |
200 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); | 204 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); |
201 }; | 205 }; |
202 | 206 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 return status_bubble_.get(); | 833 return status_bubble_.get(); |
830 } | 834 } |
831 | 835 |
832 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { | 836 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { |
833 if (is_animating) { | 837 if (is_animating) { |
834 contents_container_->SetFastResize(true); | 838 contents_container_->SetFastResize(true); |
835 UpdateUIForContents(browser_->GetSelectedTabContents()); | 839 UpdateUIForContents(browser_->GetSelectedTabContents()); |
836 contents_container_->SetFastResize(false); | 840 contents_container_->SetFastResize(false); |
837 } else { | 841 } else { |
838 UpdateUIForContents(browser_->GetSelectedTabContents()); | 842 UpdateUIForContents(browser_->GetSelectedTabContents()); |
| 843 // When transitioning from animating to not animating we need to make sure |
| 844 // the contents_container_ gets layed out. If we don't do this and the |
| 845 // bounds haven't changed contents_container_ won't get a Layout out and |
| 846 // we'll end up with a gray rect because the clip wasn't updated. |
| 847 contents_container_->InvalidateLayout(); |
839 contents_split_->Layout(); | 848 contents_split_->Layout(); |
840 } | 849 } |
841 } | 850 } |
842 | 851 |
843 void BrowserView::UpdateTitleBar() { | 852 void BrowserView::UpdateTitleBar() { |
844 frame_->GetWindow()->UpdateWindowTitle(); | 853 frame_->GetWindow()->UpdateWindowTitle(); |
845 if (ShouldShowWindowIcon() && !loading_animation_timer_.IsRunning()) | 854 if (ShouldShowWindowIcon() && !loading_animation_timer_.IsRunning()) |
846 frame_->GetWindow()->UpdateWindowIcon(); | 855 frame_->GetWindow()->UpdateWindowIcon(); |
847 } | 856 } |
848 | 857 |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); | 2521 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); |
2513 | 2522 |
2514 return view; | 2523 return view; |
2515 } | 2524 } |
2516 #endif | 2525 #endif |
2517 | 2526 |
2518 // static | 2527 // static |
2519 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 2528 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
2520 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 2529 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
2521 } | 2530 } |
OLD | NEW |