OLD | NEW |
---|---|
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 { | 14 namespace android { |
15 | 15 |
16 class NetworkChangeNotifier : public net::NetworkChangeNotifier { | 16 class NetworkChangeNotifier : public net::NetworkChangeNotifier { |
szym
2012/09/14 19:07:29
Hmm, I'm not sure that using namespace android and
gone
2012/09/15 01:01:55
Moved it over for this CL; it'll likely land after
| |
17 public: | 17 public: |
18 NetworkChangeNotifier(); | 18 NetworkChangeNotifier(); |
19 virtual ~NetworkChangeNotifier(); | 19 virtual ~NetworkChangeNotifier(); |
20 | 20 |
21 void NotifyObservers(JNIEnv* env, jobject obj); | 21 void NotifyObserversOfConnectionTypeChange(JNIEnv* env, jobject obj); |
22 | |
23 void ForceConnectivityState(bool state); | |
szym
2012/09/14 19:07:29
What is this for? If this is for tests only, at le
gone
2012/09/15 01:01:55
Done.
| |
22 | 24 |
23 static bool Register(JNIEnv* env); | 25 static bool Register(JNIEnv* env); |
24 | 26 |
25 private: | 27 private: |
26 void CreateJavaObject(JNIEnv* env); | |
27 | |
28 // NetworkChangeNotifier: | 28 // NetworkChangeNotifier: |
szym
2012/09/14 19:07:29
since you're already here, make it "net::NetworkCh
gone
2012/09/15 01:01:55
Appended the Android suffix.
| |
29 virtual net::NetworkChangeNotifier::ConnectionType | 29 virtual net::NetworkChangeNotifier::ConnectionType |
30 GetCurrentConnectionType() const OVERRIDE; | 30 GetCurrentConnectionType() const OVERRIDE; |
31 | 31 |
32 base::android::ScopedJavaGlobalRef<jobject> java_network_change_notifier_; | 32 base::android::ScopedJavaGlobalRef<jobject> java_network_change_notifier_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 34 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace android | 37 } // namespace android |
38 } // namespace net | 38 } // namespace net |
39 | 39 |
40 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 40 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |