ACME-734 : Fix : Feed browsing history but without the query part

master
Merov Linden 2013-07-19 22:35:45 -07:00
parent 39a2f52b02
commit eadb42eb9d
4 changed files with 17 additions and 19 deletions

View File

@ -321,7 +321,6 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
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);

View File

@ -48,7 +48,6 @@ LLFloaterWebContent::_Params::_Params()
show_chrome("show_chrome", 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)
@ -69,7 +68,6 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mUUID(params.id()),
mShowPageTitle(params.show_page_title),
mAllowNavigation(true),
mSaveURLHistory(true),
mDisplayURL("")
{
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
@ -250,7 +248,6 @@ void LLFloaterWebContent::open_media(const Params& p)
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);
@ -421,11 +418,8 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
LLStringUtil::trim(mCurrentURL);
LLURLHistory::removeURL("browser", mCurrentURL);
if (mSaveURLHistory)
{
// serialize url history into the system URL History manager
LLURLHistory::addURL("browser", mCurrentURL);
}
// serialize url history into the system URL History manager
LLURLHistory::addURL("browser", mCurrentURL);
if (!mDisplayURL.empty())
{

View File

@ -55,7 +55,6 @@ public:
Optional<bool> show_chrome,
allow_address_entry,
allow_back_forward_navigation,
save_url_history,
trusted_content,
show_page_title;
Optional<LLRect> preferred_media_size;
@ -112,7 +111,6 @@ protected:
std::string mUUID;
bool mShowPageTitle;
bool mAllowNavigation;
bool mSaveURLHistory;
};
#endif // LL_LLFLOATERWEBCONTENT_H

View File

@ -103,22 +103,29 @@ LLSD LLURLHistory::getURLHistory(const std::string& collection)
// static
void LLURLHistory::addURL(const std::string& collection, const std::string& url)
{
if(! url.empty())
if(!url.empty())
{
sHistorySD[collection].insert(0, url);
LLURI u(url);
std::string simplified_url = u.scheme() + "://" + u.authority() + u.path();
sHistorySD[collection].insert(0, simplified_url);
LLURLHistory::limitSize(collection);
}
}
// static
void LLURLHistory::removeURL(const std::string& collection, const std::string& url)
{
for(int index = 0; index < sHistorySD[collection].size(); index++)
if(!url.empty())
{
if(sHistorySD[collection].get(index).asString() == url)
{
sHistorySD[collection].erase(index);
}
}
LLURI u(url);
std::string simplified_url = u.scheme() + "://" + u.authority() + u.path();
for(int index = 0; index < sHistorySD[collection].size(); index++)
{
if(sHistorySD[collection].get(index).asString() == simplified_url)
{
sHistorySD[collection].erase(index);
}
}
}
}
// static