diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfloaterreg.cpp | 7 | ||||
-rw-r--r-- | indra/llui/llsdparam.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloatersearch.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloatersearch.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterwebcontent.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llfloaterwebcontent.h | 6 | ||||
-rw-r--r-- | indra/newview/llmediactrl.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_web_content.xml | 5 |
9 files changed, 41 insertions, 11 deletions
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 4677d535db..f5e6444287 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -129,7 +129,10 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe - res->mKey = key; + if (res->mKey.isUndefined()) + { + res->mKey = key; + } res->setInstanceName(name); res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) @@ -221,7 +224,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, LLFloater* instance = getInstance(name, key); if (instance) { - instance->openFloater(key); + instance->openFloater(instance->mKey); if (focus) instance->setFocus(TRUE); } diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 827b8c8584..f776c781b3 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -103,6 +103,7 @@ class LLSDParamAdapter : public T } LLSDParamAdapter(const T& val) + : T(val) { T::operator=(val); } diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index e9710c41a1..ce0bba802d 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -84,10 +84,13 @@ LLSearchHandler gSearchHandler; LLFloaterSearch::_Params::_Params() : category("category", ""), query("query") -{} +{ + trusted_content = true; + allow_address_entry = false; +} -LLFloaterSearch::LLFloaterSearch(const LLSD& key) : +LLFloaterSearch::LLFloaterSearch(const Params& key) : LLFloaterWebContent(key), mSearchGodLevel(0) { diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index 2c59fa6d5d..a4043b2353 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -46,7 +46,7 @@ class LLFloaterSearch : public LLFloaterWebContent { public: - struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::_Params> + struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params> { Optional<std::string> category; Optional<std::string> query; @@ -56,7 +56,7 @@ public: typedef LLSDParamAdapter<_Params> Params; - LLFloaterSearch(const LLSD& key); + LLFloaterSearch(const Params& key); /// show the search floater with a new search /// see search() for details on the key parameter. diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 4cc29267da..c7c6857a47 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -45,10 +45,12 @@ LLFloaterWebContent::_Params::_Params() target("target"), id("id"), show_chrome("show_chrome", true), - preferred_media_size("preferred_media_size") + allow_address_entry("allow_address_entry", true), + preferred_media_size("preferred_media_size"), + trusted_content("trusted_content", false) {} -LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) +LLFloaterWebContent::LLFloaterWebContent( const Params& key ) : LLFloater( key ) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); @@ -218,10 +220,12 @@ void LLFloaterWebContent::open_media(const Params& p) mWebBrowser->setHomePageUrl(p.url, "text/html"); mWebBrowser->setTarget(p.target); mWebBrowser->navigateTo(p.url, "text/html"); + set_current_url(p.url); getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome); getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome); + getChild<LLUICtrl>("address")->setEnabled(p.allow_address_entry && !p.trusted_content); if (!p.show_chrome) { @@ -247,6 +251,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) } mUUID = params.id().asString(); + mWebBrowser->setTrustedContent(params.trusted_content); // tell the browser instance to load the specified URL open_media(params); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 2cb6bd0831..3a99d49b5a 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -49,7 +49,9 @@ public: Optional<std::string> url, target; Optional<LLUUID> id; - Optional<bool> show_chrome; + Optional<bool> show_chrome, + allow_address_entry, + trusted_content; Optional<LLRect> preferred_media_size; _Params(); @@ -57,7 +59,7 @@ public: typedef LLSDParamAdapter<_Params> Params; - LLFloaterWebContent(const LLSD& key); + LLFloaterWebContent(const Params& key); void initializeURLHistory(); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 03ccabc994..1eb786f433 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1164,3 +1164,12 @@ void LLMediaCtrl::hideNotification() mWindowShade->hide(); } } + +void LLMediaCtrl::setTrustedContent(bool trusted) +{ + mTrusted = trusted; + if (mMediaSource) + { + mMediaSource->setTrustedBrowser(trusted); + } +} diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 28666e620f..6833453616 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -149,6 +149,8 @@ public: void showNotification(boost::shared_ptr<class LLNotification> notify); void hideNotification(); + void setTrustedContent(bool trusted); + // over-rides virtual BOOL handleKeyHere( KEY key, MASK mask); virtual void handleVisibilityChange ( BOOL new_visibility ); @@ -176,7 +178,7 @@ public: LLViewBorder* mBorder; bool mFrequentUpdates; bool mForceUpdate; - const bool mTrusted; + bool mTrusted; std::string mHomePageUrl; std::string mHomePageMimeType; std::string mCurrentNavUrl; 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 69e6057556..0eda9ae62a 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -40,6 +40,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" hover_glow_amount="0.15" tool_tip="Navigate back" follows="left|top" @@ -58,6 +59,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Navigate forward" follows="left|top" height="22" @@ -75,6 +77,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Stop navigation" enabled="true" follows="left|top" @@ -93,6 +96,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Reload page" follows="left|top" height="22" @@ -137,6 +141,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Open current URL in your desktop browser" follows="right|top" enabled="true" |