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

Side by Side Diff: net/android/network_change_notifier_android.h

Issue 10928193: Add native-side unit test for Android NetworkChangeNotifier (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebasing Created 8 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/android/net_jni_registrar.cc ('k') | net/android/network_change_notifier_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 5 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
7 7
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "net/base/network_change_notifier.h" 11 #include "net/base/network_change_notifier.h"
12 12
13 namespace net { 13 namespace net {
14 namespace android {
15 14
16 class NetworkChangeNotifier : public net::NetworkChangeNotifier { 15 class NetworkChangeNotifierAndroidTest;
16
17 class NetworkChangeNotifierAndroid : public NetworkChangeNotifier {
17 public: 18 public:
18 NetworkChangeNotifier(); 19 NetworkChangeNotifierAndroid();
19 virtual ~NetworkChangeNotifier(); 20 virtual ~NetworkChangeNotifierAndroid();
20 21
21 void NotifyObservers(JNIEnv* env, jobject obj); 22 void NotifyObserversOfConnectionTypeChange(JNIEnv* env, jobject obj);
22 23
23 static bool Register(JNIEnv* env); 24 static bool Register(JNIEnv* env);
24 25
25 private: 26 private:
26 void CreateJavaObject(JNIEnv* env); 27 friend class NetworkChangeNotifierAndroidTest;
27 28
28 // NetworkChangeNotifier: 29 // NetworkChangeNotifier:
29 virtual net::NetworkChangeNotifier::ConnectionType 30 virtual NetworkChangeNotifier::ConnectionType
30 GetCurrentConnectionType() const OVERRIDE; 31 GetCurrentConnectionType() const OVERRIDE;
31 32
33 void ForceConnectivityState(bool state);
34
32 base::android::ScopedJavaGlobalRef<jobject> java_network_change_notifier_; 35 base::android::ScopedJavaGlobalRef<jobject> java_network_change_notifier_;
33 36
34 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); 37 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid);
35 }; 38 };
36 39
37 } // namespace android
38 } // namespace net 40 } // namespace net
39 41
40 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 42 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
OLDNEW
« no previous file with comments | « net/android/net_jni_registrar.cc ('k') | net/android/network_change_notifier_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698