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:
Marshall Greenblatt
2012-06-25 19:49:17 +00:00
parent 6f2897cb50
commit 89c70a8b11
10 changed files with 179 additions and 0 deletions

View File

@ -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,