[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / invalidation / invalidation_controller_android.h
blob03b29f93e0ec5b9462cd2693de054dbb1ddaa3f1
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_
6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_
8 #include <string>
10 #include "base/android/jni_android.h"
11 #include "base/android/jni_weak_ref.h"
12 #include "sync/notifier/invalidation_util.h"
14 namespace invalidation {
16 // Controls invalidation registration on Android. This class is a wrapper for
17 // the Java class org.chromium.sync.notifier.InvalidationController.
18 class InvalidationControllerAndroid {
19 public:
20 InvalidationControllerAndroid();
21 virtual ~InvalidationControllerAndroid();
23 // Sets object ids for which the invalidation client should register for
24 // notification.
25 virtual void SetRegisteredObjectIds(const syncer::ObjectIdSet& ids);
27 // Asks the Java code to return the client ID it chose to use.
28 std::string GetInvalidatorClientId();
30 private:
31 // The Java invalidation controller.
32 base::android::ScopedJavaGlobalRef<jobject> invalidation_controller_;
34 DISALLOW_COPY_AND_ASSIGN(InvalidationControllerAndroid);
37 bool RegisterInvalidationController(JNIEnv* env);
39 } // namespace invalidation
41 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_CONTROLLER_ANDROID_H_