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;
    }
}
Пример #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();
}
Пример #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());
	}
Пример #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());
}
Пример #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);
}
Пример #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);
}
Пример #8
0
void ofxBerkelium::onProvisionalLoadError(Berkelium::Window *win, Berkelium::URLString url,
									int errorCode, bool isMainFrame) {
	if(listener) listener->onProvisionalLoadError(url.data(), errorCode, isMainFrame);
}
Пример #9
0
void ofxBerkelium::onStartLoading(Berkelium::Window *win, Berkelium::URLString newURL) {
	if(listener) listener->onStartLoading(newURL.data());
}
Пример #10
0
void ofxBerkelium::onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL) {
	addressBar = newURL.data();
	if(listener) listener->onAddressBarChanged(newURL.data());
}