OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
6 #define CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/sessions/tab_restore_service.h" | 10 #include "chrome/browser/sessions/tab_restore_service.h" |
11 #include "chrome/browser/sessions/tab_restore_service_helper.h" | 11 #include "chrome/browser/sessions/tab_restore_service_helper.h" |
12 | 12 |
13 // Tab restore service that doesn't persist tabs on disk. This is used on | 13 // Tab restore service that doesn't persist tabs on disk. This is used on |
14 // Android where tabs persistence is implemented on the application side in | 14 // Android where tabs persistence is implemented on the application side in |
15 // Java. Other platforms should use PersistentTabRestoreService which can be | 15 // Java. Other platforms should use PersistentTabRestoreService which can be |
16 // instantiated through the TabRestoreServiceFactory. | 16 // instantiated through the TabRestoreServiceFactory. |
17 class InMemoryTabRestoreService : public TabRestoreService { | 17 class InMemoryTabRestoreService : public TabRestoreService { |
18 public: | 18 public: |
19 // Creates a new TabRestoreService and provides an object that provides the | 19 // Creates a new TabRestoreService and provides an object that provides the |
20 // current time. The TabRestoreService does not take ownership of | 20 // current time. The TabRestoreService does not take ownership of |
21 // |time_factory|. | 21 // |time_factory|. |
22 InMemoryTabRestoreService(Profile* profile, | 22 InMemoryTabRestoreService(Profile* profile, |
23 TimeFactory* time_factory); | 23 TimeFactory* time_factory); |
24 | 24 |
25 virtual ~InMemoryTabRestoreService(); | 25 virtual ~InMemoryTabRestoreService(); |
26 | 26 |
27 // TabRestoreService: | 27 // TabRestoreService: |
28 virtual void AddObserver(TabRestoreServiceObserver* observer) OVERRIDE; | 28 virtual void AddObserver(TabRestoreServiceObserver* observer) override; |
29 virtual void RemoveObserver(TabRestoreServiceObserver* observer) OVERRIDE; | 29 virtual void RemoveObserver(TabRestoreServiceObserver* observer) override; |
30 virtual void CreateHistoricalTab(content::WebContents* contents, | 30 virtual void CreateHistoricalTab(content::WebContents* contents, |
31 int index) OVERRIDE; | 31 int index) override; |
32 virtual void BrowserClosing(TabRestoreServiceDelegate* delegate) OVERRIDE; | 32 virtual void BrowserClosing(TabRestoreServiceDelegate* delegate) override; |
33 virtual void BrowserClosed(TabRestoreServiceDelegate* delegate) OVERRIDE; | 33 virtual void BrowserClosed(TabRestoreServiceDelegate* delegate) override; |
34 virtual void ClearEntries() OVERRIDE; | 34 virtual void ClearEntries() override; |
35 virtual const Entries& entries() const OVERRIDE; | 35 virtual const Entries& entries() const override; |
36 virtual std::vector<content::WebContents*> RestoreMostRecentEntry( | 36 virtual std::vector<content::WebContents*> RestoreMostRecentEntry( |
37 TabRestoreServiceDelegate* delegate, | 37 TabRestoreServiceDelegate* delegate, |
38 chrome::HostDesktopType host_desktop_type) OVERRIDE; | 38 chrome::HostDesktopType host_desktop_type) override; |
39 virtual Tab* RemoveTabEntryById(SessionID::id_type id) OVERRIDE; | 39 virtual Tab* RemoveTabEntryById(SessionID::id_type id) override; |
40 virtual std::vector<content::WebContents*> | 40 virtual std::vector<content::WebContents*> |
41 RestoreEntryById(TabRestoreServiceDelegate* delegate, | 41 RestoreEntryById(TabRestoreServiceDelegate* delegate, |
42 SessionID::id_type id, | 42 SessionID::id_type id, |
43 chrome::HostDesktopType host_desktop_type, | 43 chrome::HostDesktopType host_desktop_type, |
44 WindowOpenDisposition disposition) OVERRIDE; | 44 WindowOpenDisposition disposition) override; |
45 virtual void LoadTabsFromLastSession() OVERRIDE; | 45 virtual void LoadTabsFromLastSession() override; |
46 virtual bool IsLoaded() const OVERRIDE; | 46 virtual bool IsLoaded() const override; |
47 virtual void DeleteLastSession() OVERRIDE; | 47 virtual void DeleteLastSession() override; |
48 virtual void Shutdown() OVERRIDE; | 48 virtual void Shutdown() override; |
49 | 49 |
50 private: | 50 private: |
51 TabRestoreServiceHelper helper_; | 51 TabRestoreServiceHelper helper_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(InMemoryTabRestoreService); | 53 DISALLOW_COPY_AND_ASSIGN(InMemoryTabRestoreService); |
54 }; | 54 }; |
55 | 55 |
56 #endif // CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ | 56 #endif // CHROME_BROWSER_SESSIONS_IN_MEMORY_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |