| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ | 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_helper.h" | 11 #include "base/android/jni_helper.h" |
| 10 #include "sync/notifier/invalidation_util.h" | 12 #include "sync/notifier/invalidation_util.h" |
| 11 | 13 |
| 12 namespace invalidation { | 14 namespace invalidation { |
| 13 | 15 |
| 14 // Controls invalidation registration on Android. This class is a wrapper for | 16 // Controls invalidation registration on Android. This class is a wrapper for |
| 15 // the Java class org.chromium.sync.notifier.InvalidationController. | 17 // the Java class org.chromium.sync.notifier.InvalidationController. |
| 16 class InvalidationControllerAndroid { | 18 class InvalidationControllerAndroid { |
| 17 public: | 19 public: |
| 18 InvalidationControllerAndroid(); | 20 InvalidationControllerAndroid(); |
| 19 virtual ~InvalidationControllerAndroid(); | 21 virtual ~InvalidationControllerAndroid(); |
| 20 | 22 |
| 21 // Sets object ids for which the invalidation client should register for | 23 // Sets object ids for which the invalidation client should register for |
| 22 // notification. | 24 // notification. |
| 23 virtual void SetRegisteredObjectIds(const syncer::ObjectIdSet& ids); | 25 virtual void SetRegisteredObjectIds(const syncer::ObjectIdSet& ids); |
| 24 | 26 |
| 27 // Asks the Java code to return the client ID it chose to use. |
| 28 std::string GetInvalidatorClientId(); |
| 29 |
| 25 private: | 30 private: |
| 26 // The Java invalidation controller. | 31 // The Java invalidation controller. |
| 27 base::android::ScopedJavaGlobalRef<jobject> invalidation_controller_; | 32 base::android::ScopedJavaGlobalRef<jobject> invalidation_controller_; |
| 28 | 33 |
| 29 DISALLOW_COPY_AND_ASSIGN(InvalidationControllerAndroid); | 34 DISALLOW_COPY_AND_ASSIGN(InvalidationControllerAndroid); |
| 30 }; | 35 }; |
| 31 | 36 |
| 32 bool RegisterInvalidationController(JNIEnv* env); | 37 bool RegisterInvalidationController(JNIEnv* env); |
| 33 | 38 |
| 34 } // namespace invalidation | 39 } // namespace invalidation |
| 35 | 40 |
| 36 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ | 41 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_ |
| OLD | NEW |