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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class CaptivePortalWindowProxy : public views::Widget::Observer { | 33 class CaptivePortalWindowProxy : public views::Widget::Observer { |
34 public: | 34 public: |
35 typedef CaptivePortalWindowProxyDelegate Delegate; | 35 typedef CaptivePortalWindowProxyDelegate Delegate; |
36 | 36 |
37 CaptivePortalWindowProxy(Delegate* delegate, gfx::NativeWindow parent); | 37 CaptivePortalWindowProxy(Delegate* delegate, gfx::NativeWindow parent); |
38 virtual ~CaptivePortalWindowProxy(); | 38 virtual ~CaptivePortalWindowProxy(); |
39 | 39 |
40 // Shows captive portal window only after a redirection has happened. So it is | 40 // Shows captive portal window only after a redirection has happened. So it is |
41 // safe to call this method, when the caller isn't 100% sure that the network | 41 // safe to call this method, when the caller isn't 100% sure that the network |
42 // is in the captive portal state. | 42 // is in the captive portal state. |
| 43 // Subsequent call to this method would reuses existing view |
| 44 // but reloads test page (generate_204). |
43 void ShowIfRedirected(); | 45 void ShowIfRedirected(); |
44 | 46 |
| 47 // Forces captive portal window show. |
| 48 void Show(); |
| 49 |
45 // Closes the window. | 50 // Closes the window. |
46 void Close(); | 51 void Close(); |
47 | 52 |
48 // Called by CaptivePortalView when URL loading was redirected from the | 53 // Called by CaptivePortalView when URL loading was redirected from the |
49 // original URL. | 54 // original URL. |
50 void OnRedirected(); | 55 void OnRedirected(); |
51 | 56 |
52 // Called by CaptivePortalView when origin URL is loaded without any | 57 // Called by CaptivePortalView when origin URL is loaded without any |
53 // redirections. | 58 // redirections. |
54 void OnOriginalURLLoaded(); | 59 void OnOriginalURLLoaded(); |
55 | 60 |
56 // views::Widget::Observer implementation: | 61 // views::Widget::Observer implementation: |
57 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 62 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
58 | 63 |
59 private: | 64 private: |
60 Delegate* delegate_; | 65 Delegate* delegate_; |
61 views::Widget* widget_; | 66 views::Widget* widget_; |
62 scoped_ptr<CaptivePortalView> captive_portal_view_; | 67 scoped_ptr<CaptivePortalView> captive_portal_view_; |
63 gfx::NativeWindow parent_; | 68 gfx::NativeWindow parent_; |
64 | 69 |
65 DISALLOW_COPY_AND_ASSIGN(CaptivePortalWindowProxy); | 70 DISALLOW_COPY_AND_ASSIGN(CaptivePortalWindowProxy); |
66 }; | 71 }; |
67 | 72 |
68 } // namespace chromeos | 73 } // namespace chromeos |
69 | 74 |
70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_CAPTIVE_PORTAL_WINDOW_PROXY_H_ |
OLD | NEW |