| 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 4603f9ad3e48af8d39346db592288a6423291ba2..c4d927c82a516f0c461291f652a2bdb0cbc68e48 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_);
|
| @@ -208,6 +209,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.
|
| @@ -215,11 +217,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();
|
| @@ -246,13 +250,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)
|
| }
|
|
|