Store NativeWindow in weak ptr

This commit is contained in:
Cheng Zhao 2015-06-24 22:29:44 +08:00
parent 19ca011735
commit 4b61683cdf
2 changed files with 10 additions and 9 deletions

View file

@ -44,6 +44,8 @@ class CommonWebContentsDelegate
return web_contents_.get();
}
NativeWindow* owner_window() const { return owner_window_.get(); }
protected:
// content::WebContentsDelegate:
content::WebContents* OpenURLFromTab(
@ -90,7 +92,7 @@ class CommonWebContentsDelegate
void SetHtmlApiFullscreen(bool enter_fullscreen);
// The window that this WebContents belongs to.
NativeWindow* owner_window_;
base::WeakPtr<NativeWindow> owner_window_;
// Whether window is fullscreened by HTML5 api.
bool html_fullscreen_;