| 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 508fff9f24523528d3bd8804b09a49af50f3bfda..85ba03c82bd5c410c4528d232d8d763a436991c8 100644
|
| --- a/chrome/browser/ui/views/frame/contents_container.cc
|
| +++ b/chrome/browser/ui/views/frame/contents_container.cc
|
| @@ -18,7 +18,8 @@ ContentsContainer::ContentsContainer(views::WebView* active)
|
| overlay_(NULL),
|
| preview_(NULL),
|
| preview_web_contents_(NULL),
|
| - active_top_margin_(0) {
|
| + active_top_margin_(0),
|
| + preview_height_(-1) {
|
| AddChildView(active_);
|
| }
|
|
|
| @@ -84,6 +85,12 @@ gfx::Rect ContentsContainer::GetPreviewBounds() {
|
| return gfx::Rect(screen_loc, size());
|
| }
|
|
|
| +void ContentsContainer::SetPreviewHeight(int value, bool is_percent) {
|
| + preview_height_ = is_percent ? (value * height()) / 100 : value;
|
| +
|
| + Layout();
|
| +}
|
| +
|
| void ContentsContainer::Layout() {
|
| int content_y = active_top_margin_;
|
| int content_height = std::max(0, height() - content_y);
|
| @@ -95,7 +102,9 @@ void ContentsContainer::Layout() {
|
| overlay_->SetBounds(0, 0, width(), height());
|
|
|
| if (preview_)
|
| - preview_->SetBounds(0, 0, width(), height());
|
| + preview_->SetBounds(0, 0, width(),
|
| + (preview_height_ < 0 || preview_height_ > height() ?
|
| + height() : preview_height_));
|
|
|
| // Need to invoke views::View in case any views whose bounds didn't change
|
| // still need a layout.
|
|
|