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

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

Issue 13684002: cros: Instant extended support for immersive fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months 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/contents_container.cc
diff --git a/chrome/browser/ui/views/frame/contents_container.cc b/chrome/browser/ui/views/frame/contents_container.cc
index 3663a2191d4f0c3835246feb144409826e67362b..598dfc4f11efdb490c54371e8e1c9a7ebf0f810e 100644
--- a/chrome/browser/ui/views/frame/contents_container.cc
+++ b/chrome/browser/ui/views/frame/contents_container.cc
@@ -84,6 +84,7 @@ ContentsContainer::ContentsContainer(views::WebView* active)
overlay_web_contents_(NULL),
draw_drop_shadow_(false),
active_top_margin_(0),
+ overlay_top_margin_(0),
overlay_height_(100),
overlay_height_units_(INSTANT_SIZE_PERCENT) {
AddChildView(active_);
@@ -211,6 +212,7 @@ void ContentsContainer::MaybeStackOverlayAtTop() {
RemoveChildView(shadow_view_.get());
removed_shadow = true;
}
+ // TODO(jamescook): This can be done more efficiently with ReorderChildView().
RemoveChildView(overlay_);
AddChildView(overlay_);
if (removed_shadow) // Add back shadow view if it was removed.
@@ -218,11 +220,13 @@ void ContentsContainer::MaybeStackOverlayAtTop() {
Layout();
}
-void ContentsContainer::SetActiveTopMargin(int margin) {
- if (active_top_margin_ == margin)
+void ContentsContainer::SetWebViewsTopMargins(int active_top_margin,
+ int overlay_top_margin) {
+ if (active_top_margin_ == active_top_margin &&
+ overlay_top_margin_ == overlay_top_margin)
return;
-
- active_top_margin_ = margin;
+ active_top_margin_ = active_top_margin;
+ overlay_top_margin_ = overlay_top_margin;
// Make sure we layout next time around. We need this in case our bounds
// haven't changed.
InvalidateLayout();
@@ -249,13 +253,13 @@ void ContentsContainer::Layout() {
active_->SetBounds(0, content_y, width(), content_height);
if (overlay_) {
- overlay_->SetBounds(0, 0, width(),
- OverlayHeightInPixels(height(), overlay_height_,
- overlay_height_units_));
+ int overlay_height_pixels =
+ OverlayHeightInPixels(height(), overlay_height_, overlay_height_units_);
+ overlay_->SetBounds(0, overlay_top_margin_, width(), overlay_height_pixels);
if (draw_drop_shadow_) {
#if !defined(OS_WIN)
DCHECK(shadow_view_.get() && shadow_view_->parent());
- shadow_view_->SetBounds(0, overlay_->bounds().height(), width(),
+ shadow_view_->SetBounds(0, overlay_->bounds().bottom(), width(),
shadow_view_->GetPreferredSize().height());
#endif // !defined(OS_WIN)
}

Powered by Google App Engine
This is Rietveld 408576698