From d4668787addf870fca0dc1cbf03c756584838261 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 5 Aug 2010 11:16:13 -0700 Subject: Allow targeted links in the embedded browser to open multiple media browser windows. Added an optional "target" parameter" to LLWeb::loadURL and loadInternal. Made LLViewerMediaImpl::handleMediaEvent pass the target attribute of clicked links through. Set floater_media_browser.xml to allow multiple instances. Added LLFloaterMediaBrowser::create() and made LLFloaterMediaBrowser assume the incoming tag is the window's target, not the URL. Reviewed by Richard at http://codereview.lindenlab.com/2641050 --- indra/newview/llweb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llweb.cpp') diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 5c9633c036..b61109d490 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -84,23 +84,23 @@ void LLWeb::initClass() // static -void LLWeb::loadURL(const std::string& url) +void LLWeb::loadURL(const std::string& url, const std::string& target) { - if (gSavedSettings.getBOOL("UseExternalBrowser")) + if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) { loadURLExternal(url); } else { - loadURLInternal(url); + loadURLInternal(url, target); } } // static -void LLWeb::loadURLInternal(const std::string &url) +void LLWeb::loadURLInternal(const std::string &url, const std::string& target) { - LLFloaterReg::showInstance("media_browser", url); + LLFloaterMediaBrowser::create(url, target); } -- cgit v1.2.3 From 25367cb33a4ae3df474b2d77e04bf44625efde4b Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 18 Aug 2010 16:58:57 -0700 Subject: Add support for an "_internal" target that forces a link to open in the embedded browser, regardless of the state of the "UseExternalBrowser" pref. --- indra/newview/llweb.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llweb.cpp') diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index b61109d490..c6219334f4 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -86,7 +86,12 @@ void LLWeb::initClass() // static void LLWeb::loadURL(const std::string& url, const std::string& target) { - if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) + if(target == "_internal") + { + // Force load in the internal browser, as if with a blank target. + loadURLInternal(url); + } + else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) { loadURLExternal(url); } -- cgit v1.2.3 From 531b77a9485db77df31a25a766e66ec1443a49f6 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 15 Sep 2010 14:39:42 -0700 Subject: Enable web popups to specify size and position of the Media Browser window from javascript. This includes a Mac build of llqtwebkit from the following sources: revision aacdf69cbf5aa12d77c179296e31ef643ed1ef4a of http://qt.gitorious.org/+lindenqt/qt/lindenqt (currently head of the 'lindenqt' branch) revision 81ab5ae326f0 of http://hg.secondlife.com/llqtwebkit (currently head of the default branch) Reviewed by Callum. --- indra/newview/llweb.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'indra/newview/llweb.cpp') diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 298e5590d0..912413d06a 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -78,12 +78,12 @@ void LLWeb::initClass() // static -void LLWeb::loadURL(const std::string& url, const std::string& target) +void LLWeb::loadURL(const std::string& url, const std::string& target, const std::string& uuid) { if(target == "_internal") { // Force load in the internal browser, as if with a blank target. - loadURLInternal(url); + loadURLInternal(url, "", uuid); } else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) { @@ -91,28 +91,31 @@ void LLWeb::loadURL(const std::string& url, const std::string& target) } else { - loadURLInternal(url, target); + loadURLInternal(url, target, uuid); } } // static -void LLWeb::loadURLInternal(const std::string &url, const std::string& target) +void LLWeb::loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { - LLFloaterMediaBrowser::create(url, target); + LLFloaterMediaBrowser::create(url, target, uuid); } // static -void LLWeb::loadURLExternal(const std::string& url) +void LLWeb::loadURLExternal(const std::string& url, const std::string& uuid) { loadURLExternal(url, true); } // static -void LLWeb::loadURLExternal(const std::string& url, bool async) +void LLWeb::loadURLExternal(const std::string& url, bool async, const std::string& uuid) { + // Act like the proxy window was closed, since we won't be able to track targeted windows in the external browser. + LLViewerMedia::proxyWindowClosed(uuid); + LLSD payload; payload["url"] = url; LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, boost::bind(on_load_url_external_response, _1, _2, async)); -- cgit v1.2.3 From a20a98454de522eba4da17881b85a0f16bb3c116 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 20 Sep 2010 18:02:23 -0700 Subject: Fix one variant of LLWeb::loadURLExternal() not passing through the uuid to the other variant. --- indra/newview/llweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llweb.cpp') diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 912413d06a..73a37a6993 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -106,7 +106,7 @@ void LLWeb::loadURLInternal(const std::string &url, const std::string& target, c // static void LLWeb::loadURLExternal(const std::string& url, const std::string& uuid) { - loadURLExternal(url, true); + loadURLExternal(url, true, uuid); } -- cgit v1.2.3