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

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

Issue 1350653004: [sessions] Properly namespace recently-componentized TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/android/recently_closed_tabs_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "components/sessions/core/tab_restore_service_observer.h" 12 #include "components/sessions/core/tab_restore_service_observer.h"
13 13
14 class Profile; 14 class Profile;
15 class TabRestoreService;
16 15
17 // Provides the list of recently closed tabs to Java. 16 // Provides the list of recently closed tabs to Java.
18 class RecentlyClosedTabsBridge : public TabRestoreServiceObserver { 17 class RecentlyClosedTabsBridge : public sessions::TabRestoreServiceObserver {
19 public: 18 public:
20 explicit RecentlyClosedTabsBridge(Profile* profile); 19 explicit RecentlyClosedTabsBridge(Profile* profile);
21 20
22 void Destroy(JNIEnv* env, jobject obj); 21 void Destroy(JNIEnv* env, jobject obj);
23 void SetRecentlyClosedCallback(JNIEnv* env, jobject obj, jobject jcallback); 22 void SetRecentlyClosedCallback(JNIEnv* env, jobject obj, jobject jcallback);
24 jboolean GetRecentlyClosedTabs(JNIEnv* env, 23 jboolean GetRecentlyClosedTabs(JNIEnv* env,
25 jobject obj, 24 jobject obj,
26 jobject jtabs, 25 jobject jtabs,
27 jint max_tab_count); 26 jint max_tab_count);
28 jboolean OpenRecentlyClosedTab(JNIEnv* env, 27 jboolean OpenRecentlyClosedTab(JNIEnv* env,
29 jobject obj, 28 jobject obj,
30 jobject jtab, 29 jobject jtab,
31 jint tab_id, 30 jint tab_id,
32 jint j_disposition); 31 jint j_disposition);
33 void ClearRecentlyClosedTabs(JNIEnv* env, jobject obj); 32 void ClearRecentlyClosedTabs(JNIEnv* env, jobject obj);
34 33
35 // Observer callback for TabRestoreServiceObserver. Notifies the registered 34 // Observer callback for TabRestoreServiceObserver. Notifies the registered
36 // callback that the recently closed tabs list has changed. 35 // callback that the recently closed tabs list has changed.
37 void TabRestoreServiceChanged(TabRestoreService* service) override; 36 void TabRestoreServiceChanged(sessions::TabRestoreService* service) override;
38 37
39 // Observer callback when our associated TabRestoreService is destroyed. 38 // Observer callback when our associated TabRestoreService is destroyed.
40 void TabRestoreServiceDestroyed(TabRestoreService* service) override; 39 void TabRestoreServiceDestroyed(
40 sessions::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 ~RecentlyClosedTabsBridge() override; 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 sessions::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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/recently_closed_tabs_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698