aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanellogin.cpp55
1 files changed, 30 insertions, 25 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 69539c7..2a8c20f 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -73,12 +73,10 @@
73#include "lluictrlfactory.h" 73#include "lluictrlfactory.h"
74#include "llhttpclient.h" 74#include "llhttpclient.h"
75#include "llweb.h" 75#include "llweb.h"
76#include "llwebbrowserctrl.h"
77#include "viewerversion.h" 76#include "viewerversion.h"
77#include "llmediactrl.h"
78 78
79#include "llfloaterhtml.h" 79#include "llfloatermediabrowser.h"
80
81#include "llfloaterhtmlhelp.h"
82#include "llfloatertos.h" 80#include "llfloatertos.h"
83 81
84#include "llglheaders.h" 82#include "llglheaders.h"
@@ -101,7 +99,7 @@ class LLLoginRefreshHandler : public LLCommandHandler
101public: 99public:
102 // don't allow from external browsers 100 // don't allow from external browsers
103 LLLoginRefreshHandler() : LLCommandHandler("login_refresh", true) { } 101 LLLoginRefreshHandler() : LLCommandHandler("login_refresh", true) { }
104 bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web) 102 bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
105 { 103 {
106 if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) 104 if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
107 { 105 {
@@ -291,16 +289,15 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
291#endif 289#endif
292 290
293 // get the web browser control 291 // get the web browser control
294 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html"); 292 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
293 web_browser->addObserver(this);
294
295 // Need to handle login secondlife:///app/ URLs 295 // Need to handle login secondlife:///app/ URLs
296 web_browser->setTrusted( true ); 296 web_browser->setTrusted( true );
297 297
298 // observe browser events
299 web_browser->addObserver( this );
300
301 // don't make it a tab stop until SL-27594 is fixed 298 // don't make it a tab stop until SL-27594 is fixed
302 web_browser->setTabStop(FALSE); 299 web_browser->setTabStop(FALSE);
303 web_browser->navigateToLocalPage( "loading", "loading.html" ); 300 // web_browser->navigateToLocalPage( "loading", "loading.html" );
304 301
305 // make links open in external browser 302 // make links open in external browser
306 web_browser->setOpenInExternalBrowser( true ); 303 web_browser->setOpenInExternalBrowser( true );
@@ -335,7 +332,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
335 332
336void LLPanelLogin::setSiteIsAlive( bool alive ) 333void LLPanelLogin::setSiteIsAlive( bool alive )
337{ 334{
338 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html"); 335 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
339 // if the contents of the site was retrieved 336 // if the contents of the site was retrieved
340 if ( alive ) 337 if ( alive )
341 { 338 {
@@ -398,6 +395,11 @@ LLPanelLogin::~LLPanelLogin()
398 395
399 //// We know we're done with the image, so be rid of it. 396 //// We know we're done with the image, so be rid of it.
400 //gImageList.deleteImage( mLogoImage ); 397 //gImageList.deleteImage( mLogoImage );
398
399 if ( gFocusMgr.getDefaultKeyboardFocus() == this )
400 {
401 gFocusMgr.setDefaultKeyboardFocus(NULL);
402 }
401} 403}
402 404
403// virtual 405// virtual
@@ -779,7 +781,7 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
779{ 781{
780 if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return; 782 if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return;
781 783
782 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 784 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
783 785
784 if (web_browser) 786 if (web_browser)
785 { 787 {
@@ -952,25 +954,28 @@ void LLPanelLogin::loadLoginPage()
952#endif 954#endif
953#endif 955#endif
954 956
955 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 957 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
956 958
957 // navigate to the "real" page 959 // navigate to the "real" page
958 web_browser->navigateTo( oStr.str() ); 960 web_browser->navigateTo( oStr.str(), "text/html" );
959} 961}
960 962
961void LLPanelLogin::onNavigateComplete( const EventType& eventIn ) 963void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
962{ 964{
963 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 965 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
964 if (web_browser)
965 { 966 {
966 // *HACK HACK HACK HACK! 967 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
967 /* Stuff a Tab key into the browser now so that the first field will 968 if (web_browser)
968 ** get the focus! The embedded javascript on the page that properly 969 {
969 ** sets the initial focus in a real web browser is not working inside 970 // *HACK HACK HACK HACK!
970 ** the viewer, so this is an UGLY HACK WORKAROUND for now. 971 /* Stuff a Tab key into the browser now so that the first field will
971 */ 972 ** get the focus! The embedded javascript on the page that properly
972 // Commented out as it's not reliable 973 ** sets the initial focus in a real web browser is not working inside
973 //web_browser->handleKey(KEY_TAB, MASK_NONE, false); 974 ** the viewer, so this is an UGLY HACK WORKAROUND for now.
975 */
976 // Commented out as it's not reliable
977 //web_browser->handleKey(KEY_TAB, MASK_NONE, false);
978 }
974 } 979 }
975} 980}
976 981