Chromium Code Reviews| Index: components/offline_pages/background/connection_notifier.h |
| diff --git a/components/offline_pages/background/connection_notifier.h b/components/offline_pages/background/connection_notifier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..847de44905231b5d4d276f8c35d1d54945c240ad |
| --- /dev/null |
| +++ b/components/offline_pages/background/connection_notifier.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ |
|
Pete Williamson
2016/12/01 01:34:08
I think I recall you saying something about NQE al
dougarnett
2016/12/01 19:25:22
I think there is no difference for what this class
|
| +#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "net/base/network_change_notifier.h" |
| + |
| +namespace offline_pages { |
| + |
| +class ConnectionNotifier |
| + : public net::NetworkChangeNotifier::ConnectionTypeObserver { |
| + public: |
| + // Callback to call when we become connected. |
| + typedef base::Callback<void()> ConnectedCallback; |
| + |
| + ConnectionNotifier(const ConnectionNotifier::ConnectedCallback& callback); |
| + ~ConnectionNotifier() override; |
| + |
| + private: |
| + // net::NetworkChangeNotifier::ConnectionTypeObserver implementation. |
| + void OnConnectionTypeChanged( |
| + net::NetworkChangeNotifier::ConnectionType type) override; |
| + |
| + base::Callback<void()> callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ConnectionNotifier); |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ |