OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | |
6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | |
7 #pragma once | |
8 | |
9 #include "base/android/scoped_java_ref.h" | |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "net/base/network_change_notifier.h" | |
14 | |
15 namespace net { | |
16 namespace android { | |
17 | |
18 class NetworkChangeNotifier : public net::NetworkChangeNotifier { | |
19 public: | |
20 NetworkChangeNotifier(); | |
21 virtual ~NetworkChangeNotifier(); | |
22 | |
23 void NotifyObservers(JNIEnv* env, jobject obj); | |
24 | |
25 private: | |
26 void CreateJavaObject(JNIEnv* env); | |
27 | |
28 // NetworkChangeNotifier: | |
29 virtual bool IsCurrentlyOffline() const OVERRIDE; | |
30 | |
31 base::android::ScopedJavaGlobalRef<jobject> | |
32 java_network_change_notifier_android_object_; | |
Ryan Sleevi
2012/04/13 22:37:58
nit: shorten the variable name?
Certainly, "_obje
Yaron
2012/04/17 16:18:03
Done.
| |
33 | |
34 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | |
35 }; | |
36 | |
37 bool RegisterNetworkChangeNotifier(JNIEnv* env); | |
Ryan Sleevi
2012/04/13 22:37:58
Any reason to have this free floating?
Can you no
Yaron
2012/04/17 16:18:03
This style is consistent with downstream but that
| |
38 | |
39 } // namespace android | |
40 } // namespace net | |
41 | |
42 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | |
OLD | NEW |