From f3cdc9b01deb6c789d909b39914d11a6184946cd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 12:16:07 -0700 Subject: allow_popups is now driven by trusted content flag trusted content is now a const attribute of LLMediaCtrl, set in constructor params --- indra/newview/llfloatersearch.cpp | 6 +----- indra/newview/llmediactrl.cpp | 16 +++------------- indra/newview/llmediactrl.h | 7 ++----- indra/newview/llpanelhome.cpp | 1 - indra/newview/llpanellogin.cpp | 7 ------- .../skins/default/xui/en/floater_buy_currency_html.xml | 2 +- .../skins/default/xui/en/floater_help_browser.xml | 2 +- indra/newview/skins/default/xui/en/floater_lsl_guide.xml | 1 - indra/newview/skins/default/xui/en/floater_search.xml | 2 +- indra/newview/skins/default/xui/en/floater_tos.xml | 2 +- indra/newview/skins/default/xui/en/panel_login.xml | 3 ++- .../skins/default/xui/en/panel_sidetray_home_tab.xml | 2 +- 12 files changed, 13 insertions(+), 38 deletions(-) diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 7661e50eba..3ed4aec89a 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -96,11 +96,7 @@ LLFloaterSearch::LLFloaterSearch(const LLSD& key) : BOOL LLFloaterSearch::postBuild() { mBrowser = getChild("browser"); - if (mBrowser) - { - mBrowser->addObserver(this); - mBrowser->setTrusted(true); - } + mBrowser->addObserver(this); return TRUE; } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0fd18303bb..e6577a7ab8 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -70,7 +70,7 @@ LLMediaCtrl::Params::Params() caret_color("caret_color"), initial_mime_type("initial_mime_type"), media_id("media_id"), - always_allow_popups("always_allow_popups", false) + trusted_content("trusted_content", false) { tab_stop(false); } @@ -97,7 +97,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mTextureHeight ( 1024 ), mClearCache(false), mHomePageMimeType(p.initial_mime_type), - mAlwaysAllowPopups(p.always_allow_popups) + mTrusted(p.trusted_content) { { LLColor4 color = p.caret_color().get(); @@ -169,16 +169,6 @@ void LLMediaCtrl::setTakeFocusOnClick( bool take_focus ) mTakeFocusOnClick = take_focus; } -//////////////////////////////////////////////////////////////////////////////// -void LLMediaCtrl::setTrusted( bool valIn ) -{ - if(mMediaSource) - { - mMediaSource->setTrustedBrowser(valIn); - } - mTrusted = valIn; -} - //////////////////////////////////////////////////////////////////////////////// // BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask ) @@ -1049,7 +1039,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid); notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2); - if (mAlwaysAllowPopups) + if (mTrusted) { LLNotifications::instance().forceResponse(notify_params, 0); } diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index dc18a1130e..f010e5f4c8 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -52,7 +52,7 @@ public: ignore_ui_scale, hide_loading, decouple_texture_size, - always_allow_popups; + trusted_content; Optional texture_width, texture_height; @@ -105,8 +105,6 @@ public: // Javascript or some other mechanism. However, we need the search // floater and login page to handle these URLs. Those are safe // because we control the page content. See DEV-9530. JC. - void setTrusted( bool valIn ); - void setHomePageUrl( const std::string& urlIn, const std::string& mime_type = LLStringUtil::null ); std::string getHomePageUrl(); @@ -177,7 +175,7 @@ public: LLViewBorder* mBorder; bool mFrequentUpdates; bool mForceUpdate; - bool mTrusted; + const bool mTrusted; std::string mHomePageUrl; std::string mHomePageMimeType; std::string mCurrentNavUrl; @@ -194,7 +192,6 @@ public: S32 mTextureWidth; S32 mTextureHeight; bool mClearCache; - bool mAlwaysAllowPopups; boost::shared_ptr mCurNotification; }; diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index 93c4e0c9c7..b03bab3127 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -61,7 +61,6 @@ BOOL LLPanelHome::postBuild() std::string url = LLViewerHome::getHomeURL(); mBrowser->addObserver(this); - mBrowser->setTrusted(true); mBrowser->setHomePageUrl(url); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index f1bd861f1d..7c93d8a1f9 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -257,13 +257,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // Clear the browser's cache to avoid any potential for the cache messing up the login screen. web_browser->clearCache(); - // Need to handle login secondlife:///app/ URLs - web_browser->setTrusted( true ); - - // don't make it a tab stop until SL-27594 is fixed - web_browser->setTabStop(FALSE); - // web_browser->navigateToLocalPage( "loading", "loading.html" ); - reshapeBrowser(); // kick off a request to grab the url manually diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml index 0226b75d0a..b9c415633f 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml @@ -16,7 +16,7 @@ https://quick-buy.secondlife.com/[LANGUAGE]/display/?sa=[SPECIFIC_AMOUNT]&sum=[SUM]&msg=[MSG]&bal=[BAL]