public static void ProcessWebViewEvent(UWKEvent e) { uint id = e.GetUInt("ID"); UWKWebView webView; if (viewLookup.TryGetValue(id, out webView)) { webView.ProcessUWKEvent(e); } }
public void ProcessUWKEvent(UWKEvent e) { if (e.eventType == "E_IPCWEBVIEWTITLECHANGE") { TitleChanged(this, e.GetString("TITLE")); } else if (e.eventType == "E_IPCWEBVIEWADDRESSCHANGE") { URLChanged(this, e.GetString("URL")); } else if (e.eventType == "E_IPCWEBVIEWLOADSTATECHANGE") { Loading = e.GetBool("LOADING"); CanGoBack = e.GetBool("CANGOBACK"); CanGoForward = e.GetBool("CANGOFORWARD"); LoadStateChanged(this, Loading, CanGoBack, CanGoForward); } else if (e.eventType == "E_IPCWEBVIEWWEBMESSAGE") { UWKWebQuery query = new UWKWebQuery(); query.View = this; query.QueryID = e.GetDouble("QUERYID"); query.Request = e.GetString("REQUEST"); WebQuery(query); //Debug.Log ("IPCWEBVIEWMESSAGE: " + e.GetString ("REQUEST")); //UWKPlugin.UWK_MsgWebMessageResponse (ID, e.GetDouble ("QUERYID"), true, "Atomic Game Engine!!!"); } else if (e.eventType == "E_IPCWEBVIEWLOADEND") { LoadFinished(this); } else if (e.eventType == "E_IPCWEBVIEWJSEVALRESULT") { JSEvalDelegate callback; if (evalCallbacks.TryGetValue(e.GetUInt("EVALID"), out callback)) { callback(e.GetBool("RESULT"), e.GetString("VALUE")); } } else if (e.eventType == "E_IPCWEBVIEWPOPUPREQUEST") { PopupRequested(this, e.GetString("URL")); } }