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_RECENTLY_CLOSED_TABS_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_ |
6 #define CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_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 16 matching lines...) Expand all Loading... |
27 jint max_tab_count); | 27 jint max_tab_count); |
28 jboolean OpenRecentlyClosedTab(JNIEnv* env, | 28 jboolean OpenRecentlyClosedTab(JNIEnv* env, |
29 jobject obj, | 29 jobject obj, |
30 jobject jtab, | 30 jobject jtab, |
31 jint tab_id, | 31 jint tab_id, |
32 jint j_disposition); | 32 jint j_disposition); |
33 void ClearRecentlyClosedTabs(JNIEnv* env, jobject obj); | 33 void ClearRecentlyClosedTabs(JNIEnv* env, jobject obj); |
34 | 34 |
35 // Observer callback for TabRestoreServiceObserver. Notifies the registered | 35 // Observer callback for TabRestoreServiceObserver. Notifies the registered |
36 // callback that the recently closed tabs list has changed. | 36 // callback that the recently closed tabs list has changed. |
37 virtual void TabRestoreServiceChanged(TabRestoreService* service) override; | 37 void TabRestoreServiceChanged(TabRestoreService* service) override; |
38 | 38 |
39 // Observer callback when our associated TabRestoreService is destroyed. | 39 // Observer callback when our associated TabRestoreService is destroyed. |
40 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) override; | 40 void TabRestoreServiceDestroyed(TabRestoreService* service) override; |
41 | 41 |
42 // Registers JNI methods. | 42 // Registers JNI methods. |
43 static bool Register(JNIEnv* env); | 43 static bool Register(JNIEnv* env); |
44 | 44 |
45 private: | 45 private: |
46 virtual ~RecentlyClosedTabsBridge(); | 46 ~RecentlyClosedTabsBridge() override; |
47 | 47 |
48 // Construct and initialize tab_restore_service_ if it's NULL. | 48 // Construct and initialize tab_restore_service_ if it's NULL. |
49 // tab_restore_service_ may still be NULL, however, in incognito mode. | 49 // tab_restore_service_ may still be NULL, however, in incognito mode. |
50 void EnsureTabRestoreService(); | 50 void EnsureTabRestoreService(); |
51 | 51 |
52 // The callback to be notified when the list of recently closed tabs changes. | 52 // The callback to be notified when the list of recently closed tabs changes. |
53 base::android::ScopedJavaGlobalRef<jobject> callback_; | 53 base::android::ScopedJavaGlobalRef<jobject> callback_; |
54 | 54 |
55 // The profile whose recently closed tabs are being monitored. | 55 // The profile whose recently closed tabs are being monitored. |
56 Profile* profile_; | 56 Profile* profile_; |
57 | 57 |
58 // TabRestoreService that we are observing. | 58 // TabRestoreService that we are observing. |
59 TabRestoreService* tab_restore_service_; | 59 TabRestoreService* tab_restore_service_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(RecentlyClosedTabsBridge); | 61 DISALLOW_COPY_AND_ASSIGN(RecentlyClosedTabsBridge); |
62 }; | 62 }; |
63 | 63 |
64 #endif // CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_ | 64 #endif // CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_ |
OLD | NEW |