Store NativeWindow's weak ptr in WebContents

This commit is contained in:
Cheng Zhao 2015-06-24 22:14:46 +08:00
parent 2532318bee
commit 2bfa9da82e
5 changed files with 33 additions and 6 deletions

View file

@ -123,6 +123,9 @@ void CommonWebContentsDelegate::InitWithWebContents(
owner_window_ = owner_window;
web_contents->SetDelegate(this);
NativeWindowRelay* relay = new NativeWindowRelay(owner_window_->GetWeakPtr());
web_contents->SetUserData(relay->key, relay);
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);