mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Update to Chromium revision 71081.
- Add a new |isMainContent| boolean argument to HandleLoadStart and HandleLoadEnd (issue #166). - Only call HandleAddressChange and HandleTitleChange for the main content load (issue #166). - Pass the URL for new popup windows to HandleBeforeCreated (issue #5). - cefclient: Add a test for XMLHttpRequest. - cefclient: Size popup windows in ClientHandler::HandleBeforeCreated. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@162 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -69,9 +69,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||
// Specify a cache path value.
|
||||
//CefString(&settings.cache_path).FromASCII("c:\\temp\\cache");
|
||||
|
||||
// Disable accelerated compositing to view HTML5 video.
|
||||
//browserDefaults.accelerated_compositing_disabled = true;
|
||||
|
||||
#ifdef TEST_SINGLE_THREADED_MESSAGE_LOOP
|
||||
// Initialize the CEF with messages processed using the current application's
|
||||
// message loop.
|
||||
@@ -567,6 +564,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if(browser.get())
|
||||
RunHTML5VideoTest(browser);
|
||||
return 0;
|
||||
case ID_TESTS_XMLHTTPREQUEST: // Test XMLHttpRequest
|
||||
if(browser.get())
|
||||
RunXMLHTTPRequestTest(browser);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -648,6 +649,25 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
// ClientHandler implementation
|
||||
|
||||
CefHandler::RetVal ClientHandler::HandleBeforeCreated(
|
||||
CefRefPtr<CefBrowser> parentBrowser, CefWindowInfo& createInfo, bool popup,
|
||||
const CefPopupFeatures& popupFeatures, CefRefPtr<CefHandler>& handler,
|
||||
CefString& url, CefBrowserSettings& settings)
|
||||
{
|
||||
if(popup) {
|
||||
if(popupFeatures.xSet)
|
||||
createInfo.m_x = popupFeatures.x;
|
||||
if(popupFeatures.ySet)
|
||||
createInfo.m_y = popupFeatures.y;
|
||||
if(popupFeatures.widthSet)
|
||||
createInfo.m_nWidth = popupFeatures.width;
|
||||
if(popupFeatures.heightSet)
|
||||
createInfo.m_nHeight = popupFeatures.height;
|
||||
}
|
||||
|
||||
return RV_CONTINUE;
|
||||
}
|
||||
|
||||
CefHandler::RetVal ClientHandler::HandleAddressChange(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
const CefString& url)
|
||||
@@ -687,8 +707,8 @@ CefHandler::RetVal ClientHandler::HandleBeforeResourceLoad(
|
||||
// Show the request contents
|
||||
std::string dump;
|
||||
DumpRequestContents(request, dump);
|
||||
resourceStream = CefStreamReader::CreateForData((void*)dump.c_str(),
|
||||
dump.size());
|
||||
resourceStream =
|
||||
CefStreamReader::CreateForData((void*)dump.c_str(), dump.size());
|
||||
mimeType = "text/plain";
|
||||
} else if(url == "http://tests/uiapp") {
|
||||
// Show the uiapp contents
|
||||
@@ -704,6 +724,13 @@ CefHandler::RetVal ClientHandler::HandleBeforeResourceLoad(
|
||||
new CefByteReadHandler(pBytes, dwSize, NULL));
|
||||
mimeType = "text/html";
|
||||
}
|
||||
} else if(url == "http://tests/xmlhttprequest") {
|
||||
// Show the xmlhttprequest HTML contents
|
||||
if(LoadBinaryResource(IDS_XMLHTTPREQUEST, dwSize, pBytes)) {
|
||||
resourceStream = CefStreamReader::CreateForHandler(
|
||||
new CefByteReadHandler(pBytes, dwSize, NULL));
|
||||
mimeType = "text/html";
|
||||
}
|
||||
} else if(strstr(url.c_str(), "/ps_logo2.png") != NULL) {
|
||||
// Any time we find "ps_logo2.png" in the URL substitute in our own image
|
||||
if(LoadBinaryResource(IDS_LOGO, dwSize, pBytes)) {
|
||||
|
Reference in New Issue
Block a user