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 3// found in the LICENSE file. 4 5#ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ 6#define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ 7#pragma once 8 9#include "base/basictypes.h" 10#include "base/memory/scoped_ptr.h" 11#include "net/base/network_change_notifier.h" 12 13namespace net { 14 15class NetworkChangeNotifierLinux : public NetworkChangeNotifier { 16 public: 17 NetworkChangeNotifierLinux(); 18 19 private: 20 class Thread; 21 22 virtual ~NetworkChangeNotifierLinux(); 23 24 // NetworkChangeNotifier: 25 virtual bool IsCurrentlyOffline() const; 26 27 // The thread used to listen for notifications. This relays the notification 28 // to the registered observers without posting back to the thread the object 29 // was created on. 30 scoped_ptr<Thread> notifier_thread_; 31 32 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); 33}; 34 35} // namespace net 36 37#endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ 38