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 10 matching lines...) Expand all Loading... | |
21 struct SyncedSession; | 21 struct SyncedSession; |
22 } // namespace browser_sync | 22 } // namespace browser_sync |
23 | 23 |
24 class ForeignSessionHelper : public content::NotificationObserver { | 24 class ForeignSessionHelper : public content::NotificationObserver { |
25 public: | 25 public: |
26 explicit ForeignSessionHelper(Profile* profile); | 26 explicit ForeignSessionHelper(Profile* profile); |
27 void Destroy(JNIEnv* env, jobject obj); | 27 void Destroy(JNIEnv* env, jobject obj); |
28 jboolean IsTabSyncEnabled(JNIEnv* env, jobject obj); | 28 jboolean IsTabSyncEnabled(JNIEnv* env, jobject obj); |
29 void SetOnForeignSessionCallback(JNIEnv* env, jobject obj, jobject callback); | 29 void SetOnForeignSessionCallback(JNIEnv* env, jobject obj, jobject callback); |
30 jboolean GetForeignSessions(JNIEnv* env, jobject obj, jobject result); | 30 jboolean GetForeignSessions(JNIEnv* env, jobject obj, jobject result); |
31 // TODO (apiccion): Remvoe this method once downstream CL Lands. | |
32 // See: https://code.google.com/p/chromium/issues/detail?id=257102 | |
33 jboolean OpenForeignSessionTabOld(JNIEnv* env, | |
34 jobject obj, | |
35 jstring session_tag, | |
36 jint tab_id); | |
31 jboolean OpenForeignSessionTab(JNIEnv* env, | 37 jboolean OpenForeignSessionTab(JNIEnv* env, |
32 jobject obj, | 38 jobject obj, |
39 jobject j_tab, | |
33 jstring session_tag, | 40 jstring session_tag, |
34 jint tab_id); | 41 jint tab_id, |
42 jint j_disposition); | |
newt (away)
2013/11/02 02:04:42
typically don't use j_ for primitive types (since
apiccion
2013/11/02 02:48:27
Done.
| |
35 void SetForeignSessionCollapsed(JNIEnv* env, | 43 void SetForeignSessionCollapsed(JNIEnv* env, |
36 jobject obj, | 44 jobject obj, |
37 jstring session_tag, | 45 jstring session_tag, |
38 jboolean is_collapsed); | 46 jboolean is_collapsed); |
39 jboolean GetForeignSessionCollapsed(JNIEnv* env, | 47 jboolean GetForeignSessionCollapsed(JNIEnv* env, |
40 jobject obj, | 48 jobject obj, |
41 jstring session_tag); | 49 jstring session_tag); |
42 void DeleteForeignSession(JNIEnv* env, jobject obj, jstring session_tag); | 50 void DeleteForeignSession(JNIEnv* env, jobject obj, jstring session_tag); |
43 | 51 |
44 // NotificationObserver implemenation | 52 // NotificationObserver implemenation |
45 virtual void Observe(int type, | 53 virtual void Observe(int type, |
46 const content::NotificationSource& source, | 54 const content::NotificationSource& source, |
47 const content::NotificationDetails& details) OVERRIDE; | 55 const content::NotificationDetails& details) OVERRIDE; |
48 | 56 |
49 static bool RegisterForeignSessionHelper(JNIEnv* env); | 57 static bool RegisterForeignSessionHelper(JNIEnv* env); |
50 | 58 |
51 private: | 59 private: |
52 virtual ~ForeignSessionHelper(); | 60 virtual ~ForeignSessionHelper(); |
53 | 61 |
54 Profile* profile_; // weak | 62 Profile* profile_; // weak |
55 base::android::ScopedJavaGlobalRef<jobject> callback_; | 63 base::android::ScopedJavaGlobalRef<jobject> callback_; |
56 content::NotificationRegistrar registrar_; | 64 content::NotificationRegistrar registrar_; |
57 | 65 |
58 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); | 66 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); |
59 }; | 67 }; |
60 | 68 |
61 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | 69 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ |
OLD | NEW |