diff options
author | Merov Linden <merov@lindenlab.com> | 2013-07-22 18:47:05 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-07-22 18:47:05 -0700 |
commit | 9c97f4f5ef46369714b8e7beb2cb990f06b0f096 (patch) | |
tree | 4375a8217b73fc379aa79b381ff84e8058c057a7 | |
parent | 2e266ac409510b7dd8e7b250509534e3d047ba17 (diff) |
ACME-734 : Fix: Do not log empty URLs, refocus on page if the focus was there
-rwxr-xr-x | indra/newview/llfloaterwebcontent.cpp | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 129e1f0e2a..62eb9dba8e 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -358,7 +358,9 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent { mSecureLockIcon->setVisible(true); // Hack : we move the text a bit to make space for the lock icon. + BOOL browser_has_focus = mWebBrowser->hasFocus(); set_current_url(" " + mCurrentURL); + mWebBrowser->setFocus(browser_has_focus); } else { @@ -406,26 +408,29 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent void LLFloaterWebContent::set_current_url(const std::string& url) { - if (!mCurrentURL.empty()) + if (!url.empty()) { - // Clean up the current browsing list to show true URL - mAddressCombo->remove(mDisplayURL); - mAddressCombo->add(mCurrentURL); - } + if (!mCurrentURL.empty()) + { + // Clean up the current browsing list to show true URL + mAddressCombo->remove(mDisplayURL); + mAddressCombo->add(mCurrentURL); + } - // Update current URLs - mDisplayURL = url; - mCurrentURL = url; - LLStringUtil::trim(mCurrentURL); + // Update current URLs + mDisplayURL = url; + mCurrentURL = url; + LLStringUtil::trim(mCurrentURL); - // Serialize url history into the system URL History manager - LLURLHistory::removeURL("browser", mCurrentURL); - LLURLHistory::addURL("browser", mCurrentURL); + // Serialize url history into the system URL History manager + LLURLHistory::removeURL("browser", mCurrentURL); + LLURLHistory::addURL("browser", mCurrentURL); - // Clean up browsing list (prevent dupes) and add/select new URL to it - mAddressCombo->remove(mCurrentURL); - mAddressCombo->add(mDisplayURL); - mAddressCombo->selectByValue(mDisplayURL); + // Clean up browsing list (prevent dupes) and add/select new URL to it + mAddressCombo->remove(mCurrentURL); + mAddressCombo->add(mDisplayURL); + mAddressCombo->selectByValue(mDisplayURL); + } } void LLFloaterWebContent::onClickForward() |