| 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 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 network->connection_state() == shill::kStateOnline)) { | 63 network->connection_state() == shill::kStateOnline)) { |
| 64 return NetworkStateInformer::ONLINE; | 64 return NetworkStateInformer::ONLINE; |
| 65 } | 65 } |
| 66 if (status == | 66 if (status == |
| 67 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED && | 67 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED && |
| 68 HasDefaultNetworkProxyConfigured()) { | 68 HasDefaultNetworkProxyConfigured()) { |
| 69 return NetworkStateInformer::PROXY_AUTH_REQUIRED; | 69 return NetworkStateInformer::PROXY_AUTH_REQUIRED; |
| 70 } | 70 } |
| 71 if (status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL || | 71 if (status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL || |
| 72 (status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN && | 72 (status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN && |
| 73 network->connection_state() == shill::kStatePortal)) | 73 network->is_captive_portal())) |
| 74 return NetworkStateInformer::CAPTIVE_PORTAL; | 74 return NetworkStateInformer::CAPTIVE_PORTAL; |
| 75 } else { | 75 } else { |
| 76 if (NetworkState::StateIsConnecting(network->connection_state())) | 76 if (NetworkState::StateIsConnecting(network->connection_state())) |
| 77 return NetworkStateInformer::CONNECTING; | 77 return NetworkStateInformer::CONNECTING; |
| 78 if (network->connection_state() == shill::kStateOnline) | 78 if (network->connection_state() == shill::kStateOnline) |
| 79 return NetworkStateInformer::ONLINE; | 79 return NetworkStateInformer::ONLINE; |
| 80 if (network->connection_state() == shill::kStatePortal) | 80 if (network->is_captive_portal()) |
| 81 return NetworkStateInformer::CAPTIVE_PORTAL; | 81 return NetworkStateInformer::CAPTIVE_PORTAL; |
| 82 } | 82 } |
| 83 return NetworkStateInformer::OFFLINE; | 83 return NetworkStateInformer::OFFLINE; |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 | 87 |
| 88 NetworkStateInformer::NetworkStateInformer() | 88 NetworkStateInformer::NetworkStateInformer() |
| 89 : state_(OFFLINE), | 89 : state_(OFFLINE), |
| 90 weak_ptr_factory_(this) { | 90 weak_ptr_factory_(this) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 SendStateToObservers(ErrorScreenActor::ERROR_REASON_UPDATE); | 201 SendStateToObservers(ErrorScreenActor::ERROR_REASON_UPDATE); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void NetworkStateInformer::SendStateToObservers( | 204 void NetworkStateInformer::SendStateToObservers( |
| 205 ErrorScreenActor::ErrorReason reason) { | 205 ErrorScreenActor::ErrorReason reason) { |
| 206 FOR_EACH_OBSERVER(NetworkStateInformerObserver, observers_, | 206 FOR_EACH_OBSERVER(NetworkStateInformerObserver, observers_, |
| 207 UpdateState(reason)); | 207 UpdateState(reason)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace chromeos | 210 } // namespace chromeos |
| OLD | NEW |