summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llfloaterwebcontent.cpp48
-rwxr-xr-xindra/newview/llfloaterwebcontent.h2
-rwxr-xr-xindra/newview/llmediactrl.cpp1
-rwxr-xr-xindra/newview/llviewermedia.cpp23
-rwxr-xr-xindra/newview/llviewermedia.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_web_content.xml16
6 files changed, 53 insertions, 39 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 92dbbb402d..eb1717d384 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -60,7 +60,6 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mWebBrowser(NULL),
mAddressCombo(NULL),
mSecureLockIcon(NULL),
- mSecurePrefix(NULL),
mStatusBarText(NULL),
mStatusBarProgress(NULL),
mBtnBack(NULL),
@@ -70,7 +69,8 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mUUID(params.id()),
mShowPageTitle(params.show_page_title),
mAllowNavigation(true),
- mSaveURLHistory(true)
+ mSaveURLHistory(true),
+ mDisplayURL("")
{
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -102,7 +102,6 @@ BOOL LLFloaterWebContent::postBuild()
// cache image for secure browsing
mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag");
- mSecurePrefix = getChild< LLTextBox >( "secured_prefix" );
// initialize the URL history using the system URL History manager
initializeURLHistory();
@@ -242,8 +241,10 @@ 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);
@@ -319,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)
@@ -358,23 +360,22 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
if (test_prefix == prefix)
{
mSecureLockIcon->setVisible(true);
- mSecurePrefix->setVisible(true);
- // Hack : we suppress the "https" prefix and move the text a bit
- // to make space for the lock icon and the green "https" text.
- // However, so not to confuse the list management, we're not adding
- // that hacked url to the history. The full url is already in there.
- std::string url = mCurrentURL;
- url.replace(0,5,"");
- url = " " + url;
- mAddressCombo->remove( url );
- mAddressCombo->add( url );
- mAddressCombo->selectByValue( url );
- }
- else
- {
- mSecureLockIcon->setVisible(false);
- mSecurePrefix->setVisible(false);
+ 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 if(event == MEDIA_EVENT_CLOSE_REQUEST)
{
@@ -418,6 +419,7 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
void LLFloaterWebContent::set_current_url(const std::string& url)
{
mCurrentURL = url;
+ LLStringUtil::trim(mCurrentURL);
LLURLHistory::removeURL("browser", mCurrentURL);
if (mSaveURLHistory)
@@ -426,6 +428,12 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
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 );
@@ -472,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");
@@ -483,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 b416328e93..4d77537f5f 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -99,7 +99,6 @@ protected:
LLMediaCtrl* mWebBrowser;
LLComboBox* mAddressCombo;
LLIconCtrl* mSecureLockIcon;
- LLTextBox* mSecurePrefix;
LLTextBox* mStatusBarText;
LLProgressBar* mStatusBarProgress;
@@ -109,6 +108,7 @@ protected:
LLView* mBtnStop;
std::string mCurrentURL;
+ std::string mDisplayURL;
std::string mUUID;
bool mShowPageTitle;
bool mAllowNavigation;
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 a1563dc9ae..a80440e844 100755
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -133,22 +133,6 @@
visible="false"
tool_tip="Secured Browsing"
width="16" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- font.size="Small"
- height="16"
- layout="topleft"
- left_delta="18"
- name="secured_prefix"
- top_delta="3"
- text_color="EmphasisColor"
- visible="false"
- width="100">
- https
- </text>
<button
image_overlay="ExternalBrowser_Off"
image_disabled="PushButton_Disabled"