Add a new CefLifeSpanHandler::CanCreatePopup() method for canceling the creation of popup windows (issue #816).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1085 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-02-08 00:07:41 +00:00
parent 830182196c
commit 02587eba55
13 changed files with 424 additions and 91 deletions

View File

@ -232,6 +232,18 @@ bool ClientHandler::OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
return false;
}
bool ClientHandler::CanCreatePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
bool* no_javascript_access) {
if (browser->GetHost()->IsWindowRenderingDisabled()) {
// Cancel popups in off-screen rendering mode.
return false;
}
return true;
}
void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
REQUIRE_UI_THREAD();
@ -243,19 +255,6 @@ void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
}
}
bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
const CefString& url,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings) {
if (parentBrowser->GetHost()->IsWindowRenderingDisabled()) {
// Cancel popups in off-screen rendering mode.
return true;
}
return false;
}
bool ClientHandler::DoClose(CefRefPtr<CefBrowser> browser) {
REQUIRE_UI_THREAD();