| 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_ANDROID_FOREIGN_SESSION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const base::android::JavaParamRef<jobject>& j_tab, | 41 const base::android::JavaParamRef<jobject>& j_tab, |
| 42 const base::android::JavaParamRef<jstring>& session_tag, | 42 const base::android::JavaParamRef<jstring>& session_tag, |
| 43 jint tab_id, | 43 jint tab_id, |
| 44 jint disposition); | 44 jint disposition); |
| 45 void DeleteForeignSession( | 45 void DeleteForeignSession( |
| 46 JNIEnv* env, | 46 JNIEnv* env, |
| 47 const base::android::JavaParamRef<jobject>& obj, | 47 const base::android::JavaParamRef<jobject>& obj, |
| 48 const base::android::JavaParamRef<jstring>& session_tag); | 48 const base::android::JavaParamRef<jstring>& session_tag); |
| 49 | 49 |
| 50 // syncer::SyncServiceObserver implementation | 50 // syncer::SyncServiceObserver implementation |
| 51 void OnStateChanged() override {} | 51 void OnSyncConfigurationCompleted(syncer::SyncService* sync) override; |
| 52 void OnSyncConfigurationCompleted() override; | 52 void OnForeignSessionUpdated(syncer::SyncService* sync) override; |
| 53 void OnForeignSessionUpdated() override; | |
| 54 | 53 |
| 55 static bool RegisterForeignSessionHelper(JNIEnv* env); | 54 static bool RegisterForeignSessionHelper(JNIEnv* env); |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 ~ForeignSessionHelper() override; | 57 ~ForeignSessionHelper() override; |
| 59 | 58 |
| 60 // Fires |callback_| if it is not null. | 59 // Fires |callback_| if it is not null. |
| 61 void FireForeignSessionCallback(); | 60 void FireForeignSessionCallback(); |
| 62 | 61 |
| 63 Profile* profile_; // weak | 62 Profile* profile_; // weak |
| 64 base::android::ScopedJavaGlobalRef<jobject> callback_; | 63 base::android::ScopedJavaGlobalRef<jobject> callback_; |
| 65 ScopedObserver<syncer::SyncService, syncer::SyncServiceObserver> | 64 ScopedObserver<syncer::SyncService, syncer::SyncServiceObserver> |
| 66 scoped_observer_; | 65 scoped_observer_; |
| 67 | 66 |
| 68 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); | 67 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | 70 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ |
| OLD | NEW |