OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 /////////////////////////////////////////////////////////////////////////////// | 2000 /////////////////////////////////////////////////////////////////////////////// |
2001 // BrowserView, views::View overrides: | 2001 // BrowserView, views::View overrides: |
2002 | 2002 |
2003 std::string BrowserView::GetClassName() const { | 2003 std::string BrowserView::GetClassName() const { |
2004 return kViewClassName; | 2004 return kViewClassName; |
2005 } | 2005 } |
2006 | 2006 |
2007 void BrowserView::Layout() { | 2007 void BrowserView::Layout() { |
2008 if (ignore_layout_) | 2008 if (ignore_layout_) |
2009 return; | 2009 return; |
| 2010 |
| 2011 int prev_content_height = contents_container_->height(); |
| 2012 |
2010 views::View::Layout(); | 2013 views::View::Layout(); |
2011 | 2014 |
2012 // The status bubble position requires that all other layout finish first. | 2015 // The status bubble position requires that all other layout finish first. |
2013 LayoutStatusBubble(); | 2016 LayoutStatusBubble(); |
2014 | 2017 |
2015 MaybeStackBookmarkBarAtTop(); | 2018 MaybeStackBookmarkBarAtTop(); |
| 2019 |
| 2020 if (browser_->instant_controller() && |
| 2021 prev_content_height != contents_container_->height()) { |
| 2022 browser_->instant_controller()->SetContentHeight( |
| 2023 contents_container_->height()); |
| 2024 } |
2016 } | 2025 } |
2017 | 2026 |
2018 void BrowserView::PaintChildren(gfx::Canvas* canvas) { | 2027 void BrowserView::PaintChildren(gfx::Canvas* canvas) { |
2019 // Paint the |infobar_container_| last so that it may paint its | 2028 // Paint the |infobar_container_| last so that it may paint its |
2020 // overlapping tabs. | 2029 // overlapping tabs. |
2021 for (int i = 0; i < child_count(); ++i) { | 2030 for (int i = 0; i < child_count(); ++i) { |
2022 View* child = child_at(i); | 2031 View* child = child_at(i); |
2023 if (child != infobar_container_) | 2032 if (child != infobar_container_) |
2024 child->Paint(canvas); | 2033 child->Paint(canvas); |
2025 } | 2034 } |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2743 modal_browser->window()->Activate(); | 2752 modal_browser->window()->Activate(); |
2744 } | 2753 } |
2745 | 2754 |
2746 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2755 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2747 } | 2756 } |
2748 | 2757 |
2749 void BrowserView::MaybeStackBookmarkBarAtTop() { | 2758 void BrowserView::MaybeStackBookmarkBarAtTop() { |
2750 if (bookmark_bar_view_.get()) | 2759 if (bookmark_bar_view_.get()) |
2751 bookmark_bar_view_->MaybeStackAtTop(); | 2760 bookmark_bar_view_->MaybeStackAtTop(); |
2752 } | 2761 } |
OLD | NEW |