////////////////////////////////////////////////////////////////////////////////
    // virtual
    void onNavigateComplete(const EventType& event)
    {
        if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
        {
            if(mInitState < INIT_STATE_RUNNING)
            {
                setInitState(INIT_STATE_RUNNING);

                // Clear the history, so the "back" button doesn't take you back to "about:blank".
                LLQtWebKit::getInstance()->clearHistory(mBrowserWindowId);
            }

            LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete");
            message.setValue("uri", event.getEventUri());
            message.setValueS32("result_code", event.getIntValue());
            message.setValue("result_string", event.getStringValue());
            message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
            message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
            sendMessage(message);

            setStatus(STATUS_LOADED);
        }
        else if(mInitState == INIT_STATE_NAVIGATING)
        {
            setInitState(INIT_STATE_NAVIGATE_COMPLETE);
        }

    }
Exemplo n.º 2
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onLinkHovered( const EventType& eventIn )
		{
			std::cout 
				<< "Link hovered, link = " << eventIn.getEventUri() 
				<< ", title = " << eventIn.getStringValue() 
				<< ", text = " << eventIn.getStringValue2() 
			<< std::endl;
		};
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onClickLinkHref(const EventType& event)
 {
     LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href");
     message.setValue("uri", event.getEventUri());
     message.setValue("target", event.getStringValue());
     message.setValue("uuid", event.getStringValue2());
     sendMessage(message);
 }
Exemplo n.º 4
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onNavigateComplete( const EventType& eventIn )
{
    // force an update when the page is finished
    mNeedsUpdate = true;

    // pass in url and HTML response code (200/404 etc.)
    LLMediaEvent event( this, eventIn.getEventUri(), eventIn.getIntValue() );
    mEventEmitter.update( &LLMediaObserver::onNavigateComplete, event );
}
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onLocationChange(const EventType& event)
 {
     if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
     {
         LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed");
         message.setValue("uri", event.getEventUri());
         sendMessage(message);
     }
 }
Exemplo n.º 6
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onClickLinkHref( const EventType& eventIn )
		{
			std::string uuid = eventIn.getStringValue2();

			std::cout << "Event: clicked on link:" << std::endl;
			std::cout << "  URL:" << eventIn.getEventUri() << std::endl;
			std::cout << "  target:" << eventIn.getStringValue() << std::endl;
			std::cout << "  UUID:" << uuid << std::endl;
			std::cout << std::endl;

			// Since we never actually open the window, send a "proxy window closed" back to webkit to keep it from leaking.
			LLQtWebKit::getInstance()->proxyWindowClosed(mBrowserWindowId, uuid);
		};
    ////////////////////////////////////////////////////////////////////////////////
    // virtual
    void onNavigateBegin(const EventType& event)
    {
        if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
        {
            LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin");
            message.setValue("uri", event.getEventUri());
            sendMessage(message);

            setStatus(STATUS_LOADING);
        }

        if(mInitState == INIT_STATE_NAVIGATE_COMPLETE)
        {
            // Skip the WAIT_REDRAW state now -- with the right background color set, it should no longer be necessary.
//			setInitState(INIT_STATE_WAIT_REDRAW);
            setInitState(INIT_STATE_WAIT_COMPLETE);
        }

    }
Exemplo n.º 8
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onNavigateComplete( const EventType& eventIn )
		{
			std::cout << "Event: end navigation to " << eventIn.getEventUri() << std::endl;
		};
Exemplo n.º 9
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onNavigateBegin( const EventType& eventIn )
		{
			std::cout << "Event: begin navigation to " << eventIn.getEventUri() << std::endl;
		};
Exemplo n.º 10
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onNavigateComplete( const EventType& eventIn )
		{
			std::cout << "Event: end navigation to " << eventIn.getEventUri() << " with response status of " << eventIn.getIntValue() << std::endl;
		};
Exemplo n.º 11
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onNavigateBegin( const EventType& eventIn )
{
    LLMediaEvent event( this, eventIn.getEventUri() );
    mEventEmitter.update( &LLMediaObserver::onNavigateBegin, event );
}
Exemplo n.º 12
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onLocationChange( const EventType& eventIn )
{
    LLMediaEvent event( this, eventIn.getEventUri() );
    mEventEmitter.update( &LLMediaObserver::onLocationChange, event );
}
Exemplo n.º 13
0
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onClickLinkNoFollow(const EventType& event)
 {
     LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
     message.setValue("uri", event.getEventUri());
     sendMessage(message);
 }