Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: chrome/browser/sessions/tab_restore_service.h

Issue 21656002: Return webcontents and add in test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_TAB_RESTORE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_
6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ 6 #define CHROME_BROWSER_SESSIONS_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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // of tabs has changed. 148 // of tabs has changed.
149 virtual void ClearEntries() = 0; 149 virtual void ClearEntries() = 0;
150 150
151 // Returns the entries, ordered with most recently closed entries at the 151 // Returns the entries, ordered with most recently closed entries at the
152 // front. 152 // front.
153 virtual const Entries& entries() const = 0; 153 virtual const Entries& entries() const = 0;
154 154
155 // Restores the most recently closed entry. Does nothing if there are no 155 // Restores the most recently closed entry. Does nothing if there are no
156 // entries to restore. If the most recently restored entry is a tab, it is 156 // entries to restore. If the most recently restored entry is a tab, it is
157 // added to |delegate|. If a new browser needs to be created for this entry, 157 // added to |delegate|. If a new browser needs to be created for this entry,
158 // it will be created on the desktop specified by |host_desktop_type|. 158 // it will be created on the desktop specified by |host_desktop_type|. Returns
159 virtual void RestoreMostRecentEntry( 159 // the WebContents of the restored tab(s).
160 virtual std::vector<content::WebContents*> RestoreMostRecentEntry(
160 TabRestoreServiceDelegate* delegate, 161 TabRestoreServiceDelegate* delegate,
161 chrome::HostDesktopType host_desktop_type) = 0; 162 chrome::HostDesktopType host_desktop_type) = 0;
162 163
163 // Removes the Tab with id |id| from the list and returns it; ownership is 164 // Removes the Tab with id |id| from the list and returns it; ownership is
164 // passed to the caller. 165 // passed to the caller.
165 virtual Tab* RemoveTabEntryById(SessionID::id_type id) = 0; 166 virtual Tab* RemoveTabEntryById(SessionID::id_type id) = 0;
166 167
167 // Restores an entry by id. If there is no entry with an id matching |id|, 168 // Restores an entry by id. If there is no entry with an id matching |id|,
168 // this does nothing. If |delegate| is NULL, this creates a new window for the 169 // this does nothing. If |delegate| is NULL, this creates a new window for the
169 // entry. |disposition| is respected, but the attributes (tabstrip index, 170 // entry. |disposition| is respected, but the attributes (tabstrip index,
170 // browser window) of the tab when it was closed will be respected if 171 // browser window) of the tab when it was closed will be respected if
171 // disposition is UNKNOWN. If a new browser needs to be created for this 172 // disposition is UNKNOWN. If a new browser needs to be created for this
172 // entry, it will be created on the desktop specified by |host_desktop_type|. 173 // entry, it will be created on the desktop specified by |host_desktop_type|.
173 virtual void RestoreEntryById(TabRestoreServiceDelegate* delegate, 174 // Returns the WebContents of the restored tab(s).
174 SessionID::id_type id, 175 virtual std::vector<content::WebContents*> RestoreEntryById(
175 chrome::HostDesktopType host_desktop_type, 176 TabRestoreServiceDelegate* delegate,
176 WindowOpenDisposition disposition) = 0; 177 SessionID::id_type id,
178 chrome::HostDesktopType host_desktop_type,
179 WindowOpenDisposition disposition) = 0;
177 180
178 // Loads the tabs and previous session. This does nothing if the tabs 181 // Loads the tabs and previous session. This does nothing if the tabs
179 // from the previous session have already been loaded. 182 // from the previous session have already been loaded.
180 virtual void LoadTabsFromLastSession() = 0; 183 virtual void LoadTabsFromLastSession() = 0;
181 184
182 // Returns true if the tab entries have been loaded. 185 // Returns true if the tab entries have been loaded.
183 virtual bool IsLoaded() const = 0; 186 virtual bool IsLoaded() const = 0;
184 187
185 // Deletes the last session. 188 // Deletes the last session.
186 virtual void DeleteLastSession() = 0; 189 virtual void DeleteLastSession() = 0;
187 }; 190 };
188 191
189 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ 192 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore_browsertest.cc ('k') | chrome/browser/sessions/tab_restore_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698