| 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_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
| 7 |
| 8 #include "chrome/browser/sessions/tab_restore_service.h" |
| 9 #include "chrome/browser/sessions/tab_restore_service_helper.h" |
| 10 |
| 11 // Tab restore service that doesn't persist tabs on disk. This is used on |
| 12 // Android where tabs persistence is implemented on the application side in |
| 13 // Java. Other platforms should use PersistentTabRestoreService which can be |
| 14 // instantiated through the TabRestoreServiceFactory. |
| 15 class InMemoryTabRestoreService : public TabRestoreService { |
| 16 public: |
| 17 // Creates a new TabRestoreService and provides an object that provides the |
| 18 // current time. The TabRestoreService does not take ownership of the |
| 19 // |time_factory_|. |
| 20 InMemoryTabRestoreService(Profile* profile, |
| 21 TimeFactory* time_factory); |
| 22 |
| 23 virtual ~InMemoryTabRestoreService(); |
| 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 TabRestoreServiceHelper helper_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(InMemoryTabRestoreService); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
| OLD | NEW |