Exemplo n.º 1
0
    bool ClientAdapter::OnConsoleMessage(CefRefPtr<CefBrowser> browser, const CefString& message, const CefString& source, int line)
    {
        String^ messageStr = toClr(message);
        String^ sourceStr = toClr(source);
        _browserControl->RaiseConsoleMessage(messageStr, sourceStr, line);

        return true;
    }
Exemplo n.º 2
0
 void ClientAdapter::OnAddressChange(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& url)
 {
     if(frame->IsMain())
     {
         _browserControl->SetAddress(toClr(url));
     }
 }
Exemplo n.º 3
0
    void ScriptCore::UIT_Evaluate(CefRefPtr<CefBrowser> browser, CefString script)
    {
        CefRefPtr<CefFrame> mainFrame;
        if (TryGetMainFrame(browser, mainFrame))
        {
            CefRefPtr<CefV8Context> context = mainFrame->GetV8Context();

            if (context.get() && context->Enter())
            {
                CefRefPtr<CefV8Value> result;
                CefRefPtr<CefV8Exception> exception;

                bool success = context->Eval(script, result, exception);
                if (success)
                {
                   try
                    {
                        _result = convertFromCef(result);
                    }
                    catch (Exception^ ex)
                    {
                        _exceptionMessage = ex->Message;
                    }
                }
                else if (exception.get())
                {
                    _exceptionMessage = toClr(exception->GetMessage());
                }
                else
                {
                    _exceptionMessage = "Failed to evaluate script";
                }

                context->Exit();
            }
Exemplo n.º 4
0
    bool ClientAdapter::OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text)
    {
        String^ str = toClr(text);

        if (str != _tooltip)
        {
            _tooltip = str;
            _browserControl->SetToolTip(_tooltip);
        }

        return true;
    }
Exemplo n.º 5
0
 void ClientAdapter::OnResourceReponse(CefRefPtr<CefBrowser> browser, const CefString& url, CefRefPtr<CefResponse> response, CefRefPtr<CefContentFilter>& filter)
 {
     IAfterResponse^ handler = _browserControl->AfterResponseHandler;
     if (handler != nullptr)
     {
         String^ cookie = toClr(response->GetHeader("Set-Cookie"));
         if (!String::IsNullOrEmpty(cookie))
         {
             handler->HandleSetCookie(cookie);
         }
     }
 }
Exemplo n.º 6
0
 void ClientAdapter::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title)
 {
     _browserControl->SetTitle(toClr(title));
 }
Exemplo n.º 7
0
 String^ CefRequestWrapper::Url::get()
 {
     return toClr(_wrappedRequest->GetURL());
 }
Exemplo n.º 8
0
//set the draw color with a ClrHSL value
void WindowSFML::setDrawClr(ClrHSL clrIn)
{
	drawClr=toClr(clrIn);
}