summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterwebcontent.cpp
diff options
context:
space:
mode:
authorniel@nirvana-win7hp.planescape.home <niel@nirvana-win7hp.planescape.home>2011-10-26 01:42:26 +0100
committerniel@nirvana-win7hp.planescape.home <niel@nirvana-win7hp.planescape.home>2011-10-26 01:42:26 +0100
commit4fd9a53115bf85ffe17974323d5fa609e0df960c (patch)
tree7968008d0fa7c0347d637e1fb19add9d436b926d /indra/newview/llfloaterwebcontent.cpp
parent42c166e451d362609d83fb17261f9e8f344e974d (diff)
parentb7a349f231977d5917b29faacca143a85d925576 (diff)
Merge STORM-959
Diffstat (limited to 'indra/newview/llfloaterwebcontent.cpp')
-rw-r--r--indra/newview/llfloaterwebcontent.cpp56
1 files changed, 27 insertions, 29 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 2c9a736aff..f410c31f44 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -48,13 +48,15 @@ LLFloaterWebContent::_Params::_Params()
show_chrome("show_chrome", true),
allow_address_entry("allow_address_entry", true),
preferred_media_size("preferred_media_size"),
- trusted_content("trusted_content", false)
+ trusted_content("trusted_content", false),
+ show_page_title("show_page_title", true)
{}
LLFloaterWebContent::LLFloaterWebContent( const Params& params )
: LLFloater( params ),
LLInstanceTracker<LLFloaterWebContent, std::string>(params.id()),
- mUUID(params.id())
+ mUUID(params.id()),
+ mShowPageTitle(params.show_page_title)
{
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -88,20 +90,6 @@ BOOL LLFloaterWebContent::postBuild()
return TRUE;
}
-bool LLFloaterWebContent::matchesKey(const LLSD& key)
-{
- LLUUID id = key["id"];
- if (id.notNull())
- {
- return id == mKey["id"].asUUID();
- }
- else
- {
- return key["target"].asString() == mKey["target"].asString();
- }
-}
-
-
void LLFloaterWebContent::initializeURLHistory()
{
// start with an empty list
@@ -123,6 +111,20 @@ void LLFloaterWebContent::initializeURLHistory()
}
}
+bool LLFloaterWebContent::matchesKey(const LLSD& key)
+{
+ Params p(mKey);
+ Params other_p(key);
+ if (!other_p.target().empty() && other_p.target() != "_blank")
+ {
+ return other_p.target() == p.target();
+ }
+ else
+ {
+ return other_p.id() == p.id();
+ }
+}
+
//static
LLFloater* LLFloaterWebContent::create( Params p)
{
@@ -139,14 +141,7 @@ LLFloater* LLFloaterWebContent::create( Params p)
}
S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
-
- LLSD sd;
- sd["target"] = p.target;
- if(LLFloaterReg::findInstance(p.window_class, sd) != NULL)
- {
- // There's already a web browser for this tag, so we won't be opening a new window.
- }
- else if(browser_window_limit != 0)
+ if(browser_window_limit != 0)
{
// showInstance will open a new window. Figure out how many web browsers are already open,
// and close the least recently opened one if this will put us over the limit.
@@ -166,7 +161,7 @@ LLFloater* LLFloaterWebContent::create( Params p)
}
}
- return LLFloaterReg::showInstance(p.window_class, p);
+ return new LLFloaterWebContent(p);
}
//static
@@ -366,10 +361,13 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
{
std::string page_title = self->getMediaName();
// simulate browser behavior - title is empty, use the current URL
- if ( page_title.length() > 0 )
- setTitle( page_title );
- else
- setTitle( mCurrentURL );
+ if (mShowPageTitle)
+ {
+ if ( page_title.length() > 0 )
+ setTitle( page_title );
+ else
+ setTitle( mCurrentURL );
+ }
}
else if(event == MEDIA_EVENT_LINK_HOVERED )
{