| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/captive_portal_view.h" | 5 #include "chrome/browser/chromeos/login/captive_portal_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 DLOG(INFO) << kCaptivePortalStartURL << " vs " << url.spec(); | 283 DLOG(INFO) << kCaptivePortalStartURL << " vs " << url.spec(); |
| 284 redirected_ = true; | 284 redirected_ = true; |
| 285 proxy_->OnRedirected(); | 285 proxy_->OnRedirected(); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 | 288 |
| 289 void CaptivePortalView::LoadingStateChanged(WebContents* source) { | 289 void CaptivePortalView::LoadingStateChanged(WebContents* source) { |
| 290 bool is_loading = source->IsLoading(); | 290 bool is_loading = source->IsLoading(); |
| 291 UpdateReload(is_loading, false); | 291 UpdateReload(is_loading, false); |
| 292 command_updater_->UpdateCommandEnabled(IDC_STOP, is_loading); | 292 command_updater_->UpdateCommandEnabled(IDC_STOP, is_loading); |
| 293 if (!is_loading && !redirected_) | 293 // TODO(nkostylev): Fix case of no connectivity, check HTTP code returned. |
| 294 proxy_->OnOriginalURLLoaded(); | 294 // Disable this heuristic as it has false positives. |
| 295 // Relying on just flimflam portal check to close dialog is fine. |
| 296 // if (!is_loading && !redirected_) |
| 297 // proxy_->OnOriginalURLLoaded(); |
| 295 } | 298 } |
| 296 | 299 |
| 297 TabContentsWrapper* CaptivePortalView::GetTabContentsWrapper() const { | 300 TabContentsWrapper* CaptivePortalView::GetTabContentsWrapper() const { |
| 298 return dom_view_->dom_contents(); | 301 return dom_view_->dom_contents(); |
| 299 } | 302 } |
| 300 | 303 |
| 301 InstantController* CaptivePortalView::GetInstant() { | 304 InstantController* CaptivePortalView::GetInstant() { |
| 302 return NULL; | 305 return NULL; |
| 303 } | 306 } |
| 304 | 307 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 421 |
| 419 void CaptivePortalView::UpdateReload(bool is_loading, bool force) { | 422 void CaptivePortalView::UpdateReload(bool is_loading, bool force) { |
| 420 if (reload_) { | 423 if (reload_) { |
| 421 reload_->ChangeMode( | 424 reload_->ChangeMode( |
| 422 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 425 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 423 force); | 426 force); |
| 424 } | 427 } |
| 425 } | 428 } |
| 426 | 429 |
| 427 } // namespace chromeos | 430 } // namespace chromeos |
| OLD | NEW |