diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-01-05 15:23:52 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-01-05 15:23:52 -0800 |
commit | f119a86461a33f6c303b23c6e4669b49cc00b8c0 (patch) | |
tree | 2cb0aa292ce8e64729dd1f3d6ba62a81a58da3af /indra/media_plugins | |
parent | 5995bcd5a75223df7b1fde031fb3f433863f0c40 (diff) |
Fix for EXT-3069 (Media Browser lets you click on Back button on first page).
Fix was to have the webkit plugin clear the llqtwebkit history on the first real navigateComplete event.
Diffstat (limited to 'indra/media_plugins')
-rw-r--r-- | indra/media_plugins/webkit/media_plugin_webkit.cpp | 13 |
1 files changed, 11 insertions, 2 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()); |