JavaScript window.close() should close the browser window (issue #614).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@708 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-25 18:05:00 +00:00
parent 9546ff9c77
commit f7c91a7d6b
2 changed files with 5 additions and 0 deletions

View File

@ -883,6 +883,10 @@ void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source) {
} }
} }
void CefBrowserHostImpl::CloseContents(content::WebContents* source) {
PlatformCloseWindow();
}
bool CefBrowserHostImpl::TakeFocus(bool reverse) { bool CefBrowserHostImpl::TakeFocus(bool reverse) {
if (client_.get()) { if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler(); CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();

View File

@ -201,6 +201,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::WebContents* source, content::WebContents* source,
const content::OpenURLParams& params) OVERRIDE; const content::OpenURLParams& params) OVERRIDE;
virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE;
virtual void CloseContents(content::WebContents* source) OVERRIDE;
virtual bool TakeFocus(bool reverse) OVERRIDE; virtual bool TakeFocus(bool reverse) OVERRIDE;
virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE; virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
virtual bool HandleContextMenu(const content::ContextMenuParams& params) virtual bool HandleContextMenu(const content::ContextMenuParams& params)