Pass isGuest when creating WebContents

This commit is contained in:
Cheng Zhao 2015-06-24 23:29:32 +08:00
parent 4b61683cdf
commit 081a4597e9
5 changed files with 46 additions and 28 deletions

View file

@ -116,14 +116,9 @@ CommonWebContentsDelegate::~CommonWebContentsDelegate() {
}
void CommonWebContentsDelegate::InitWithWebContents(
content::WebContents* web_contents,
NativeWindow* owner_window) {
owner_window_ = owner_window->GetWeakPtr();
content::WebContents* web_contents) {
web_contents->SetDelegate(this);
NativeWindowRelay* relay = new NativeWindowRelay(owner_window_);
web_contents->SetUserData(relay->key, relay);
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
@ -132,6 +127,13 @@ void CommonWebContentsDelegate::InitWithWebContents(
web_contents_->SetDelegate(this);
}
void CommonWebContentsDelegate::SetOwnerWindow(NativeWindow* owner_window) {
content::WebContents* web_contents = GetWebContents();
owner_window_ = owner_window->GetWeakPtr();
NativeWindowRelay* relay = new NativeWindowRelay(owner_window_);
web_contents->SetUserData(relay->key, relay);
}
void CommonWebContentsDelegate::DestroyWebContents() {
web_contents_.reset();
}