blob: 79fa951ec45e6d4968f117879f59952424fb929b [file] [log] [blame]
skuhneb7409dcf2014-11-14 04:06:551// Copyright 2012 The Chromium Authors. All rights reserved.
[email protected]52877dbc62012-06-29 22:22:032// 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_UI_BROWSER_TABRESTORE_H_
6#define CHROME_BROWSER_UI_BROWSER_TABRESTORE_H_
[email protected]52877dbc62012-06-29 22:22:037
8#include <vector>
9
blundell47c6d8a2015-09-24 11:06:4010#include "components/sessions/core/session_types.h"
[email protected]52877dbc62012-06-29 22:22:0311
12class Browser;
13
14namespace content {
15class SessionStorageNamespace;
16class WebContents;
17}
18
[email protected]40a7e412013-04-29 18:13:0119namespace sessions {
20class SerializedNavigationEntry;
21}
22
[email protected]52877dbc62012-06-29 22:22:0323namespace chrome {
24
[email protected]52877dbc62012-06-29 22:22:0325// Add a tab with its session history restored from the SessionRestore
26// system. If select is true, the tab is selected. |tab_index| gives the index
27// to insert the tab at. |selected_navigation| is the index of the
[email protected]40a7e412013-04-29 18:13:0128// SerializedNavigationEntry in |navigations| to select. If |extension_app_id|
29// is non-empty the tab is an app tab and |extension_app_id| is the id of the
[email protected]52877dbc62012-06-29 22:22:0330// extension. If |pin| is true and |tab_index|/ is the last pinned tab, then
31// the newly created tab is pinned. If |from_last_session| is true,
[email protected]8d0f3312012-08-18 01:47:5332// |navigations| are from the previous session. |user_agent_override| contains
33// the string being used as the user agent for all of the tab's navigations when
[email protected]38eae4b2013-08-06 19:46:5434// the regular user agent is overridden. Returns the WebContents of the restored
35// tab.
[email protected]52877dbc62012-06-29 22:22:0336content::WebContents* AddRestoredTab(
37 Browser* browser,
[email protected]40a7e412013-04-29 18:13:0138 const std::vector<sessions::SerializedNavigationEntry>& navigations,
[email protected]52877dbc62012-06-29 22:22:0339 int tab_index,
40 int selected_navigation,
41 const std::string& extension_app_id,
42 bool select,
43 bool pin,
44 bool from_last_session,
[email protected]8d0f3312012-08-18 01:47:5345 content::SessionStorageNamespace* storage_namespace,
46 const std::string& user_agent_override);
[email protected]52877dbc62012-06-29 22:22:0347
48// Replaces the state of the currently selected tab with the session
[email protected]38eae4b2013-08-06 19:46:5449// history restored from the SessionRestore system. Returns the WebContents of
50// the restored tab.
51content::WebContents* ReplaceRestoredTab(
[email protected]52877dbc62012-06-29 22:22:0352 Browser* browser,
[email protected]40a7e412013-04-29 18:13:0153 const std::vector<sessions::SerializedNavigationEntry>& navigations,
[email protected]52877dbc62012-06-29 22:22:0354 int selected_navigation,
55 bool from_last_session,
56 const std::string& extension_app_id,
[email protected]8d0f3312012-08-18 01:47:5357 content::SessionStorageNamespace* session_storage_namespace,
58 const std::string& user_agent_override);
[email protected]52877dbc62012-06-29 22:22:0359
60
61} // namespace chrome
62
63#endif // CHROME_BROWSER_UI_BROWSER_TABRESTORE_H_