Chromium Code Reviews| 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 "net/base/network_change_notifier.h" | 5 #include "net/base/network_change_notifier.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 #elif defined(OS_LINUX) | 519 #elif defined(OS_LINUX) |
| 520 return NetworkChangeNotifierLinux::Create(); | 520 return NetworkChangeNotifierLinux::Create(); |
| 521 #elif defined(OS_MACOSX) | 521 #elif defined(OS_MACOSX) |
| 522 return new NetworkChangeNotifierMac(); | 522 return new NetworkChangeNotifierMac(); |
| 523 #else | 523 #else |
| 524 NOTIMPLEMENTED(); | 524 NOTIMPLEMENTED(); |
| 525 return NULL; | 525 return NULL; |
| 526 #endif | 526 #endif |
| 527 } | 527 } |
| 528 | 528 |
| 529 bool NetworkChangeNotifier::GetCurrentWifiAccessPointInfo( | |
| 530 NetworkChangeNotifier::WifiAccessPointInfo *info) { | |
|
Ilya Sherman
2014/07/11 01:32:17
nit: Swap space and asterisk.
zqiu1
2014/07/14 17:21:58
Done.
| |
| 531 return false; | |
| 532 } | |
| 533 | |
| 529 // static | 534 // static |
| 530 NetworkChangeNotifier::ConnectionType | 535 NetworkChangeNotifier::ConnectionType |
| 531 NetworkChangeNotifier::GetConnectionType() { | 536 NetworkChangeNotifier::GetConnectionType() { |
| 532 return g_network_change_notifier ? | 537 return g_network_change_notifier ? |
| 533 g_network_change_notifier->GetCurrentConnectionType() : | 538 g_network_change_notifier->GetCurrentConnectionType() : |
| 534 CONNECTION_UNKNOWN; | 539 CONNECTION_UNKNOWN; |
| 535 } | 540 } |
| 536 | 541 |
| 537 // static | 542 // static |
| 543 bool NetworkChangeNotifier::GetWifiAccessPointInfo(WifiAccessPointInfo *info) { | |
|
Ilya Sherman
2014/07/11 01:32:18
nit: Swap space and asterisk.
zqiu1
2014/07/14 17:21:58
Done.
| |
| 544 return g_network_change_notifier ? | |
| 545 g_network_change_notifier->GetCurrentWifiAccessPointInfo(info) : | |
| 546 false; | |
| 547 } | |
| 548 | |
| 549 // static | |
| 538 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { | 550 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { |
| 539 if (!g_network_change_notifier) { | 551 if (!g_network_change_notifier) { |
| 540 *config = DnsConfig(); | 552 *config = DnsConfig(); |
| 541 } else { | 553 } else { |
| 542 g_network_change_notifier->network_state_->GetDnsConfig(config); | 554 g_network_change_notifier->network_state_->GetDnsConfig(config); |
| 543 } | 555 } |
| 544 } | 556 } |
| 545 | 557 |
| 546 // static | 558 // static |
| 547 const char* NetworkChangeNotifier::ConnectionTypeToString( | 559 const char* NetworkChangeNotifier::ConnectionTypeToString( |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 DCHECK(g_network_change_notifier); | 838 DCHECK(g_network_change_notifier); |
| 827 g_network_change_notifier = NULL; | 839 g_network_change_notifier = NULL; |
| 828 } | 840 } |
| 829 | 841 |
| 830 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 842 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
| 831 DCHECK(!g_network_change_notifier); | 843 DCHECK(!g_network_change_notifier); |
| 832 g_network_change_notifier = network_change_notifier_; | 844 g_network_change_notifier = network_change_notifier_; |
| 833 } | 845 } |
| 834 | 846 |
| 835 } // namespace net | 847 } // namespace net |
| OLD | NEW |