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.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Transitions {OFFLINE, PORTAL} -> ONLINE and connections to | 88 // Transitions {OFFLINE, PORTAL} -> ONLINE and connections to |
89 // different network are processed without delay. | 89 // different network are processed without delay. |
90 // Transitions {OFFLINE, ONLINE} -> PORTAL in the same network are | 90 // Transitions {OFFLINE, ONLINE} -> PORTAL in the same network are |
91 // also processed without delay. | 91 // also processed without delay. |
92 UpdateStateAndNotify(); | 92 UpdateStateAndNotify(); |
93 } else { | 93 } else { |
94 check_state_.Cancel(); | 94 check_state_.Cancel(); |
95 check_state_.Reset( | 95 check_state_.Reset( |
96 base::Bind(&NetworkStateInformer::UpdateStateAndNotify, | 96 base::Bind(&NetworkStateInformer::UpdateStateAndNotify, |
97 base::Unretained(this))); | 97 base::Unretained(this))); |
98 MessageLoop::current()->PostDelayedTask( | 98 base::MessageLoop::current()->PostDelayedTask( |
99 FROM_HERE, | 99 FROM_HERE, |
100 check_state_.callback(), | 100 check_state_.callback(), |
101 base::TimeDelta::FromSeconds(kNetworkStateCheckDelaySec)); | 101 base::TimeDelta::FromSeconds(kNetworkStateCheckDelaySec)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 void NetworkStateInformer::OnPortalDetectionCompleted( | 105 void NetworkStateInformer::OnPortalDetectionCompleted( |
106 const Network* network, | 106 const Network* network, |
107 const NetworkPortalDetector::CaptivePortalState& state) { | 107 const NetworkPortalDetector::CaptivePortalState& state) { |
108 if (CrosLibrary::Get() && network) { | 108 if (CrosLibrary::Get() && network) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 net::ProxyConfig proxy_config; | 218 net::ProxyConfig proxy_config; |
219 if (!ProxyConfigServiceImpl::ParseProxyConfig(network, &proxy_config)) | 219 if (!ProxyConfigServiceImpl::ParseProxyConfig(network, &proxy_config)) |
220 return false; | 220 return false; |
221 bool configured = !proxy_config.proxy_rules().empty(); | 221 bool configured = !proxy_config.proxy_rules().empty(); |
222 proxy_state_map_[network->unique_id()] = | 222 proxy_state_map_[network->unique_id()] = |
223 ProxyState(network->proxy_config(), configured); | 223 ProxyState(network->proxy_config(), configured); |
224 return configured; | 224 return configured; |
225 } | 225 } |
226 | 226 |
227 } // namespace chromeos | 227 } // namespace chromeos |
OLD | NEW |