Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: chrome/browser/chromeos/login/captive_portal_window_proxy.cc

Issue 9861015: [cros] Captive portal dialog fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/captive_portal_window_proxy.cc
diff --git a/chrome/browser/chromeos/login/captive_portal_window_proxy.cc b/chrome/browser/chromeos/login/captive_portal_window_proxy.cc
index 1a1239f54d74bfb16ffe4ce5fd0e69684610b7a8..09735ca69fd76d58d73992a1ebb1a17272132f08 100644
--- a/chrome/browser/chromeos/login/captive_portal_window_proxy.cc
+++ b/chrome/browser/chromeos/login/captive_portal_window_proxy.cc
@@ -31,24 +31,25 @@ CaptivePortalWindowProxy::~CaptivePortalWindowProxy() {
}
void CaptivePortalWindowProxy::ShowIfRedirected() {
+ // Dialog is already shown, no need to reload.
+ if (widget_ && !captive_portal_view_.get())
+ return;
+
+ // Dialog is not initialized yet.
+ // Create view.
if (!widget_ && !captive_portal_view_.get()) {
captive_portal_view_.reset(
new CaptivePortalView(ProfileManager::GetDefaultProfile(), this));
- captive_portal_view_->StartLoad();
}
-}
-void CaptivePortalWindowProxy::Close() {
- if (widget_) {
- widget_->Close();
- } else {
- captive_portal_view_.reset();
- }
+ // Dialog has been already initialized (this call or previously),
+ // force reload.
+ captive_portal_view_->StartLoad();
}
-void CaptivePortalWindowProxy::OnRedirected() {
+void CaptivePortalWindowProxy::Show() {
if (!captive_portal_view_.get() || widget_) {
- NOTREACHED();
+ // Dialog already shown, do nothing.
return;
}
CaptivePortalView* captive_portal_view = captive_portal_view_.release();
@@ -63,6 +64,18 @@ void CaptivePortalWindowProxy::OnRedirected() {
widget_->AddObserver(this);
widget_->Show();
+}
+
+void CaptivePortalWindowProxy::Close() {
+ if (widget_) {
+ widget_->Close();
+ } else {
+ captive_portal_view_.reset();
+ }
+}
+
+void CaptivePortalWindowProxy::OnRedirected() {
+ Show();
delegate_->OnPortalDetected();
}

Powered by Google App Engine
This is Rietveld 408576698