// URI localization on WebProcess side
#include "injected_bundle_uri_handling.h"
#include "injected_bundle_decryption_support.h"
+#include "injected_bundle_viewmodes_support.h"
namespace {
const char * const SCHEME_HTTP = "http";
const char * const BLANK_PAGE_URL = "about:blank";
const char * const HTML_MIME = "text/html";
const char * const PHP_MIME = "application/x-php";
-const char * const VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
-const char * const VIEWMODE_TYPE_MAXIMIZED = "maximized";
const std::size_t FILE_BUF_MAX_SIZE = 1024; // bytes
const std::size_t PLAIN_CHUNK_SIZE = 1008; // bytes
const unsigned int UID_ROOT = 0;
m_pagesList.push_back(page);
m_pageGlobalContext.insertContextForPage(page, context);
LogDebug("created Page : " << page << " created JSContext : " << context);
+ m_viewmodesSupport->initialize(page);
WKBundlePageResourceLoadClient resourceLoadClient = {
kWKBundlePageResourceLoadClientCurrentVersion, /* version */
m_pagesList.remove(page);
m_pageGlobalContext.removeContextForPage(page);
m_pageContext[page].erase(context);
+ m_viewmodesSupport->deinitialize(page);
PluginModule::unloadFrame(context);
PluginModule::stop(context);
bypassCORSforWARPAccessList(dao);
#endif
m_decryptionSupport->initialize(m_widgetTizenId);
+ m_viewmodesSupport.reset(
+ new InjectedBundle::ViewmodesSupport(m_widgetTizenId));
m_initialized = true;
} else {
LogDebug("already initalized");
toString(static_cast<WKStringRef>(messageBody));
LogDebug("set x window handle [" << msgString << "]");
IPCMessageSupport::setXwindowHandle(atoi(msgString.c_str()));
+ } else if (WKStringIsEqualToUTF8CString(
+ messageName,
+ Message::ToInjectedBundle::SET_VIEWMODES))
+ {
+ std::string msgBody =
+ toString(static_cast<WKStringRef>(messageBody));
+ LogDebug("set viewmode to [" << msgBody << "]");
+ if (msgBody == Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT) {
+ m_viewmodesSupport->exitViewmodesAllPages();
+ } else {
+ m_viewmodesSupport->enterViewmodesAllPages(msgBody);
+ }
}
}
LogDebug("didStartProvisionalLoadForFrameCallback called");
Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
- // set viewmode
- WrtDB::WidgetDAOReadOnly dao(This->m_widgetTizenId);
- WrtDB::WindowModeList modeList = dao.getWindowModes();
- FOREACH(it, modeList) {
- std::string viewMode = DPL::ToUTF8String(*it);
- if (viewMode == VIEWMODE_TYPE_FULLSCREEN
- || viewMode == VIEWMODE_TYPE_MAXIMIZED)
- {
- WKBundlePageSetViewMode(
- page,
- WKStringCreateWithUTF8CString(viewMode.c_str()));
- break;
- }
- }
-
if (This->m_pageGlobalContext.find(page) == This->m_pageGlobalContext.end()) {
return;
}
{
if (logEnable){ LogDebug("external scheme return original WKURLRequestRef"); }
WKRetain(request);
-
+
return request;
}
else
WKURLCreateWithUTF8CString(decryptString.c_str());
WKURLRequestRef req = WKURLRequestCreateWithWKURL(destUrl);
WKRelease(destUrl);
-
+
return req;
}
}
-
+
WKURLRef newUrl = WKURLCreateWithUTF8CString(localizedUrl.c_str());
WKURLRequestRef req = WKURLRequestCreateWithWKURL(newUrl);
WKRelease(newUrl);
// Send information about blocked URI to UIProcess
WKStringRef urlStr = WKStringCreateWithUTF8CString(blockedUrl.c_str());
- WKTypeRef retVal = NULL;
WKStringRef blockMessage =
WKStringCreateWithUTF8CString(Message::ToUIProcess::BLOCKED_URL);
- WKBundlePostSynchronousMessage(m_bundle, blockMessage, urlStr, &retVal);
+ WKBundlePostMessage(m_bundle, blockMessage, urlStr);
WKRelease(urlStr);
- WKRelease(retVal);
WKRelease(blockMessage);
return WKBundlePagePolicyActionPassThrough;
}
std::stringstream strPid;
strPid << getpid();
WKStringRef pidStr = WKStringCreateWithUTF8CString(strPid.str().c_str());
- WKTypeRef retVal = NULL;
WKStringRef message =
WKStringCreateWithUTF8CString(
Message::ToUIProcess::SEND_WEBPROCESS_PID);
- WKBundlePostSynchronousMessage(m_bundle, message, pidStr, &retVal);
+ WKBundlePostMessage(m_bundle, message, pidStr);
WKRelease(pidStr);
- WKRelease(retVal);
WKRelease(message);
}
#endif