Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: chrome/browser/android/foreign_session_helper.h

Issue 19874002: [Android] Expose foreign session sync related funtionalities through JNI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some renamings Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698