Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1845 /////////////////////////////////////////////////////////////////////////////// | 1845 /////////////////////////////////////////////////////////////////////////////// |
| 1846 // BrowserView, views::View overrides: | 1846 // BrowserView, views::View overrides: |
| 1847 | 1847 |
| 1848 std::string BrowserView::GetClassName() const { | 1848 std::string BrowserView::GetClassName() const { |
| 1849 return kViewClassName; | 1849 return kViewClassName; |
| 1850 } | 1850 } |
| 1851 | 1851 |
| 1852 void BrowserView::Layout() { | 1852 void BrowserView::Layout() { |
| 1853 if (ignore_layout_) | 1853 if (ignore_layout_) |
| 1854 return; | 1854 return; |
| 1855 | |
| 1856 int prev_content_height = contents_container_->height(); | |
| 1857 | |
| 1855 views::View::Layout(); | 1858 views::View::Layout(); |
| 1856 | 1859 |
| 1857 // The status bubble position requires that all other layout finish first. | 1860 // The status bubble position requires that all other layout finish first. |
| 1858 LayoutStatusBubble(); | 1861 LayoutStatusBubble(); |
| 1859 | 1862 |
| 1860 MaybeStackBookmarkBarAtTop(); | 1863 MaybeStackBookmarkBarAtTop(); |
| 1864 | |
| 1865 if (browser_->instant_controller() && | |
| 1866 prev_content_height != contents_container_->height()) { | |
|
sky
2012/11/19 15:07:31
Why do you need to check pref_content_height? Can'
kuan
2012/11/19 16:59:41
if page is ntp and theme image is not top-aligned,
| |
| 1867 browser_->instant_controller()->SetContentHeight( | |
| 1868 contents_container_->height()); | |
| 1869 } | |
| 1861 } | 1870 } |
| 1862 | 1871 |
| 1863 void BrowserView::PaintChildren(gfx::Canvas* canvas) { | 1872 void BrowserView::PaintChildren(gfx::Canvas* canvas) { |
| 1864 // Paint the |infobar_container_| last so that it may paint its | 1873 // Paint the |infobar_container_| last so that it may paint its |
| 1865 // overlapping tabs. | 1874 // overlapping tabs. |
| 1866 for (int i = 0; i < child_count(); ++i) { | 1875 for (int i = 0; i < child_count(); ++i) { |
| 1867 View* child = child_at(i); | 1876 View* child = child_at(i); |
| 1868 if (child != infobar_container_) | 1877 if (child != infobar_container_) |
| 1869 child->Paint(canvas); | 1878 child->Paint(canvas); |
| 1870 } | 1879 } |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2588 modal_browser->window()->Activate(); | 2597 modal_browser->window()->Activate(); |
| 2589 } | 2598 } |
| 2590 | 2599 |
| 2591 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2600 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
| 2592 } | 2601 } |
| 2593 | 2602 |
| 2594 void BrowserView::MaybeStackBookmarkBarAtTop() { | 2603 void BrowserView::MaybeStackBookmarkBarAtTop() { |
| 2595 if (bookmark_bar_view_.get()) | 2604 if (bookmark_bar_view_.get()) |
| 2596 bookmark_bar_view_->MaybeStackAtTop(); | 2605 bookmark_bar_view_->MaybeStackAtTop(); |
| 2597 } | 2606 } |
| OLD | NEW |