Chromium Code Reviews| OLD | NEW |
|---|---|
| (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, | |
| 20 TimeFactory* time_factory = NULL); | |
|
sky
2012/10/24 13:51:25
not default values.
Philippe
2012/10/24 15:42:47
Done.
| |
| 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_ | |
| OLD | NEW |