| 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/chromeos/net/network_change_notifier_chromeos.h" | 5 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 NetworkChangeNotifierChromeos* self) { | 224 NetworkChangeNotifierChromeos* self) { |
| 225 chromeos::NetworkLibrary* net = | 225 chromeos::NetworkLibrary* net = |
| 226 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 226 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
| 227 self->UpdateNetworkState(net); | 227 self->UpdateNetworkState(net); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // static | 230 // static |
| 231 net::NetworkChangeNotifier::ConnectionType | 231 net::NetworkChangeNotifier::ConnectionType |
| 232 NetworkChangeNotifierChromeos::GetNetworkConnectionType( | 232 NetworkChangeNotifierChromeos::GetNetworkConnectionType( |
| 233 const chromeos::Network* network) { | 233 const chromeos::Network* network) { |
| 234 if (!network) | 234 if (!network || !IsOnline(network->connection_state())) |
| 235 return net::NetworkChangeNotifier::CONNECTION_NONE; | 235 return net::NetworkChangeNotifier::CONNECTION_NONE; |
| 236 | 236 |
| 237 switch (network->type()) { | 237 switch (network->type()) { |
| 238 case chromeos::TYPE_ETHERNET: | 238 case chromeos::TYPE_ETHERNET: |
| 239 return CONNECTION_ETHERNET; | 239 return CONNECTION_ETHERNET; |
| 240 case chromeos::TYPE_WIFI: | 240 case chromeos::TYPE_WIFI: |
| 241 return CONNECTION_WIFI; | 241 return CONNECTION_WIFI; |
| 242 case chromeos::TYPE_WIMAX: | 242 case chromeos::TYPE_WIMAX: |
| 243 return CONNECTION_4G; | 243 return CONNECTION_4G; |
| 244 case chromeos::TYPE_CELLULAR: | 244 case chromeos::TYPE_CELLULAR: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 261 } | 261 } |
| 262 case chromeos::TYPE_BLUETOOTH: | 262 case chromeos::TYPE_BLUETOOTH: |
| 263 case chromeos::TYPE_VPN: | 263 case chromeos::TYPE_VPN: |
| 264 case chromeos::TYPE_UNKNOWN: | 264 case chromeos::TYPE_UNKNOWN: |
| 265 break; | 265 break; |
| 266 } | 266 } |
| 267 return net::NetworkChangeNotifier::CONNECTION_UNKNOWN; | 267 return net::NetworkChangeNotifier::CONNECTION_UNKNOWN; |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace chromeos | 270 } // namespace chromeos |
| OLD | NEW |