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 COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ |
6 #define COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ | 6 #define COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // TabRestoreService: | 31 // TabRestoreService: |
32 void AddObserver(TabRestoreServiceObserver* observer) override; | 32 void AddObserver(TabRestoreServiceObserver* observer) override; |
33 void RemoveObserver(TabRestoreServiceObserver* observer) override; | 33 void RemoveObserver(TabRestoreServiceObserver* observer) override; |
34 void CreateHistoricalTab(LiveTab* live_tab, int index) override; | 34 void CreateHistoricalTab(LiveTab* live_tab, int index) override; |
35 void BrowserClosing(LiveTabContext* context) override; | 35 void BrowserClosing(LiveTabContext* context) override; |
36 void BrowserClosed(LiveTabContext* context) override; | 36 void BrowserClosed(LiveTabContext* context) override; |
37 void ClearEntries() override; | 37 void ClearEntries() override; |
38 const Entries& entries() const override; | 38 const Entries& entries() const override; |
39 std::vector<LiveTab*> RestoreMostRecentEntry( | 39 std::vector<LiveTab*> RestoreMostRecentEntry( |
40 LiveTabContext* context) override; | 40 LiveTabContext* context) override; |
41 Tab* RemoveTabEntryById(SessionID::id_type id) override; | 41 std::unique_ptr<Tab> RemoveTabEntryById(SessionID::id_type id) override; |
42 std::vector<LiveTab*> RestoreEntryById( | 42 std::vector<LiveTab*> RestoreEntryById( |
43 LiveTabContext* context, | 43 LiveTabContext* context, |
44 SessionID::id_type id, | 44 SessionID::id_type id, |
45 WindowOpenDisposition disposition) override; | 45 WindowOpenDisposition disposition) override; |
46 void LoadTabsFromLastSession() override; | 46 void LoadTabsFromLastSession() override; |
47 bool IsLoaded() const override; | 47 bool IsLoaded() const override; |
48 void DeleteLastSession() override; | 48 void DeleteLastSession() override; |
49 void Shutdown() override; | 49 void Shutdown() override; |
50 | 50 |
51 private: | 51 private: |
52 friend class ::PersistentTabRestoreServiceTest; | 52 friend class ::PersistentTabRestoreServiceTest; |
53 | 53 |
54 class Delegate; | 54 class Delegate; |
55 | 55 |
56 // Exposed for testing. | 56 // Exposed for testing. |
57 Entries* mutable_entries(); | 57 Entries* mutable_entries(); |
58 void PruneEntries(); | 58 void PruneEntries(); |
59 | 59 |
60 std::unique_ptr<TabRestoreServiceClient> client_; | 60 std::unique_ptr<TabRestoreServiceClient> client_; |
61 std::unique_ptr<Delegate> delegate_; | 61 std::unique_ptr<Delegate> delegate_; |
62 TabRestoreServiceHelper helper_; | 62 TabRestoreServiceHelper helper_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService); | 64 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace sessions | 67 } // namespace sessions |
68 | 68 |
69 #endif // COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ | 69 #endif // COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |