Index: chrome/browser/chromeos/net/network_portal_detector_impl.h |
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.h b/chrome/browser/chromeos/net/network_portal_detector_impl.h |
index cd511b83ffb03ddf1dbd96939b05ef471f5569be..9dc9a68454e38f89a36c81c2cd5da815a0e00c73 100644 |
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.h |
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.h |
@@ -18,8 +18,8 @@ |
#include "base/threading/non_thread_safe.h" |
#include "base/time.h" |
#include "chrome/browser/captive_portal/captive_portal_detector.h" |
-#include "chrome/browser/chromeos/cros/network_library.h" |
#include "chrome/browser/chromeos/net/network_portal_detector.h" |
+#include "chromeos/network/network_state_handler_observer.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
#include "googleurl/src/gurl.h" |
@@ -31,14 +31,15 @@ class URLRequestContextGetter; |
namespace chromeos { |
+class NetworkState; |
+ |
// This class handles all notifications about network changes from |
-// NetworkLibrary and delegates portal detection for the active |
+// NetworkLibrary and delegates portal detection for the default |
// network to CaptivePortalService. |
class NetworkPortalDetectorImpl |
: public NetworkPortalDetector, |
public base::NonThreadSafe, |
- public chromeos::NetworkLibrary::NetworkManagerObserver, |
- public chromeos::NetworkLibrary::NetworkObserver, |
+ public chromeos::NetworkStateHandlerObserver, |
public content::NotificationObserver { |
public: |
explicit NetworkPortalDetectorImpl( |
@@ -52,18 +53,15 @@ class NetworkPortalDetectorImpl |
virtual void AddAndFireObserver(Observer* observer) OVERRIDE; |
virtual void RemoveObserver(Observer* observer) OVERRIDE; |
virtual CaptivePortalState GetCaptivePortalState( |
- const chromeos::Network* network) OVERRIDE; |
+ const chromeos::NetworkState* network) OVERRIDE; |
virtual bool IsEnabled() OVERRIDE; |
virtual void Enable(bool start_detection) OVERRIDE; |
virtual void EnableLazyDetection() OVERRIDE; |
virtual void DisableLazyDetection() OVERRIDE; |
- // NetworkLibrary::NetworkManagerObserver implementation: |
- virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* cros) OVERRIDE; |
- |
- // NetworkLibrary::NetworkObserver implementation: |
- virtual void OnNetworkChanged(chromeos::NetworkLibrary* cros, |
- const chromeos::Network* network) OVERRIDE; |
+ // NetworkStateHandlerObserver implementation: |
+ virtual void NetworkManagerChanged() OVERRIDE; |
+ virtual void DefaultNetworkChanged(const NetworkState* network) OVERRIDE; |
private: |
friend class NetworkPortalDetectorImplTest; |
@@ -111,11 +109,11 @@ class NetworkPortalDetectorImpl |
bool IsCheckingForPortal() const; |
// Stores captive portal state for a |network|. |
- void SetCaptivePortalState(const Network* network, |
+ void SetCaptivePortalState(const NetworkState* network, |
const CaptivePortalState& results); |
// Notifies observers that portal detection is completed for a |network|. |
- void NotifyPortalDetectionCompleted(const Network* network, |
+ void NotifyPortalDetectionCompleted(const NetworkState* network, |
const CaptivePortalState& state); |
// Returns the current TimeTicks. |
@@ -163,14 +161,13 @@ class NetworkPortalDetectorImpl |
// cancelled. |
bool DetectionTimeoutIsCancelledForTesting() const; |
- // Unique identifier of the active network. |
- std::string active_network_id_; |
+ // Unique identifier of the default network. |
+ std::string default_network_id_; |
- // Service path of the active network. |
- std::string active_service_path_; |
+ // Service path of the default network. |
+ std::string default_service_path_; |
- // Connection state of the active network. |
- ConnectionState active_connection_state_; |
+ std::string default_connection_state_; |
ygorshenin1
2013/05/06 09:14:39
Please, add comment to the |connection_state_|.
gauravsh
2013/05/07 23:38:10
Done.
|
State state_; |
CaptivePortalStateMap portal_state_map_; |
@@ -182,7 +179,7 @@ class NetworkPortalDetectorImpl |
// URL that returns a 204 response code when connected to the Internet. |
GURL test_url_; |
- // Detector for checking active network for a portal state. |
+ // Detector for checking default network for a portal state. |
scoped_ptr<captive_portal::CaptivePortalDetector> captive_portal_detector_; |
// True if the NetworkPortalDetector is enabled. |
@@ -190,7 +187,7 @@ class NetworkPortalDetectorImpl |
base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_ptr_factory_; |
- // Number of portal detection attemps for an active network. |
+ // Number of portal detection attemps for an default network. |
ygorshenin1
2013/05/06 09:14:39
s/an/a
gauravsh
2013/05/07 23:38:10
Done.
|
int attempt_count_; |
// True if lazy detection is enabled. |
@@ -201,7 +198,7 @@ class NetworkPortalDetectorImpl |
base::TimeDelta lazy_check_interval_; |
// Minimum time between consecutive portal checks for the same |
- // active network. |
+ // default network. |
base::TimeDelta min_time_between_attempts_; |
// Start time of portal detection. |