OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "components/offline_pages/background/connection_notifier.h" | 5 #include "components/offline_pages/core/background/connection_notifier.h" |
6 | 6 |
7 namespace offline_pages { | 7 namespace offline_pages { |
8 | 8 |
9 ConnectionNotifier::ConnectionNotifier( | 9 ConnectionNotifier::ConnectionNotifier( |
10 const ConnectionNotifier::ConnectedCallback& callback) | 10 const ConnectionNotifier::ConnectedCallback& callback) |
11 : callback_(callback) { | 11 : callback_(callback) { |
12 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 12 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
13 } | 13 } |
14 | 14 |
15 ConnectionNotifier::~ConnectionNotifier() { | 15 ConnectionNotifier::~ConnectionNotifier() { |
16 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 16 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
17 } | 17 } |
18 | 18 |
19 void ConnectionNotifier::OnConnectionTypeChanged( | 19 void ConnectionNotifier::OnConnectionTypeChanged( |
20 net::NetworkChangeNotifier::ConnectionType type) { | 20 net::NetworkChangeNotifier::ConnectionType type) { |
21 if (type != net::NetworkChangeNotifier::ConnectionType::CONNECTION_NONE) | 21 if (type != net::NetworkChangeNotifier::ConnectionType::CONNECTION_NONE) |
22 callback_.Run(); | 22 callback_.Run(); |
23 } | 23 } |
24 | 24 |
25 } // namespace offline_pages | 25 } // namespace offline_pages |
OLD | NEW |