| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 static const int kUseExtensionButtonIndex; | 50 static const int kUseExtensionButtonIndex; |
| 51 static const int kOpenPortalButtonIndex; | 51 static const int kOpenPortalButtonIndex; |
| 52 | 52 |
| 53 static const char kNotificationId[]; | 53 static const char kNotificationId[]; |
| 54 | 54 |
| 55 static const char kNotificationMetric[]; | 55 static const char kNotificationMetric[]; |
| 56 static const char kUserActionMetric[]; | 56 static const char kUserActionMetric[]; |
| 57 | 57 |
| 58 explicit NetworkPortalNotificationController( | 58 explicit NetworkPortalNotificationController( |
| 59 NetworkPortalDetector* network_portal_dectector); | 59 NetworkPortalDetectorInterface* network_portal_dectector); |
| 60 ~NetworkPortalNotificationController() override; | 60 ~NetworkPortalNotificationController() override; |
| 61 | 61 |
| 62 // |retry_detection_callback| will be called if the controller learns about a | 62 // |retry_detection_callback| will be called if the controller learns about a |
| 63 // potential change of the captive portal (e.g. if an extension notifies about | 63 // potential change of the captive portal (e.g. if an extension notifies about |
| 64 // a finished authentication). | 64 // a finished authentication). |
| 65 // |retry_detection_callback| will not be called after this controller is | 65 // |retry_detection_callback| will not be called after this controller is |
| 66 // destroyed. | 66 // destroyed. |
| 67 void set_retry_detection_callback( | 67 void set_retry_detection_callback( |
| 68 const base::Closure& retry_detection_callback) { | 68 const base::Closure& retry_detection_callback) { |
| 69 retry_detection_callback_ = retry_detection_callback; | 69 retry_detection_callback_ = retry_detection_callback; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 // NetworkPortalDetector::Observer: | 121 // NetworkPortalDetector::Observer: |
| 122 void OnPortalDetectionCompleted( | 122 void OnPortalDetectionCompleted( |
| 123 const NetworkState* network, | 123 const NetworkState* network, |
| 124 const NetworkPortalDetector::CaptivePortalState& state) override; | 124 const NetworkPortalDetector::CaptivePortalState& state) override; |
| 125 | 125 |
| 126 // Last network path for which notification was displayed. | 126 // Last network path for which notification was displayed. |
| 127 std::string last_network_path_; | 127 std::string last_network_path_; |
| 128 | 128 |
| 129 // Backpointer to owner. | 129 // Backpointer to owner. |
| 130 NetworkPortalDetector* network_portal_detector_ = nullptr; | 130 NetworkPortalDetectorInterface* network_portal_detector_ = nullptr; |
| 131 | 131 |
| 132 // Currently displayed authorization dialog, or NULL if none. | 132 // Currently displayed authorization dialog, or NULL if none. |
| 133 NetworkPortalWebDialog* dialog_ = nullptr; | 133 NetworkPortalWebDialog* dialog_ = nullptr; |
| 134 | 134 |
| 135 // Do not close Portal Login dialog on "No network" error in browser tests. | 135 // Do not close Portal Login dialog on "No network" error in browser tests. |
| 136 bool ignore_no_network_for_testing_ = false; | 136 bool ignore_no_network_for_testing_ = false; |
| 137 | 137 |
| 138 // This is called if the controller learns about a potential change of the | 138 // This is called if the controller learns about a potential change of the |
| 139 // captive portal. | 139 // captive portal. |
| 140 base::Closure retry_detection_callback_; | 140 base::Closure retry_detection_callback_; |
| 141 | 141 |
| 142 base::WeakPtrFactory<NetworkPortalNotificationController> weak_factory_; | 142 base::WeakPtrFactory<NetworkPortalNotificationController> weak_factory_; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationController); | 144 DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationController); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace chromeos | 147 } // namespace chromeos |
| 148 | 148 |
| 149 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ | 149 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_ |
| OLD | NEW |