void UnityBerkeliumWindow::onNavigationRequested(Berkelium::Window *win, Berkelium::URLString newUrl, Berkelium::URLString referrer, bool isNewWindow, bool &cancelDefaultAction)
{
	cerr << "[UnityBerkeliumWindow] onNavigationRequested called (window: " << win << ")" << endl;
	cerr << "  newUrl: " << newUrl << endl;
	cerr << "  referrer: " << referrer << endl;
	cerr << "  isNewWindow: " << (isNewWindow ? "yes" : "no") << endl;

    if(m_navHookCb && strncmp(newUrl.data(), m_navHookUrl.data(), m_navHookUrl.length()) == 0)
    {
        cerr << "  !! Hooked navigation and cancelled!! " << endl;
		m_navHookCb(newUrl.data());
        cancelDefaultAction = true;
        return;
    }
}
Exemplo n.º 2
0
void ofxBerkelium::onScriptAlert(Berkelium::Window *win, Berkelium::WideString message,
						   Berkelium::WideString defaultValue, Berkelium::URLString url,
						   int flags, bool &success, Berkelium::WideString &value) {
	status = wstring2string( message.data() );
	if(listener) listener->onScriptAlert(message.data(), defaultValue.data(), url.data(),
										 flags, success, value.data());
}
void UnityBerkeliumWindow::onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL)
{
	cerr << "[UnityBerkeliumWindow] onAddressBarChanged called (window: " << win << ")" << endl;
	cerr << "  newURL: " << newURL << endl;
    
    m_addressUrl = newURL.data();
}
Exemplo n.º 4
0
	void BerkeliumBrowser::onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL)
	{
		mUrlEditBox->setCaption(newURL.data());
		mBackButton->setEnabled(mWebPageBerkeliumWidget->getBerkeliumWindow()->canGoBack());
		mForwardButton->setEnabled(mWebPageBerkeliumWidget->getBerkeliumWindow()->canGoForward());
	}
Exemplo n.º 5
0
void ofxBerkelium::onExternalHost(Berkelium::Window *win, Berkelium::WideString message, Berkelium::URLString origin,
								  Berkelium::URLString target) {
	if(listener) listener->onExternalHost(message.data(), origin.data(), target.data());
}
Exemplo n.º 6
0
void ofxBerkelium::onJavascriptCallback(Berkelium::Window *win, void* replyMsg, Berkelium::URLString url,
										Berkelium::WideString funcName, Berkelium::Script::Variant *args,
										size_t numArgs) {
	if(listener) listener->onJavascriptCallback(replyMsg, url.data(), funcName.data(), args, numArgs);
}
Exemplo n.º 7
0
void ofxBerkelium::onNavigationRequested(Berkelium::Window *win, Berkelium::URLString newURL,
								   Berkelium::URLString referrer, bool isNewWindow,
								   bool &cancelDefaultAction) {
	status = "Navigating to "+string(newURL.data());
	if(listener) listener->onNavigationRequested(newURL.data(), referrer.data(), isNewWindow, cancelDefaultAction);
}
Exemplo n.º 8
0
void ofxBerkelium::onProvisionalLoadError(Berkelium::Window *win, Berkelium::URLString url,
									int errorCode, bool isMainFrame) {
	if(listener) listener->onProvisionalLoadError(url.data(), errorCode, isMainFrame);
}
Exemplo n.º 9
0
void ofxBerkelium::onStartLoading(Berkelium::Window *win, Berkelium::URLString newURL) {
	if(listener) listener->onStartLoading(newURL.data());
}
Exemplo n.º 10
0
void ofxBerkelium::onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL) {
	addressBar = newURL.data();
	if(listener) listener->onAddressBarChanged(newURL.data());
}