Add support for accessing and modifying the DOM (issue #60).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@191 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-02-23 03:45:13 +00:00
parent 04bce7acad
commit 60736ac4e0
47 changed files with 3996 additions and 3 deletions

View File

@@ -511,6 +511,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(browser.get())
RunUIPluginTest(browser);
return 0;
case ID_TESTS_DOMACCESS: // Test DOM access
if(browser.get())
RunDOMAccessTest(browser);
return 0;
case ID_TESTS_LOCALSTORAGE: // Test localStorage
if(browser.get())
RunLocalStorageTest(browser);
@@ -709,6 +713,13 @@ CefHandler::RetVal ClientHandler::HandleBeforeResourceLoad(
new CefByteReadHandler(pBytes, dwSize, NULL));
mimeType = "text/html";
}
} else if(url == "http://tests/domaccess") {
// Show the domaccess HTML contents
if(LoadBinaryResource(IDS_DOMACCESS, 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)) {