diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfacebookconnect.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llfloaterwebcontent.cpp | 65 | ||||
-rwxr-xr-x | indra/newview/llfloaterwebcontent.h | 5 | ||||
-rwxr-xr-x | indra/newview/llmediactrl.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewermedia.cpp | 23 | ||||
-rwxr-xr-x | indra/newview/llviewermedia.h | 2 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_web_content.xml | 4 |
7 files changed, 84 insertions, 22 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 51abbdf82f..f0b735c5ca 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -318,7 +318,11 @@ void LLFacebookConnect::openFacebookWeb(std::string url) { // Open the URL in an internal browser window without navigation UI LLFloaterWebContent::Params p; - p.url(url).show_chrome(false); + p.url(url).show_chrome(true); + p.url(url).allow_address_entry(false); + p.url(url).allow_back_forward_navigation(false); + p.url(url).save_url_history(false); + p.url(url).trusted_content(true); LLFloaterReg::showInstance("fbc_web", p); //LLUrlAction::openURLExternal(url); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3fe2518de6..eb1717d384 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -46,7 +46,9 @@ LLFloaterWebContent::_Params::_Params() id("id"), window_class("window_class", "web_content"), show_chrome("show_chrome", true), - allow_address_entry("allow_address_entry", true), + allow_address_entry("allow_address_entry", true), + allow_back_forward_navigation("allow_back_forward_navigation", true), + save_url_history("save_url_history", true), preferred_media_size("preferred_media_size"), trusted_content("trusted_content", false), show_page_title("show_page_title", true) @@ -65,7 +67,10 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mBtnReload(NULL), mBtnStop(NULL), mUUID(params.id()), - mShowPageTitle(params.show_page_title) + mShowPageTitle(params.show_page_title), + mAllowNavigation(true), + mSaveURLHistory(true), + mDisplayURL("") { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -97,7 +102,7 @@ BOOL LLFloaterWebContent::postBuild() // cache image for secure browsing mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag"); - + // initialize the URL history using the system URL History manager initializeURLHistory(); @@ -236,13 +241,17 @@ void LLFloaterWebContent::open_media(const Params& p) LLViewerMedia::proxyWindowOpened(p.target(), p.id()); mWebBrowser->setHomePageUrl(p.url, "text/html"); mWebBrowser->setTarget(p.target); + LLViewerMedia::setLogURL(p.save_url_history); // Turn logging on/off as requested (flag default is true) mWebBrowser->navigateTo(p.url, "text/html"); + mSecureLockIcon->setVisible(false); set_current_url(p.url); getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome); getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome); bool address_entry_enabled = p.allow_address_entry && !p.trusted_content; + mAllowNavigation = p.allow_back_forward_navigation; + mSaveURLHistory = p.save_url_history; getChildView("address")->setEnabled(address_entry_enabled); getChildView("popexternal")->setEnabled(address_entry_enabled); @@ -295,8 +304,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); - mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation); LLFloater::draw(); } @@ -311,6 +320,7 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent if ( url.length() ) mStatusBarText->setText( url ); + mSecureLockIcon->setVisible(false); set_current_url( url ); } else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) @@ -344,17 +354,28 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent mStatusBarText->setText( end_str ); // decide if secure browsing icon should be displayed - std::string prefix = std::string("https://"); + std::string prefix = std::string("https://"); std::string test_prefix = mCurrentURL.substr(0, prefix.length()); LLStringUtil::toLower(test_prefix); - if(test_prefix == prefix) + if (test_prefix == prefix) { mSecureLockIcon->setVisible(true); + if (!mDisplayURL.empty()) + { + // Clear temporary entry if any + mAddressCombo->remove( mDisplayURL ); + mDisplayURL = ""; + } + // Hack : we move the text a bit to make space for the lock icon. + // That entry in the list will be deleted on the next add. + mDisplayURL = " " + mCurrentURL; + mAddressCombo->add( mDisplayURL ); + mAddressCombo->selectByValue( mDisplayURL ); } - else - { - mSecureLockIcon->setVisible(false); - } + else + { + mSecureLockIcon->setVisible(false); + } } else if(event == MEDIA_EVENT_CLOSE_REQUEST) { @@ -398,11 +419,21 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent void LLFloaterWebContent::set_current_url(const std::string& url) { mCurrentURL = url; - - // serialize url history into the system URL History manager - LLURLHistory::removeURL("browser", mCurrentURL); - LLURLHistory::addURL("browser", mCurrentURL); - + LLStringUtil::trim(mCurrentURL); + + LLURLHistory::removeURL("browser", mCurrentURL); + if (mSaveURLHistory) + { + // serialize url history into the system URL History manager + LLURLHistory::addURL("browser", mCurrentURL); + } + + if (!mDisplayURL.empty()) + { + // Clear temporary entry if any + mAddressCombo->remove( mDisplayURL ); + mDisplayURL = ""; + } mAddressCombo->remove( mCurrentURL ); mAddressCombo->add( mCurrentURL ); mAddressCombo->selectByValue( mCurrentURL ); @@ -449,6 +480,7 @@ void LLFloaterWebContent::onEnterAddress() // make sure there is at least something there. // (perhaps this test should be for minimum length of a URL) std::string url = mAddressCombo->getValue().asString(); + LLStringUtil::trim(url); if ( url.length() > 0 ) { mWebBrowser->navigateTo( url, "text/html"); @@ -460,6 +492,7 @@ void LLFloaterWebContent::onPopExternal() // make sure there is at least something there. // (perhaps this test should be for minimum length of a URL) std::string url = mAddressCombo->getValue().asString(); + LLStringUtil::trim(url); if ( url.length() > 0 ) { LLWeb::loadURLExternal( url ); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index cfc87e9015..4d77537f5f 100755 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -54,6 +54,8 @@ public: id; Optional<bool> show_chrome, allow_address_entry, + allow_back_forward_navigation, + save_url_history, trusted_content, show_page_title; Optional<LLRect> preferred_media_size; @@ -106,8 +108,11 @@ protected: LLView* mBtnStop; std::string mCurrentURL; + std::string mDisplayURL; std::string mUUID; bool mShowPageTitle; + bool mAllowNavigation; + bool mSaveURLHistory; }; #endif // LL_LLFLOATERWEBCONTENT_H diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 2075aeed63..c06068b252 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -604,6 +604,7 @@ void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& m void LLMediaCtrl::setTarget(const std::string& target) { + LLViewerMedia::setLogURL(true); // Always log, unless this is turned off at navigation time mTarget = target; if (mMediaSource) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2df028de69..8a88a36dda 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -361,6 +361,7 @@ static bool sAnyMediaShowing = false; static boost::signals2::connection sTeleportFinishConnection; static std::string sUpdatedCookies; static const char *PLUGIN_COOKIE_FILE_NAME = "plugin_cookies.txt"; +static bool sLogURL = true; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -1623,6 +1624,13 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) } ////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setLogURL(bool do_log) +{ + sLogURL = do_log; +} + +////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, @@ -2000,7 +2008,10 @@ void LLViewerMediaImpl::loadURI() "<>#%" ";/?:@&=", false); - llinfos << "Asking media source to load URI: " << uri << llendl; + if (sLogURL) + { + llinfos << "Asking media source to load URI: " << uri << llendl; + } mMediaSource->loadURI( uri ); @@ -2567,7 +2578,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) { // Helpful to have media urls in log file. Shouldn't be spammy. - llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl; + if (sLogURL) + { + llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl; + } // This impl should not be loaded at this time. LL_DEBUGS("PluginPriority") << this << "Not loading (PRIORITY_UNLOADED)" << LL_ENDL; @@ -2582,7 +2596,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi void LLViewerMediaImpl::navigateInternal() { // Helpful to have media urls in log file. Shouldn't be spammy. - llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + if (sLogURL) + { + llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + } if(mNavigateSuspended) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index fff5b3fc08..75cd77e979 100755 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,6 +160,8 @@ public: static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); + static void setLogURL(bool do_log); + static LLSD getHeaders(); private: diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index cea10adca8..a80440e844 100755 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -125,10 +125,10 @@ <icon name="media_secure_lock_flag" height="16" - follows="top|right" + follows="top|left" image_name="Lock2" layout="topleft" - left_delta="620" + left_delta="2" top_delta="2" visible="false" tool_tip="Secured Browsing" |