diff options
Diffstat (limited to 'indra/newview/llfloaterwebcontent.cpp')
-rw-r--r-- | indra/newview/llfloaterwebcontent.cpp | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index ca8533abc5..9eb5d1e883 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -33,6 +33,7 @@ #include "llpluginclassmedia.h"
#include "llprogressbar.h"
#include "lltextbox.h"
+#include "llurlhistory.h"
#include "llviewercontrol.h"
#include "llweb.h"
#include "llwindow.h"
@@ -68,9 +69,35 @@ 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();
+
return TRUE;
}
+void LLFloaterWebContent::initializeURLHistory() +{ + // start with an empty list + LLCtrlListInterface* url_list = childGetListInterface("address"); + if (url_list) + { + url_list->operateOnAll(LLCtrlListInterface::OP_DELETE); + } + + // Get all of the entries in the "browser" collection + LLSD browser_history = LLURLHistory::getURLHistory("browser"); + LLSD::array_iterator iter_history = + browser_history.beginArray(); + LLSD::array_iterator end_history = + browser_history.endArray(); + for(; iter_history != end_history; ++iter_history) + { + std::string url = (*iter_history).asString(); + if(! url.empty()) + url_list->addSimpleElement(url); + } +} +
//static
void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid )
{
@@ -255,17 +282,17 @@ 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 test_prefix = mCurrentURL.substr(0, prefix.length()); - LLStringUtil::toLower(test_prefix); - if(test_prefix == prefix) - { - mSecureLockIcon->setVisible(true); - } - else - { - mSecureLockIcon->setVisible(false); - } + std::string prefix = std::string("https://");
+ std::string test_prefix = mCurrentURL.substr(0, prefix.length());
+ LLStringUtil::toLower(test_prefix);
+ if(test_prefix == prefix)
+ {
+ mSecureLockIcon->setVisible(true);
+ }
+ else
+ {
+ mSecureLockIcon->setVisible(false);
+ }
}
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
{
@@ -307,6 +334,10 @@ 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); +
mAddressCombo->remove( mCurrentURL );
mAddressCombo->add( mCurrentURL );
mAddressCombo->selectByValue( mCurrentURL );
|