OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_TAB_RESTORE_SERVICE_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ | 6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Removes all entries from the list and notifies observers the list | 149 // Removes all entries from the list and notifies observers the list |
150 // of tabs has changed. | 150 // of tabs has changed. |
151 virtual void ClearEntries() = 0; | 151 virtual void ClearEntries() = 0; |
152 | 152 |
153 // Returns the entries, ordered with most recently closed entries at the | 153 // Returns the entries, ordered with most recently closed entries at the |
154 // front. | 154 // front. |
155 virtual const Entries& entries() const = 0; | 155 virtual const Entries& entries() const = 0; |
156 | 156 |
157 // Restores the most recently closed entry. Does nothing if there are no | 157 // Restores the most recently closed entry. Does nothing if there are no |
158 // entries to restore. If the most recently restored entry is a tab, it is | 158 // entries to restore. If the most recently restored entry is a tab, it is |
159 // added to |context|. |host_desktop_type| is a value that is opaque to this | 159 // added to |context|. Returns the LiveTab instances of the restored tab(s). |
160 // class and will be used only to pass back to the embedder via | |
161 // TabRestoreServiceClient if necessary. Returns the LiveTab instances of the | |
162 // restored tab(s). | |
163 virtual std::vector<LiveTab*> RestoreMostRecentEntry( | 160 virtual std::vector<LiveTab*> RestoreMostRecentEntry( |
164 LiveTabContext* context, | 161 LiveTabContext* context) = 0; |
165 int host_desktop_type) = 0; | |
166 | 162 |
167 // Removes the Tab with id |id| from the list and returns it; ownership is | 163 // Removes the Tab with id |id| from the list and returns it; ownership is |
168 // passed to the caller. | 164 // passed to the caller. |
169 virtual Tab* RemoveTabEntryById(SessionID::id_type id) = 0; | 165 virtual Tab* RemoveTabEntryById(SessionID::id_type id) = 0; |
170 | 166 |
171 // Restores an entry by id. If there is no entry with an id matching |id|, | 167 // Restores an entry by id. If there is no entry with an id matching |id|, |
172 // this does nothing. If |context| is NULL, this creates a new window for the | 168 // this does nothing. If |context| is NULL, this creates a new window for the |
173 // entry. |disposition| is respected, but the attributes (tabstrip index, | 169 // entry. |disposition| is respected, but the attributes (tabstrip index, |
174 // browser window) of the tab when it was closed will be respected if | 170 // browser window) of the tab when it was closed will be respected if |
175 // disposition is UNKNOWN. |host_desktop_type| is a value that is opaque to | 171 // disposition is UNKNOWN. Returns the LiveTab instances of the restored |
176 // this class and will be used only to pass back to the embedder via | 172 // tab(s). |
177 // TabRestoreServiceClient if necessary. Returns the LiveTab instances of the | |
178 // restored tab(s). | |
179 virtual std::vector<LiveTab*> RestoreEntryById( | 173 virtual std::vector<LiveTab*> RestoreEntryById( |
180 LiveTabContext* context, | 174 LiveTabContext* context, |
181 SessionID::id_type id, | 175 SessionID::id_type id, |
182 int host_desktop_type, | |
183 WindowOpenDisposition disposition) = 0; | 176 WindowOpenDisposition disposition) = 0; |
184 | 177 |
185 // Loads the tabs and previous session. This does nothing if the tabs | 178 // Loads the tabs and previous session. This does nothing if the tabs |
186 // from the previous session have already been loaded. | 179 // from the previous session have already been loaded. |
187 virtual void LoadTabsFromLastSession() = 0; | 180 virtual void LoadTabsFromLastSession() = 0; |
188 | 181 |
189 // Returns true if the tab entries have been loaded. | 182 // Returns true if the tab entries have been loaded. |
190 virtual bool IsLoaded() const = 0; | 183 virtual bool IsLoaded() const = 0; |
191 | 184 |
192 // Deletes the last session. | 185 // Deletes the last session. |
(...skipping 10 matching lines...) Expand all Loading... |
203 | 196 |
204 private: | 197 private: |
205 friend TabRestoreService::Tab; | 198 friend TabRestoreService::Tab; |
206 | 199 |
207 virtual scoped_ptr<PlatformSpecificTabData> Clone() = 0; | 200 virtual scoped_ptr<PlatformSpecificTabData> Clone() = 0; |
208 }; | 201 }; |
209 | 202 |
210 } // namespace sessions | 203 } // namespace sessions |
211 | 204 |
212 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ | 205 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |