aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatertos.cpp')
-rw-r--r--linden/indra/newview/llfloatertos.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp
index 52d7b1f..8d88601 100644
--- a/linden/indra/newview/llfloatertos.cpp
+++ b/linden/indra/newview/llfloatertos.cpp
@@ -163,12 +163,10 @@ BOOL LLFloaterTOS::postBuild()
163 LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); 163 LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
164 editor->setVisible(FALSE); 164 editor->setVisible(FALSE);
165 165
166 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 166 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
167 if ( web_browser ) 167 if ( web_browser )
168 { 168 {
169 // start to observe it so we see navigate complete events 169 web_browser->addObserver(this);
170 web_browser->addObserver( this );
171
172 gResponsePtr = LLIamHereTOS::build( this ); 170 gResponsePtr = LLIamHereTOS::build( this );
173 LLHTTPClient::head( getString( "real_url" ), gResponsePtr ); 171 LLHTTPClient::head( getString( "real_url" ), gResponsePtr );
174 } 172 }
@@ -181,7 +179,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
181 // only do this for TOS pages 179 // only do this for TOS pages
182 if ( mType == TOS_TOS ) 180 if ( mType == TOS_TOS )
183 { 181 {
184 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 182 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
185 // if the contents of the site was retrieved 183 // if the contents of the site was retrieved
186 if ( alive ) 184 if ( alive )
187 { 185 {
@@ -203,12 +201,6 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
203 201
204LLFloaterTOS::~LLFloaterTOS() 202LLFloaterTOS::~LLFloaterTOS()
205{ 203{
206 // stop obsaerving events
207 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
208 if ( web_browser )
209 {
210 web_browser->remObserver( this );
211 };
212 204
213 // tell the responder we're not here anymore 205 // tell the responder we're not here anymore
214 if ( gResponsePtr ) 206 if ( gResponsePtr )
@@ -271,8 +263,10 @@ void LLFloaterTOS::onCancel( void* userdata )
271} 263}
272 264
273//virtual 265//virtual
274void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) 266void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
275{ 267{
268 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
269 {
276 // skip past the loading screen navigate complete 270 // skip past the loading screen navigate complete
277 if ( ++mLoadCompleteCount == 2 ) 271 if ( ++mLoadCompleteCount == 2 )
278 { 272 {
@@ -280,5 +274,6 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn )
280 // enable Agree to TOS radio button now that page has loaded 274 // enable Agree to TOS radio button now that page has loaded
281 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 275 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
282 tos_agreement->setEnabled( true ); 276 tos_agreement->setEnabled( true );
283 }; 277 }
278 }
284} 279}