Polish web content floater - rename to reflect it now does all media. remove developer options when Develop menu closed. start at google home page by default.

meow-7.2.2
Callum Linden 2016-07-22 16:27:53 -07:00
parent 989379b09b
commit 6f09cf76cd
5 changed files with 84 additions and 80 deletions

View File

@ -82,7 +82,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mCommitCallbackRegistrar.add( "WebContent.Stop", boost::bind( &LLFloaterWebContent::onClickStop, this ));
mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this ));
mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind(&LLFloaterWebContent::onPopExternal, this));
mCommitCallbackRegistrar.add( "WebContent.TestVideo", boost::bind(&LLFloaterWebContent::onTestVideo, this, _2));
mCommitCallbackRegistrar.add( "WebContent.TestURL", boost::bind(&LLFloaterWebContent::onTestURL, this, _2));
}
BOOL LLFloaterWebContent::postBuild()
@ -111,6 +111,9 @@ BOOL LLFloaterWebContent::postBuild()
// initialize the URL history using the system URL History manager
initializeURLHistory();
// if "Develop" Menu open, sety a flag and change things to be more useful for devs
mDevelopMode = gSavedSettings.getBOOL("QAMode");
return TRUE;
}
@ -196,8 +199,6 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
width + getRect().getWidth() - browser_rect.getWidth(),
height + getRect().getHeight() - browser_rect.getHeight());
LL_DEBUGS() << "geometry change: " << geom << LL_ENDL;
LLRect new_rect;
getParent()->screenRectToLocal(geom, &new_rect);
setShape(new_rect);
@ -206,8 +207,6 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
// static
void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
{
LL_DEBUGS() << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << LL_ENDL;
if (!p.id.isProvided())
{
p.id = LLUUID::generateNewID().asString();
@ -225,12 +224,6 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
// and close the least recently opened one if this will put us over the limit.
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class);
LL_DEBUGS() << "total instance count is " << instances.size() << LL_ENDL;
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
{
LL_DEBUGS() << " " << (*iter)->getKey()["target"] << LL_ENDL;
}
if(instances.size() >= (size_t)browser_window_limit)
{
@ -242,7 +235,6 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
void LLFloaterWebContent::open_media(const Params& p)
{
// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
LLViewerMedia::proxyWindowOpened(p.target(), p.id());
mWebBrowser->setHomePageUrl(p.url);
mWebBrowser->setTarget(p.target);
@ -252,6 +244,10 @@ void LLFloaterWebContent::open_media(const Params& p)
getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome);
// turn additional debug controls on but only for Develop mode (Develop menu open)
getChild<LLLayoutPanel>("debug_controls")->setVisible(mDevelopMode);
bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
mAllowNavigation = p.allow_back_forward_navigation;
getChildView("address")->setEnabled(address_entry_enabled);
@ -516,7 +512,7 @@ void LLFloaterWebContent::onPopExternal()
};
}
void LLFloaterWebContent::onTestVideo(std::string url)
void LLFloaterWebContent::onTestURL(std::string url)
{
LLStringUtil::trim(url);
if (url.length() > 0)

View File

@ -92,7 +92,7 @@ protected:
void onClickStop();
void onEnterAddress();
void onPopExternal();
void onTestVideo(std::string url);
void onTestURL(std::string url);
static void preCreate(Params& p);
void open_media(const Params& );
@ -114,6 +114,7 @@ protected:
std::string mUUID;
bool mShowPageTitle;
bool mAllowNavigation;
bool mDevelopMode;
};
#endif // LL_LLFLOATERWEBCONTENT_H

View File

@ -25,10 +25,10 @@
<layout_panel
auto_resize="false"
default_tab_group="1"
height="44"
height="22"
layout="topleft"
left="0"
min_height="40"
min_height="20"
name="nav_controls"
top="400"
width="770">
@ -152,112 +152,136 @@
<button.commit_callback
function="WebContent.PopExternal" />
</button>
</layout_panel>
<layout_panel
height="22"
layout="topleft"
left_delta="0"
name="debug_controls"
top_delta="0"
auto_resize="false"
width="585">
<button
image_overlay="Home_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Web tests home page"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="web_test_home_page"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MPEG4 Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="1"
left="27"
name="VLC Plugin Test"
top="22"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/ss.mp4"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MKV Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="27"
left="51"
name="VLC Plugin Test"
top="22"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/jellyfish.mkv"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="WebM Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
left="75"
name="VLC Plugin Test"
top="22"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/jumprope.webm"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MP3 audio Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="75"
left="99"
name="VLC Plugin Test"
top="22"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/alegria.mp3"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="FLV Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="99"
left="123"
name="VLC Plugin Test"
top="22"
top="0"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
function="WebContent.TestURL"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/vandal.flv"/>
</button>
</layout_panel>
<layout_panel
height="40"

View File

@ -232,11 +232,11 @@
parameter="message_critical" />
</menu_item_call>
<menu_item_call
label="Web Content Floater Debug Test"
name="Web Content Floater Debug Test">
label="Media Browser"
name="Media Browser">
<menu_item_call.on_click
function="Advanced.WebContentTest"
parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
parameter="http://google.com"/>
</menu_item_call>
<menu
create_jump_keys="true"

View File

@ -3141,30 +3141,13 @@
label="UI"
name="UI"
tear_off="true">
<!-- <menu_item_check
label="New Bottom Bar"
name="New Bottom Bar">
<menu_item_check.on_check
function="CheckControl"
parameter="BottomPanelNew" />
<menu_item_check.on_click
function="ToggleControl"
parameter="BottomPanelNew" />
</menu_item_check>-->
<menu_item_call
label="Media Browser Test"
name="Web Browser Test">
<menu_item_call.on_click
function="Advanced.WebBrowserTest"
parameter="http://secondlife.com/app/search/slurls.html"/>
</menu_item_call>
<menu_item_call
label="Web Content Browser"
name="Web Content Browser"
shortcut="control|shift|Z">
label="Media Browser"
name="Media Browser"
shortcut="control|alt|shift|Z">
<menu_item_call.on_click
function="Advanced.WebContentTest"
parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
parameter="http://google.com"/>
</menu_item_call>
<menu_item_call
label="FB Connect Test"