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

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: Address Scott's comments Created 8 years, 2 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 | 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 PersistentTabRestoreService(Profile* profile,
sky 2012/10/25 00:45:44 Document ownership of time_factory (you did a nice
Philippe 2012/10/25 15:37:07 Done.
20 TimeFactory* time_factory);
21
22 virtual ~PersistentTabRestoreService();
23
24 // TabRestoreService:
25 virtual void AddObserver(TabRestoreServiceObserver* observer) OVERRIDE;
26 virtual void RemoveObserver(TabRestoreServiceObserver* observer) OVERRIDE;
27 virtual void CreateHistoricalTab(content::WebContents* contents,
28 int index) OVERRIDE;
29 virtual void BrowserClosing(TabRestoreServiceDelegate* delegate) OVERRIDE;
30 virtual void BrowserClosed(TabRestoreServiceDelegate* delegate) OVERRIDE;
31 virtual void ClearEntries() OVERRIDE;
32 virtual const Entries& entries() const OVERRIDE;
33 virtual void RestoreMostRecentEntry(
34 TabRestoreServiceDelegate* delegate) OVERRIDE;
35 virtual Tab* RemoveTabEntryById(SessionID::id_type id) OVERRIDE;
36 virtual void RestoreEntryById(TabRestoreServiceDelegate* delegate,
37 SessionID::id_type id,
38 WindowOpenDisposition disposition) OVERRIDE;
39 virtual void LoadTabsFromLastSession() OVERRIDE;
40 virtual bool IsLoaded() const OVERRIDE;
41 virtual void DeleteLastSession() OVERRIDE;
42 virtual void Shutdown() OVERRIDE;
43
44 private:
45 friend class TabRestoreServiceTest;
46
47 class Delegate;
48
49 // Exposed for testing.
50 Entries* mutable_entries();
51 void PruneEntries();
52
53 scoped_ptr<Delegate> delegate_;
54 TabRestoreServiceHelper helper_;
55
56 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService);
57 };
58
59 #endif // CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698