summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r--indra/newview/llweb.cpp44
1 files changed, 32 insertions, 12 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index a5691d8a1c..3204c2d264 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -35,10 +35,31 @@
#include "llweb.h"
-#include "llviewerwindow.h"
+// Library includes
+#include "llwindow.h" // spawnWebBrowser()
+#include "llviewerwindow.h"
#include "llviewercontrol.h"
-#include "llfloaterhtmlhelp.h"
+#include "llfloatermediabrowser.h"
+#include "llfloaterreg.h"
+#include "llalertdialog.h"
+
+class URLLoader : public LLAlertDialog::URLLoader
+{
+ virtual void load(const std::string& url , bool force_open_externally)
+ {
+ if (force_open_externally)
+ {
+ LLWeb::loadURLExternal(url);
+ }
+ else
+ {
+ LLWeb::loadURL(url);
+ }
+ }
+};
+static URLLoader sAlertURLLoader;
+
// static
void LLWeb::initClass()
@@ -46,6 +67,7 @@ void LLWeb::initClass()
LLAlertDialog::setURLLoader(&sAlertURLLoader);
}
+
// static
void LLWeb::loadURL(const std::string& url)
{
@@ -55,12 +77,19 @@ void LLWeb::loadURL(const std::string& url)
}
else
{
- LLFloaterMediaBrowser::showInstance(url);
+ loadURLInternal(url);
}
}
// static
+void LLWeb::loadURLInternal(const std::string &url)
+{
+ LLFloaterReg::showInstance("media_browser", url);
+}
+
+
+// static
void LLWeb::loadURLExternal(const std::string& url)
{
std::string escaped_url = escapeURL(url);
@@ -93,12 +122,3 @@ std::string LLWeb::escapeURL(const std::string& url)
}
return escaped_url;
}
-
-// virtual
-void LLWeb::URLLoader::load(const std::string& url)
-{
- loadURL(url);
-}
-
-// static
-LLWeb::URLLoader LLWeb::sAlertURLLoader;