| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ |
| 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/object_watcher.h" | 12 #include "base/win/object_watcher.h" |
| 13 #include "net/base/network_change_notifier.h" | 13 #include "net/base/network_change_notifier.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class NetworkChangeNotifierWin : public NetworkChangeNotifier, | 17 class NetworkChangeNotifierWin : public NetworkChangeNotifier, |
| 18 public base::ObjectWatcher::Delegate { | 18 public base::win::ObjectWatcher::Delegate { |
| 19 public: | 19 public: |
| 20 NetworkChangeNotifierWin(); | 20 NetworkChangeNotifierWin(); |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 virtual ~NetworkChangeNotifierWin(); | 23 virtual ~NetworkChangeNotifierWin(); |
| 24 | 24 |
| 25 // NetworkChangeNotifier methods: | 25 // NetworkChangeNotifier methods: |
| 26 virtual bool IsCurrentlyOffline() const; | 26 virtual bool IsCurrentlyOffline() const; |
| 27 | 27 |
| 28 // ObjectWatcher::Delegate methods: | 28 // ObjectWatcher::Delegate methods: |
| 29 virtual void OnObjectSignaled(HANDLE object); | 29 virtual void OnObjectSignaled(HANDLE object); |
| 30 | 30 |
| 31 // Begins listening for a single subsequent address change. | 31 // Begins listening for a single subsequent address change. |
| 32 void WatchForAddressChange(); | 32 void WatchForAddressChange(); |
| 33 | 33 |
| 34 base::ObjectWatcher addr_watcher_; | 34 base::win::ObjectWatcher addr_watcher_; |
| 35 OVERLAPPED addr_overlapped_; | 35 OVERLAPPED addr_overlapped_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); | 37 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace net | 40 } // namespace net |
| 41 | 41 |
| 42 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ | 42 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ |
| OLD | NEW |