Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: components/offline_pages/background/connection_notifier.h

Issue 2556613003: [OfflinePages] Restarts immediate processing if stopped due to no net (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3e3535ab2b0aef4c2c8b0b07d19f4b3921df6e90
--- /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_
+#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;
+
+ // net::NetworkChangeNotifier::ConnectionTypeObserver implementation.
+ void OnConnectionTypeChanged(
+ net::NetworkChangeNotifier::ConnectionType type) override;
+
+ private:
+ base::Callback<void()> callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectionNotifier);
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_CONNECTION_NOTIFIER_H_
« no previous file with comments | « components/offline_pages/background/BUILD.gn ('k') | components/offline_pages/background/connection_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698