| 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/contents_container.h" | 5 #include "chrome/browser/ui/views/frame/contents_container.h" |
| 6 | 6 |
| 7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 #include "ui/views/controls/webview/webview.h" | 8 #include "ui/views/controls/webview/webview.h" |
| 9 | 9 |
| 10 // static | 10 // static |
| 11 const char ContentsContainer::kViewClassName[] = "ContentsContainer"; | 11 const char ContentsContainer::kViewClassName[] = "ContentsContainer"; |
| 12 | 12 |
| 13 ContentsContainer::ContentsContainer(views::WebView* active) | 13 ContentsContainer::ContentsContainer(views::View* active_web_view) |
| 14 : active_(active), | 14 : active_(active_web_view), |
| 15 active_top_margin_(0) { | 15 active_top_margin_(0) { |
| 16 AddChildView(active_); | 16 AddChildView(active_); |
| 17 } | 17 } |
| 18 | 18 |
| 19 ContentsContainer::~ContentsContainer() { | 19 ContentsContainer::~ContentsContainer() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void ContentsContainer::SetActive(views::WebView* overlay) { | 22 void ContentsContainer::SetActive(views::WebView* overlay) { |
| 23 DCHECK(overlay); | 23 DCHECK(overlay); |
| 24 active_ = overlay; | 24 active_ = overlay; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 active_->SetBounds(0, content_y, width(), content_height); | 43 active_->SetBounds(0, content_y, width(), content_height); |
| 44 | 44 |
| 45 // Need to invoke views::View in case any views whose bounds didn't change | 45 // Need to invoke views::View in case any views whose bounds didn't change |
| 46 // still need a layout. | 46 // still need a layout. |
| 47 views::View::Layout(); | 47 views::View::Layout(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 const char* ContentsContainer::GetClassName() const { | 50 const char* ContentsContainer::GetClassName() const { |
| 51 return kViewClassName; | 51 return kViewClassName; |
| 52 } | 52 } |
| OLD | NEW |