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

Side by Side Diff: chrome/browser/sessions/persistent_tab_restore_service.h

Issue 10989027: Split TabRestoreService into InMemoryTRS and PersistentTRS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GYP out InMemoryTRS on non-Android and fix incorrect comments Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
6 #define CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/sessions/tab_restore_service.h"
12 #include "chrome/browser/sessions/tab_restore_service_helper.h"
13
14 class Profile;
15
16 // Tab restore service that persists data on disk.
17 class PersistentTabRestoreService : public TabRestoreService {
18 public:
19 // Does not take ownership of |time_factory|.
20 PersistentTabRestoreService(Profile* profile,
21 TimeFactory* time_factory);
22
23 virtual ~PersistentTabRestoreService();
24
25 // TabRestoreService:
26 virtual void AddObserver(TabRestoreServiceObserver* observer) OVERRIDE;
27 virtual void RemoveObserver(TabRestoreServiceObserver* observer) OVERRIDE;
28 virtual void CreateHistoricalTab(content::WebContents* contents,
29 int index) OVERRIDE;
30 virtual void BrowserClosing(TabRestoreServiceDelegate* delegate) OVERRIDE;
31 virtual void BrowserClosed(TabRestoreServiceDelegate* delegate) OVERRIDE;
32 virtual void ClearEntries() OVERRIDE;
33 virtual const Entries& entries() const OVERRIDE;
34 virtual void RestoreMostRecentEntry(
35 TabRestoreServiceDelegate* delegate) OVERRIDE;
36 virtual Tab* RemoveTabEntryById(SessionID::id_type id) OVERRIDE;
37 virtual void RestoreEntryById(TabRestoreServiceDelegate* delegate,
38 SessionID::id_type id,
39 WindowOpenDisposition disposition) OVERRIDE;
40 virtual void LoadTabsFromLastSession() OVERRIDE;
41 virtual bool IsLoaded() const OVERRIDE;
42 virtual void DeleteLastSession() OVERRIDE;
43 virtual void Shutdown() OVERRIDE;
44
45 private:
46 friend class PersistentTabRestoreServiceTest;
47
48 class Delegate;
49
50 // Exposed for testing.
51 Entries* mutable_entries();
52 void PruneEntries();
53
54 scoped_ptr<Delegate> delegate_;
55 TabRestoreServiceHelper helper_;
56
57 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService);
58 };
59
60 #endif // CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/in_memory_tab_restore_service.cc ('k') | chrome/browser/sessions/persistent_tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698