ContainerView should manage itself.

This commit is contained in:
Cheng Zhao 2014-06-10 10:03:35 +08:00
parent b0374b6a1d
commit 566022cb66
2 changed files with 4 additions and 2 deletions

View file

@ -23,6 +23,7 @@ class ContainerView : public views::View {
: container_view_created_(false),
web_view_(new views::WebView(NULL)),
web_contents_view_(web_contents_view) {
set_owned_by_client();
web_view_->SetWebContents(
web_contents_view_->inspectable_web_contents()->GetWebContents());
}
@ -69,7 +70,7 @@ InspectableWebContentsViewWin::~InspectableWebContentsViewWin() {
}
views::View* InspectableWebContentsViewWin::GetView() const {
return container_;
return container_.get();
}
gfx::NativeView InspectableWebContentsViewWin::GetNativeView() const {

View file

@ -4,6 +4,7 @@
#include "browser/inspectable_web_contents_view.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
namespace views {
@ -38,7 +39,7 @@ class InspectableWebContentsViewWin : public InspectableWebContentsView {
// Owns us.
InspectableWebContentsImpl* inspectable_web_contents_;
ContainerView* container_;
scoped_ptr<ContainerView> container_;
base::WeakPtr<DevToolsWindow> devtools_window_;