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

Unified Diff: android_webview/browser/net/aw_network_change_notifier_factory.h

Issue 1659363003: [Android WebView] Implement support for Network Information API and enable it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove logging Created 4 years, 10 months 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: android_webview/browser/net/aw_network_change_notifier_factory.h
diff --git a/android_webview/browser/net/aw_network_change_notifier_factory.h b/android_webview/browser/net/aw_network_change_notifier_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..6cfbd2023fd89d7c649f1f90418eeeff3f231192
--- /dev/null
+++ b/android_webview/browser/net/aw_network_change_notifier_factory.h
@@ -0,0 +1,41 @@
+// 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 ANDROID_WEBVIEW_NET_AW_NETWORK_CHANGE_NOTIFIER_FACTORY_H_
+#define ANDROID_WEBVIEW_NET_AW_NETWORK_CHANGE_NOTIFIER_FACTORY_H_
+
+#include "net/android/network_change_notifier_delegate_android.h"
+#include "net/base/network_change_notifier_factory.h"
+
+namespace net {
+class NetworkChangeNotifier;
+class NetworkChangeNotifierDelegateAndroid;
+}
+
+namespace android_webview {
+
+// AwNetworkChangeNotifierFactory creates WebView-specific specialization of
+// NetworkChangeNotifier. See aw_network_change_notifier.h for more details.
+class AwNetworkChangeNotifierFactory :
+ public net::NetworkChangeNotifierFactory {
+ public:
+ // Must be called on the JNI thread.
+ AwNetworkChangeNotifierFactory();
+
+ // Must be called on the JNI thread.
+ ~AwNetworkChangeNotifierFactory() override;
+
+ // NetworkChangeNotifierFactory:
+ net::NetworkChangeNotifier* CreateInstance() override;
+
+ private:
+ // Delegate passed to the instances created by this class.
+ net::NetworkChangeNotifierDelegateAndroid delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(AwNetworkChangeNotifierFactory);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_NET_AW_NETWORK_CHANGE_NOTIFIER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698