Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8543)

Unified Diff: chrome/browser/ui/views/frame/top_container_view.cc

Issue 83343006: Enable immersive fullscreen for hosted apps part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/top_container_view.cc
diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc
index 212c7999e1fffda704732f1564106e68615e7149..4c95ebd0b3d823dc4dabb467ae017ea0147fba9b 100644
--- a/chrome/browser/ui/views/frame/top_container_view.cc
+++ b/chrome/browser/ui/views/frame/top_container_view.cc
@@ -21,10 +21,19 @@ gfx::Size TopContainerView::GetPreferredSize() {
// be above the bottom of the toolbar while the bookmark bar is animating.
int height = 0;
for (int i = 0; i < child_count(); ++i) {
- int child_bottom = child_at(i)->bounds().bottom();
+ views::View* child = child_at(i);
+ if (!child->visible())
+ continue;
+ int child_bottom = child->bounds().bottom();
if (child_bottom > height)
height = child_bottom;
}
+ if (browser_view_->immersive_mode_controller()->IsRevealed()) {
+ // In immersive fullscreen, the TopContainerView paints the window header
+ // (themes, window title, window controls). The TopContainerView must still
+ // paint these even if it does not have any visible children.
+ height = std::max(height, browser_view_->frame()->GetTopInset());
+ }
return gfx::Size(browser_view_->width(), height);
}
@@ -32,14 +41,12 @@ const char* TopContainerView::GetClassName() const {
return "TopContainerView";
}
-void TopContainerView::PaintChildren(gfx::Canvas* canvas) {
+void TopContainerView::OnPaintBackground(gfx::Canvas* canvas) {
if (browser_view_->immersive_mode_controller()->IsRevealed()) {
- // Top-views depend on parts of the frame (themes, window buttons) being
- // painted underneath them. Clip rect has already been set to the bounds
- // of this view, so just paint the frame.
+ // Top-views depend on parts of the frame (themes, window title,
+ // window controls) being painted underneath them. Clip rect has already
+ // been set to the bounds of this view, so just paint the frame.
views::View* frame = browser_view_->frame()->GetFrameView();
frame->Paint(canvas);
}
-
- views::View::PaintChildren(canvas);
}
« no previous file with comments | « chrome/browser/ui/views/frame/top_container_view.h ('k') | chrome/test/base/browser_with_test_window_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698