| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/native_widget_types.h" | |
| 11 #include "ui/views/widget/widget_observer.h" | 10 #include "ui/views/widget/widget_observer.h" |
| 12 | 11 |
| 13 namespace content { | 12 namespace content { |
| 14 class WebContents; | 13 class WebContents; |
| 15 } | 14 } |
| 16 | 15 |
| 17 namespace views { | 16 namespace views { |
| 18 class Widget; | 17 class Widget; |
| 19 } | 18 } |
| 20 | 19 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 protected: | 30 protected: |
| 32 virtual ~CaptivePortalWindowProxyDelegate() {} | 31 virtual ~CaptivePortalWindowProxyDelegate() {} |
| 33 }; | 32 }; |
| 34 | 33 |
| 35 // Proxy which manages showing of the window for CaptivePortal sign-in. | 34 // Proxy which manages showing of the window for CaptivePortal sign-in. |
| 36 class CaptivePortalWindowProxy : public views::WidgetObserver { | 35 class CaptivePortalWindowProxy : public views::WidgetObserver { |
| 37 public: | 36 public: |
| 38 typedef CaptivePortalWindowProxyDelegate Delegate; | 37 typedef CaptivePortalWindowProxyDelegate Delegate; |
| 39 | 38 |
| 40 CaptivePortalWindowProxy(Delegate* delegate, | 39 CaptivePortalWindowProxy(Delegate* delegate, |
| 41 gfx::NativeWindow parent, | |
| 42 content::WebContents* web_contents); | 40 content::WebContents* web_contents); |
| 43 virtual ~CaptivePortalWindowProxy(); | 41 virtual ~CaptivePortalWindowProxy(); |
| 44 | 42 |
| 45 // Shows captive portal window only after a redirection has happened. So it is | 43 // Shows captive portal window only after a redirection has happened. So it is |
| 46 // safe to call this method, when the caller isn't 100% sure that the network | 44 // safe to call this method, when the caller isn't 100% sure that the network |
| 47 // is in the captive portal state. | 45 // is in the captive portal state. |
| 48 // Subsequent call to this method would reuses existing view | 46 // Subsequent call to this method would reuses existing view |
| 49 // but reloads test page (generate_204). | 47 // but reloads test page (generate_204). |
| 50 void ShowIfRedirected(); | 48 void ShowIfRedirected(); |
| 51 | 49 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void InitCaptivePortalView(); | 89 void InitCaptivePortalView(); |
| 92 | 90 |
| 93 // Returns symbolic state name based on internal state. | 91 // Returns symbolic state name based on internal state. |
| 94 State GetState() const; | 92 State GetState() const; |
| 95 | 93 |
| 96 // Not owned by this class. | 94 // Not owned by this class. |
| 97 Delegate* delegate_; | 95 Delegate* delegate_; |
| 98 // Not owned by this class. | 96 // Not owned by this class. |
| 99 views::Widget* widget_; | 97 views::Widget* widget_; |
| 100 scoped_ptr<CaptivePortalView> captive_portal_view_; | 98 scoped_ptr<CaptivePortalView> captive_portal_view_; |
| 101 gfx::NativeWindow parent_; | |
| 102 | 99 |
| 103 // Not owned by this class. | 100 // Not owned by this class. |
| 104 content::WebContents* web_contents_; | 101 content::WebContents* web_contents_; |
| 105 | 102 |
| 106 DISALLOW_COPY_AND_ASSIGN(CaptivePortalWindowProxy); | 103 DISALLOW_COPY_AND_ASSIGN(CaptivePortalWindowProxy); |
| 107 }; | 104 }; |
| 108 | 105 |
| 109 } // namespace chromeos | 106 } // namespace chromeos |
| 110 | 107 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ | 108 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ |
| OLD | NEW |