mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add OnRenderProcessTerminated and OnPluginCrashed notifications to CefLoadHandler (issue #633).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@710 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "cefclient/client_handler.h"
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -282,6 +283,18 @@ void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
|
||||
frame->LoadString(ss.str(), failedUrl);
|
||||
}
|
||||
|
||||
void ClientHandler::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
||||
TerminationStatus status) {
|
||||
// Load google.com if that's not the website that we terminated on.
|
||||
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
|
||||
std::string url = frame->GetURL();
|
||||
std::transform(url.begin(), url.end(), url.begin(), tolower);
|
||||
|
||||
const char kLoadURL[] = "http://www.google.com";
|
||||
if (url.find(kLoadURL) != 0)
|
||||
frame->LoadURL(kLoadURL);
|
||||
}
|
||||
|
||||
CefRefPtr<CefResourceHandler> ClientHandler::GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
|
Reference in New Issue
Block a user