summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp21
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index 79e780e..8c718d8 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -35,6 +35,9 @@
#include <net/http/http_response_headers.h>
#include <net/url_request/url_request.h>
#include <string>
+#include <utils/AssetManager.h>
+
+extern android::AssetManager* globalAssetManager();
// TODO:
// - Get gmail log in to work
@@ -90,6 +93,9 @@ void WebRequest::start(bool isPrivateBrowsing)
if (m_request->url().SchemeIs("data"))
return handleDataURL(m_request->url());
+ if (m_request->url().SchemeIs("browser"))
+ return handleBrowserURL(m_request->url());
+
if (!isPrivateBrowsing)
m_request->set_context(WebRequestContext::GetAndroidContext());
else
@@ -134,6 +140,21 @@ void WebRequest::handleDataURL(GURL url)
finish(true);
}
+void WebRequest::handleBrowserURL(GURL url)
+{
+ std::string data("data:text/html;charset=utf-8,");
+ if (url.spec() == "browser:incognito") {
+ AssetManager* assetManager = globalAssetManager();
+ Asset* asset = assetManager->open("webkit/incognito_mode_start_page.html", Asset::ACCESS_BUFFER);
+ if (asset) {
+ data.append((const char*)asset->getBuffer(false), asset->getLength());
+ delete asset;
+ }
+ }
+ GURL dataURL(data.c_str());
+ handleDataURL(dataURL);
+}
+
// Called upon a server-initiated redirect. The delegate may call the
// request's Cancel method to prevent the redirect from being followed.
// Since there may be multiple chained redirects, there may also be more
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h
index 9c9c830..dc53ca6 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.h
+++ b/WebKit/android/WebCoreSupport/WebRequest.h
@@ -61,6 +61,7 @@ private:
friend class base::RefCountedThreadSafe<WebRequest>;
virtual ~WebRequest();
void handleDataURL(GURL);
+ void handleBrowserURL(GURL);
void finish(bool success);
// Not owned