Index: chrome/browser/chromeos/login/captive_portal_window_proxy.h |
diff --git a/chrome/browser/chromeos/login/captive_portal_window_proxy.h b/chrome/browser/chromeos/login/captive_portal_window_proxy.h |
index 3c183b156c9e4b16604fd1a911703a4a609aa8d5..ac62a75d32e7b348f267cb95c901e7c6da6319a7 100644 |
--- a/chrome/browser/chromeos/login/captive_portal_window_proxy.h |
+++ b/chrome/browser/chromeos/login/captive_portal_window_proxy.h |
@@ -58,9 +58,35 @@ class CaptivePortalWindowProxy : public views::WidgetObserver { |
void OnOriginalURLLoaded(); |
// Overridden from views::WidgetObserver: |
- virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
+ virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
private: |
+ friend class CaptivePortalWindowTest; |
+ |
+ // Possible transitions between states: |
+ // |
+ // wp(ShowIfRedirected(), WAITING_FOR_REDIRECTION) = IDLE |
+ // wp(Show(), DISPLAYED) = IDLE | WAITING_FOR_REDIRECTION |
+ // wp(Close(), IDLE) = WAITING_FOR_REDIRECTION | DISPLAYED |
+ // wp(OnRedirected(), DISPLAYED) = WAITING_FOR_REDIRECTION |
+ // wp(OnOriginalURLLoaded(), IDLE) = WAITING_FOR_REDIRECTION | DISPLAYED |
+ // |
+ // where wp(E, S) is a weakest precondition (initial state) such |
+ // that after execution of E the system will be surely in the state S. |
+ enum State { |
+ STATE_IDLE = 0, |
+ STATE_WAITING_FOR_REDIRECTION, |
+ STATE_DISPLAYED, |
+ STATE_UNKNOWN |
+ }; |
+ |
+ // Initializes |captive_portal_view_| if it is not initialized and |
+ // starts loading Captive Portal redirect URL. |
+ void InitCaptivePortalView(); |
+ |
+ // Returns symbolic state name based on internal state. |
+ State GetState() const; |
+ |
Delegate* delegate_; |
views::Widget* widget_; |
scoped_ptr<CaptivePortalView> captive_portal_view_; |