Register guest web view

This commit is contained in:
Cheng Zhao 2014-10-23 23:08:48 +08:00
parent 81599f1535
commit dacbf7a042
10 changed files with 126 additions and 56 deletions

View file

@ -44,6 +44,7 @@ WebContents::WebContents(const mate::Dictionary& options)
params.guest_delegate = this;
storage_.reset(content::WebContents::Create(params));
storage_->SetDelegate(this);
Observe(storage_.get());
}
@ -94,6 +95,9 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
return handled;
}
void WebContents::RenderViewReady() {
}
void WebContents::WebContentsDestroyed() {
// The RenderViewDeleted was not called when the WebContents is destroyed.
RenderViewDeleted(web_contents()->GetRenderViewHost());
@ -105,6 +109,12 @@ void WebContents::WillAttach(content::WebContents* embedder_web_contents,
LOG(ERROR) << "WillAttach";
}
content::WebContents* WebContents::CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) {
LOG(ERROR) << "CreateNewGuestWindow";
return nullptr;
}
void WebContents::DidAttach() {
LOG(ERROR) << "DidAttach";
}
@ -137,6 +147,7 @@ void WebContents::RegisterDestructionCallback(
}
void WebContents::Destroy() {
LOG(ERROR) << "Destroy";
if (storage_) {
if (!destruction_callback_.is_null())
destruction_callback_.Run();