Chromium Code Reviews| 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 namespace browser_sync { | |
| 18 class SessionModelAssociator; | |
| 19 } | |
| 20 | |
| 21 class ForeignSessionHelper : public content::NotificationObserver { | |
| 22 public: | |
| 23 static bool RegisterForeignSessionHelper(JNIEnv* env); | |
| 24 | |
| 25 explicit ForeignSessionHelper(Profile* profile); | |
| 26 void Destroy(JNIEnv* env, jobject obj); | |
| 27 jboolean IsTabSyncEnabled(JNIEnv* env, jobject obj); | |
| 28 void SetOnForeignSessionCallback(JNIEnv* env, jobject obj, jobject callback); | |
| 29 virtual void Observe(int type, const content::NotificationSource& source, | |
| 30 const content::NotificationDetails& details); | |
|
Ted C
2013/07/24 23:48:20
need an OVERRIDE here I suspect.
Kibeom Kim (inactive)
2013/07/25 21:18:23
Done.
| |
| 31 jboolean GetForeignSessions(JNIEnv* env, jobject obj, jobject result); | |
| 32 jboolean OpenForeignSessionTab(JNIEnv* env, jobject obj, jstring session_tag, | |
| 33 jint tab_id); | |
| 34 void SetForeignSessionCollapsed(JNIEnv* env, jobject obj, jstring session_tag, | |
| 35 jboolean is_collapsed); | |
| 36 void DeleteForeignSession(JNIEnv* env, jobject obj, jstring session_tag); | |
| 37 | |
| 38 private: | |
| 39 Profile* profile_; // weak | |
|
Ted C
2013/07/24 23:48:20
as a tiny nit, normally there are two spaces betwe
Kibeom Kim (inactive)
2013/07/25 21:18:23
Done.
| |
| 40 base::android::ScopedJavaGlobalRef<jobject> callback_; | |
| 41 content::NotificationRegistrar registrar_; | |
| 42 browser_sync::SessionModelAssociator* GetSessionModelAssociator(); | |
| 43 | |
| 44 virtual ~ForeignSessionHelper() {} | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHelper); | |
| 47 }; | |
| 48 | |
| 49 #endif // CHROME_BROWSER_ANDROID_FOREIGN_SESSION_HELPER_H_ | |
| OLD | NEW |