diff options
Diffstat (limited to '')
-rwxr-xr-x | linden/indra/llplugin/llpluginclassmedia.cpp | 28 | ||||
-rwxr-xr-x | linden/indra/llplugin/llpluginclassmedia.h | 11 | ||||
-rwxr-xr-x | linden/indra/media_plugins/webkit/media_plugin_webkit.cpp | 17 |
3 files changed, 14 insertions, 42 deletions
diff --git a/linden/indra/llplugin/llpluginclassmedia.cpp b/linden/indra/llplugin/llpluginclassmedia.cpp index 5dc0c47..85241be 100755 --- a/linden/indra/llplugin/llpluginclassmedia.cpp +++ b/linden/indra/llplugin/llpluginclassmedia.cpp | |||
@@ -150,7 +150,6 @@ void LLPluginClassMedia::reset() | |||
150 | mProgressPercent = 0; | 150 | mProgressPercent = 0; |
151 | mClickURL.clear(); | 151 | mClickURL.clear(); |
152 | mClickTarget.clear(); | 152 | mClickTarget.clear(); |
153 | mClickTargetType = TARGET_NONE; | ||
154 | 153 | ||
155 | // media_time class | 154 | // media_time class |
156 | mCurrentTime = 0.0f; | 155 | mCurrentTime = 0.0f; |
@@ -722,30 +721,6 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled) | |||
722 | sendMessage(message); | 721 | sendMessage(message); |
723 | } | 722 | } |
724 | 723 | ||
725 | LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) | ||
726 | { | ||
727 | llassert(false); | ||
728 | return LLPluginClassMedia::TARGET_OTHER; | ||
729 | #if 0 | ||
730 | // convert a LinkTargetType value from llqtwebkit to an ETargetType | ||
731 | // so that we don't expose the llqtwebkit header in viewer code | ||
732 | switch (target_type) | ||
733 | { | ||
734 | case LLQtWebKit::LTT_TARGET_NONE: | ||
735 | return LLPluginClassMedia::TARGET_NONE; | ||
736 | |||
737 | case LLQtWebKit::LTT_TARGET_BLANK: | ||
738 | return LLPluginClassMedia::TARGET_BLANK; | ||
739 | |||
740 | case LLQtWebKit::LTT_TARGET_EXTERNAL: | ||
741 | return LLPluginClassMedia::TARGET_EXTERNAL; | ||
742 | |||
743 | default: | ||
744 | return LLPluginClassMedia::TARGET_OTHER; | ||
745 | } | ||
746 | #endif | ||
747 | } | ||
748 | |||
749 | /* virtual */ | 724 | /* virtual */ |
750 | void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) | 725 | void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) |
751 | { | 726 | { |
@@ -998,15 +973,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) | |||
998 | { | 973 | { |
999 | mClickURL = message.getValue("uri"); | 974 | mClickURL = message.getValue("uri"); |
1000 | mClickTarget = message.getValue("target"); | 975 | mClickTarget = message.getValue("target"); |
1001 | U32 target_type = message.getValueU32("target_type"); | ||
1002 | mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type); | ||
1003 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); | 976 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); |
1004 | } | 977 | } |
1005 | else if(message_name == "click_nofollow") | 978 | else if(message_name == "click_nofollow") |
1006 | { | 979 | { |
1007 | mClickURL = message.getValue("uri"); | 980 | mClickURL = message.getValue("uri"); |
1008 | mClickTarget.clear(); | 981 | mClickTarget.clear(); |
1009 | mClickTargetType = TARGET_NONE; | ||
1010 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); | 982 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); |
1011 | } | 983 | } |
1012 | else if(message_name == "cookie_set") | 984 | else if(message_name == "cookie_set") |
diff --git a/linden/indra/llplugin/llpluginclassmedia.h b/linden/indra/llplugin/llpluginclassmedia.h index abb7926..0004971 100755 --- a/linden/indra/llplugin/llpluginclassmedia.h +++ b/linden/indra/llplugin/llpluginclassmedia.h | |||
@@ -225,16 +225,6 @@ public: | |||
225 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF | 225 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF |
226 | std::string getClickTarget() const { return mClickTarget; }; | 226 | std::string getClickTarget() const { return mClickTarget; }; |
227 | 227 | ||
228 | typedef enum | ||
229 | { | ||
230 | TARGET_NONE, // empty href target string | ||
231 | TARGET_BLANK, // target to open link in user's preferred browser | ||
232 | TARGET_EXTERNAL, // target to open link in external browser | ||
233 | TARGET_OTHER // nonempty and unsupported target type | ||
234 | }ETargetType; | ||
235 | |||
236 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF | ||
237 | ETargetType getClickTargetType() const { return mClickTargetType; }; | ||
238 | 228 | ||
239 | std::string getMediaName() const { return mMediaName; }; | 229 | std::string getMediaName() const { return mMediaName; }; |
240 | std::string getMediaDescription() const { return mMediaDescription; }; | 230 | std::string getMediaDescription() const { return mMediaDescription; }; |
@@ -366,7 +356,6 @@ protected: | |||
366 | std::string mLocation; | 356 | std::string mLocation; |
367 | std::string mClickURL; | 357 | std::string mClickURL; |
368 | std::string mClickTarget; | 358 | std::string mClickTarget; |
369 | ETargetType mClickTargetType; | ||
370 | 359 | ||
371 | ///////////////////////////////////////// | 360 | ///////////////////////////////////////// |
372 | // media_time class | 361 | // media_time class |
diff --git a/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp b/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp index 767090c..eed59a2 100755 --- a/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp | |||
@@ -326,7 +326,11 @@ private: | |||
326 | LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); | 326 | LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); |
327 | 327 | ||
328 | // create single browser window | 328 | // create single browser window |
329 | #if LLQTWEBKIT_API_VERSION >= 2 | ||
330 | mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow(mWidth, mHeight /*, mTarget*/ ); // We don't have mTarget yet. | ||
331 | #else | ||
329 | mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); | 332 | mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); |
333 | #endif | ||
330 | 334 | ||
331 | // tell LLQtWebKit about the size of the browser window | 335 | // tell LLQtWebKit about the size of the browser window |
332 | LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); | 336 | LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); |
@@ -527,10 +531,14 @@ private: | |||
527 | void onClickLinkHref(const EventType& event) | 531 | void onClickLinkHref(const EventType& event) |
528 | { | 532 | { |
529 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); | 533 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); |
534 | #if LLQTWEBKIT_API_VERSION >= 2 | ||
535 | message.setValue("uri", event.getEventUri()); | ||
536 | message.setValue("target", event.getStringValue()); | ||
537 | message.setValue("uuid", event.getStringValue2()); | ||
538 | #else | ||
539 | // This will work as long as we don't need "uuid", which will be needed for MoaP. | ||
530 | message.setValue("uri", event.getStringValue()); | 540 | message.setValue("uri", event.getStringValue()); |
531 | message.setValue("target", event.getStringValue2()); | 541 | message.setValue("target", event.getStringValue2()); |
532 | #if 0 // FIXME (webkit_plugins): error: ‘const class LLEmbeddedBrowserWindowEvent’ has no member named ‘getLinkType’ | ||
533 | message.setValueU32("target_type", event.getLinkType()); | ||
534 | #endif | 542 | #endif |
535 | sendMessage(message); | 543 | sendMessage(message); |
536 | } | 544 | } |
@@ -540,10 +548,13 @@ private: | |||
540 | void onClickLinkNoFollow(const EventType& event) | 548 | void onClickLinkNoFollow(const EventType& event) |
541 | { | 549 | { |
542 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow"); | 550 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow"); |
551 | #if LLQTWEBKIT_API_VERSION >= 2 | ||
552 | message.setValue("uri", event.getEventUri()); | ||
553 | #else | ||
543 | message.setValue("uri", event.getStringValue()); | 554 | message.setValue("uri", event.getStringValue()); |
555 | #endif | ||
544 | sendMessage(message); | 556 | sendMessage(message); |
545 | } | 557 | } |
546 | |||
547 | 558 | ||
548 | //////////////////////////////////////////////////////////////////////////////// | 559 | //////////////////////////////////////////////////////////////////////////////// |
549 | // virtual | 560 | // virtual |