OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "net/base/network_change_notifier_factory.h" | 6 #include "net/base/network_change_notifier_factory.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include "net/base/network_change_notifier_win.h" | 9 #include "net/base/network_change_notifier_win.h" |
10 #elif defined(OS_LINUX) || defined(OS_ANDROID) | 10 #elif defined(OS_LINUX) || defined(OS_ANDROID) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
54 NetworkChangeNotifierWin* network_change_notifier = | 54 NetworkChangeNotifierWin* network_change_notifier = |
55 new NetworkChangeNotifierWin(); | 55 new NetworkChangeNotifierWin(); |
56 network_change_notifier->WatchForAddressChange(); | 56 network_change_notifier->WatchForAddressChange(); |
57 return network_change_notifier; | 57 return network_change_notifier; |
58 #elif defined(OS_CHROMEOS) | 58 #elif defined(OS_CHROMEOS) |
59 // ChromeOS builds MUST use its own class factory. | 59 // ChromeOS builds MUST use its own class factory. |
60 CHECK(false); | 60 CHECK(false); |
61 return NULL; | 61 return NULL; |
62 #elif defined(OS_LINUX) || defined(OS_ANDROID) | 62 #elif defined(OS_LINUX) || defined(OS_ANDROID) |
63 return new NetworkChangeNotifierLinux(); | 63 return NetworkChangeNotifierLinux::Create(); |
64 #elif defined(OS_MACOSX) | 64 #elif defined(OS_MACOSX) |
65 return new NetworkChangeNotifierMac(); | 65 return new NetworkChangeNotifierMac(); |
66 #else | 66 #else |
67 NOTIMPLEMENTED(); | 67 NOTIMPLEMENTED(); |
68 return NULL; | 68 return NULL; |
69 #endif | 69 #endif |
70 } | 70 } |
71 | 71 |
72 // static | 72 // static |
73 bool NetworkChangeNotifier::IsOffline() { | 73 bool NetworkChangeNotifier::IsOffline() { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 DCHECK(g_network_change_notifier); | 163 DCHECK(g_network_change_notifier); |
164 g_network_change_notifier = NULL; | 164 g_network_change_notifier = NULL; |
165 } | 165 } |
166 | 166 |
167 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 167 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
168 DCHECK(!g_network_change_notifier); | 168 DCHECK(!g_network_change_notifier); |
169 g_network_change_notifier = network_change_notifier_; | 169 g_network_change_notifier = network_change_notifier_; |
170 } | 170 } |
171 | 171 |
172 } // namespace net | 172 } // namespace net |
OLD | NEW |