| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "net/base/network_change_notifier.h" | |
| 10 | |
| 11 namespace offline_pages { | |
| 12 | |
| 13 class ConnectionNotifier | |
| 14 : public net::NetworkChangeNotifier::ConnectionTypeObserver { | |
| 15 public: | |
| 16 // Callback to call when we become connected. | |
| 17 typedef base::Callback<void()> ConnectedCallback; | |
| 18 | |
| 19 ConnectionNotifier(const ConnectionNotifier::ConnectedCallback& callback); | |
| 20 ~ConnectionNotifier() override; | |
| 21 | |
| 22 // net::NetworkChangeNotifier::ConnectionTypeObserver implementation. | |
| 23 void OnConnectionTypeChanged( | |
| 24 net::NetworkChangeNotifier::ConnectionType type) override; | |
| 25 | |
| 26 private: | |
| 27 base::Callback<void()> callback_; | |
| 28 | |
| 29 DISALLOW_COPY_AND_ASSIGN(ConnectionNotifier); | |
| 30 }; | |
| 31 | |
| 32 } // namespace offline_pages | |
| 33 | |
| 34 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_ | |
| OLD | NEW |