OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | |
6 #define CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "base/basictypes.h" | |
12 #include "chrome/browser/profiles/profile.h" | |
13 #include "chrome/browser/ui/webui/session_favicon_source.h" | |
14 #include "content/public/browser/notification_observer.h" | |
15 #include "content/public/browser/notification_registrar.h" | |
16 | |
17 using base::android::ScopedJavaLocalRef; | |
18 | |
19 class SessionWindow; | |
20 | |
21 namespace browser_sync { | |
22 class SessionModelAssociator; | |
23 class SyncedSession; | |
24 } // namespace browser_sync | |
25 | |
26 class ForeignSessionHelper : public content::NotificationObserver { | |
27 public: | |
28 static bool RegisterForeignSessionHelper(JNIEnv* env); | |
Ted C
2013/07/26 22:29:47
the ordering of the methods should be as close as
Kibeom Kim (inactive)
2013/07/26 23:32:52
Done.
| |
29 | |
30 explicit ForeignSessionHelper(Profile* profile); | |
31 void Destroy(JNIEnv* env, jobject obj); | |
32 jboolean IsTabSyncEnabled(JNIEnv* env, jobject obj); | |
33 void SetOnForeignSessionCallback(JNIEnv* env, jobject obj, jobject callback); | |
34 virtual void Observe(int type, const content::NotificationSource& source, | |
Ted C
2013/07/26 22:29:47
I usually see all the overridden methods separated
Ted C
2013/07/26 22:29:47
if all the params don't fit on one line, then each
Kibeom Kim (inactive)
2013/07/26 23:32:52
Done.
Kibeom Kim (inactive)
2013/07/26 23:32:52
Done.
| |
35 const content::NotificationDetails& details) OVERRIDE; | |
36 jboolean GetForeignSessions(JNIEnv* env, jobject obj, jobject result); | |
37 jboolean OpenForeignSessionTab(JNIEnv* env, jobject obj, jstring session_tag, | |
38 jint tab_id); | |
39 void SetForeignSessionCollapsed(JNIEnv* env, jobject obj, jstring session_tag, | |
40 jboolean is_collapsed); | |
41 void DeleteForeignSession(JNIEnv* env, jobject obj, jstring session_tag); | |
42 | |
43 private: | |
44 Profile* profile_; // weak | |
45 base::android::ScopedJavaGlobalRef<jobject> callback_; | |
46 content::NotificationRegistrar registrar_; | |
47 browser_sync::SessionModelAssociator* GetSessionModelAssociator(); | |
Ted C
2013/07/26 22:29:47
private methods above variables.
Kibeom Kim (inactive)
2013/07/26 23:32:52
Done.
| |
48 | |
49 void CopyTabsToJava(JNIEnv* env, const SessionWindow* window, | |
50 ScopedJavaLocalRef<jobject>& j_window); | |
51 void CopyWindowsToJava(JNIEnv* env, | |
52 const browser_sync::SyncedSession* session, | |
53 ScopedJavaLocalRef<jobject>& j_session); | |
54 virtual ~ForeignSessionHelper() {} | |
Kibeom Kim (inactive)
2013/07/26 18:35:44
clang build complains having {} here. I'll move {}
Kibeom Kim (inactive)
2013/07/26 23:32:52
Done.
| |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); | |
57 }; | |
58 | |
59 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | |
OLD | NEW |