diff options
| author | Aimee Linden <aimee@lindenlab.com> | 2010-05-28 17:19:20 +0100 |
|---|---|---|
| committer | Aimee Linden <aimee@lindenlab.com> | 2010-05-28 17:19:20 +0100 |
| commit | 24a867a646a979d48cf5f4c94eae041507a09310 (patch) | |
| tree | 5f963caa5c9fd69e3ef0669220cc736cf472d8a4 /indra/newview/llweb.cpp | |
| parent | 176b5c5a67c3bd34da787c7446d7349dc1937803 (diff) | |
| parent | 7983de22074beb25a832f89aa3e7a9728baca328 (diff) | |
Merged from ssh://hg.lindenlab.com/dessie/viewer-private
Diffstat (limited to 'indra/newview/llweb.cpp')
| -rw-r--r-- | indra/newview/llweb.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index aa03b1afd1..5c9633c036 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -54,6 +54,10 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerwindow.h" +#include "llnotificationsutil.h" + +bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ); + class URLLoader : public LLToastAlertPanel::URLLoader { @@ -110,11 +114,26 @@ void LLWeb::loadURLExternal(const std::string& url) // static void LLWeb::loadURLExternal(const std::string& url, bool async) { - std::string escaped_url = escapeURL(url); - if (gViewerWindow) + LLSD payload; + payload["url"] = url; + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, boost::bind(on_load_url_external_response, _1, _2, async)); +} + +// static +bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( 0 == option ) { - gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async); + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + std::string escaped_url = LLWeb::escapeURL(url); + if (gViewerWindow) + { + gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async); + } } + return false; } |
