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

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

Issue 163413002: Added browser test for Captive Portal window ctor and dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to CaptivePortalWindowProxy. Created 6 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/login/captive_portal_window_proxy.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5e547a2d5fa7669a6e6e4ac2ad508d28490c11e8..c09f288c3aaea86dadf7d8279647d978ab80b376 100644
--- a/chrome/browser/chromeos/login/captive_portal_window_proxy.cc
+++ b/chrome/browser/chromeos/login/captive_portal_window_proxy.cc
@@ -90,12 +90,19 @@ void CaptivePortalWindowProxy::OnWidgetClosing(views::Widget* widget) {
DCHECK(GetState() == STATE_DISPLAYED);
DCHECK(widget == widget_);
- widget->RemoveObserver(this);
- widget_ = NULL;
+ DetachFromWidget(widget);
DCHECK(GetState() == STATE_IDLE);
}
+void CaptivePortalWindowProxy::OnWidgetDestroying(views::Widget* widget) {
+ DetachFromWidget(widget);
+}
+
+void CaptivePortalWindowProxy::OnWidgetDestroyed(views::Widget* widget) {
+ DetachFromWidget(widget);
+}
+
void CaptivePortalWindowProxy::InitCaptivePortalView() {
DCHECK(GetState() == STATE_IDLE ||
GetState() == STATE_WAITING_FOR_REDIRECTION);
@@ -121,4 +128,11 @@ CaptivePortalWindowProxy::State CaptivePortalWindowProxy::GetState() const {
return STATE_UNKNOWN;
}
+void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) {
+ if (!widget_ || widget_ != widget)
+ return;
+ widget_->RemoveObserver(this);
+ widget_ = NULL;
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/captive_portal_window_proxy.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698