summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 90267c173c..5bbef78dd4 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -319,6 +319,11 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
if (mContextMenu)
{
+ // hide/show debugging options
+ bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
+ mContextMenu->setItemVisible("open_webinspector", media_plugin_debugging_enabled );
+ mContextMenu->setItemVisible("debug_separator", media_plugin_debugging_enabled );
+
mContextMenu->show(x, y);
LLMenuGL::showPopup(this, mContextMenu, x, y);
}
@@ -385,12 +390,22 @@ void LLMediaCtrl::onFocusLost()
//
BOOL LLMediaCtrl::postBuild ()
{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
+ registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
+
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
+
return TRUE;
}
+void LLMediaCtrl::onOpenWebInspector()
+{
+ if (mMediaSource && mMediaSource->hasMedia())
+ mMediaSource->getMediaPlugin()->showWebInspector( true );
+}
+
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
@@ -1066,10 +1081,10 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
};
break;
- case MEDIA_EVENT_DEBUG_MESSAGE:
- {
- LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL;
- };
+ case MEDIA_EVENT_DEBUG_MESSAGE:
+ {
+ LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL;
+ };
break;
};