diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/media_plugins/webkit/media_plugin_webkit.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 1 |
3 files changed, 19 insertions, 5 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 4b6da552cf..02f0045800 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -84,6 +84,7 @@ private: INIT_STATE_NAVIGATING, // Browser instance has been set up and initial navigate to about:blank has been issued INIT_STATE_NAVIGATE_COMPLETE, // initial navigate to about:blank has completed INIT_STATE_WAIT_REDRAW, // First real navigate begin has been received, waiting for page changed event to start handling redraws + INIT_STATE_WAIT_COMPLETE, // Waiting for first real navigate complete event INIT_STATE_RUNNING // All initialization gymnastics are complete. }; int mBrowserWindowId; @@ -122,7 +123,7 @@ private: } } - if ( (mInitState == INIT_STATE_RUNNING) && mNeedsUpdate ) + if ( (mInitState > INIT_STATE_WAIT_REDRAW) && mNeedsUpdate ) { const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId ); @@ -295,7 +296,7 @@ private: { if(mInitState == INIT_STATE_WAIT_REDRAW) { - setInitState(INIT_STATE_RUNNING); + setInitState(INIT_STATE_WAIT_COMPLETE); } // flag that an update is required @@ -328,6 +329,14 @@ private: { 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()); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index bf96472e7e..0fc0afed3e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -987,7 +987,7 @@ void LLViewerMediaImpl::emitEvent(LLPluginClassMedia* plugin, LLViewerMediaObser bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) { bool mimeTypeChanged = (mMimeType != mime_type); - bool pluginChanged = (LLMIMETypes::implType(mMimeType) != LLMIMETypes::implType(mime_type)); + bool pluginChanged = (LLMIMETypes::implType(mCurrentMimeType) != LLMIMETypes::implType(mime_type)); if(!mMediaSource || pluginChanged) { @@ -1127,6 +1127,9 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) // If we got here, we want to ignore previous init failures. mMediaSourceFailed = false; + // Save the MIME type that really caused the plugin to load + mCurrentMimeType = mMimeType; + LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight); if (media_source) @@ -1563,6 +1566,7 @@ void LLViewerMediaImpl::unload() mMediaURL.clear(); mMimeType.clear(); mCurrentMediaURL.clear(); + mCurrentMimeType.clear(); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -2123,7 +2127,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla // TODO: may want a different message for this case? LLSD args; - args["PLUGIN"] = LLMIMETypes::implType(mMimeType); + args["PLUGIN"] = LLMIMETypes::implType(mCurrentMimeType); LLNotificationsUtil::add("MediaPluginFailed", args); } break; @@ -2137,7 +2141,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla resetPreviousMediaState(); LLSD args; - args["PLUGIN"] = LLMIMETypes::implType(mMimeType); + args["PLUGIN"] = LLMIMETypes::implType(mCurrentMimeType); // SJB: This is getting called every frame if the plugin fails to load, continuously respawining the alert! //LLNotificationsUtil::add("MediaPluginFailed", args); } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 63f461b4c4..9119b783c2 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -324,6 +324,7 @@ public: std::string mHomeURL; std::string mMimeType; std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events). + std::string mCurrentMimeType; // The MIME type that caused the currently loaded plugin to be loaded. S32 mLastMouseX; // save the last mouse coord we get, so when we lose capture we can simulate a mouseup at that point. S32 mLastMouseY; S32 mMediaWidth; |