diff options
author | Merov Linden <merov@lindenlab.com> | 2014-09-28 21:40:32 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-09-28 21:40:32 -0700 |
commit | 4b80a5ed059d91bc37558db8ed664365e39d21d6 (patch) | |
tree | 55cfddc381448a72b54c03347deabada9687f629 /indra/newview/llweb.cpp | |
parent | 896f48229e577b1bcf94f2cb80d73a6bf1a9330c (diff) | |
parent | 499f5aa9a4b46d61ee94b26d5c86bc032766af70 (diff) |
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llweb.cpp')
-rwxr-xr-x | indra/newview/llweb.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 665671a38f..0312972a22 100755 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -50,6 +50,8 @@ #include "llviewerwindow.h" #include "llnotificationsutil.h" +#include <boost/regex.hpp> + bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ); @@ -87,7 +89,8 @@ void LLWeb::loadURL(const std::string& url, const std::string& target, const std // Force load in the internal browser, as if with a blank target. loadURLInternal(url, "", uuid); } - else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) + + else if (useExternalBrowser(url) || (target == "_external")) { loadURLExternal(url); } @@ -225,3 +228,19 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, return LLWeb::escapeURL(expanded_url); } + +//static +bool LLWeb::useExternalBrowser(const std::string &url) +{ + if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY) + { + return true; + } + else if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_INT_LL_EXT_OTHERS) + { + boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)\\b", boost::regex::perl|boost::regex::icase); + boost::match_results<std::string::const_iterator> matches; + return !(boost::regex_search(url, matches, pattern)); + } + return false; +} |