[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 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 |
| 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] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | #include "chrome/browser/sessions/session_types.h" |
| 11 | |
| 12 | class Browser; |
| 13 | |
| 14 | namespace content { |
| 15 | class SessionStorageNamespace; |
| 16 | class WebContents; |
| 17 | } |
| 18 | |
| 19 | namespace chrome { |
| 20 | |
| 21 | // Returns the index to insert a tab at during session restore and startup. |
| 22 | // |relative_index| gives the index of the url into the number of tabs that |
| 23 | // are going to be opened. For example, if three urls are passed in on the |
| 24 | // command line this is invoked three times with the values 0, 1 and 2. |
| 25 | int GetIndexForInsertionDuringRestore(Browser* browser, int relative_index); |
| 26 | |
| 27 | // Add a tab with its session history restored from the SessionRestore |
| 28 | // system. If select is true, the tab is selected. |tab_index| gives the index |
| 29 | // to insert the tab at. |selected_navigation| is the index of the |
| 30 | // TabNavigation in |navigations| to select. If |extension_app_id| is |
| 31 | // non-empty the tab is an app tab and |extension_app_id| is the id of the |
| 32 | // extension. If |pin| is true and |tab_index|/ is the last pinned tab, then |
| 33 | // the newly created tab is pinned. If |from_last_session| is true, |
[email protected] | 8d0f331 | 2012-08-18 01:47:53 | [diff] [blame^] | 34 | // |navigations| are from the previous session. |user_agent_override| contains |
| 35 | // the string being used as the user agent for all of the tab's navigations when |
| 36 | // the regular user agent is overridden. |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 37 | content::WebContents* AddRestoredTab( |
| 38 | Browser* browser, |
| 39 | const std::vector<TabNavigation>& navigations, |
| 40 | int tab_index, |
| 41 | int selected_navigation, |
| 42 | const std::string& extension_app_id, |
| 43 | bool select, |
| 44 | bool pin, |
| 45 | bool from_last_session, |
[email protected] | 8d0f331 | 2012-08-18 01:47:53 | [diff] [blame^] | 46 | content::SessionStorageNamespace* storage_namespace, |
| 47 | const std::string& user_agent_override); |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 48 | |
| 49 | // Replaces the state of the currently selected tab with the session |
| 50 | // history restored from the SessionRestore system. |
| 51 | void ReplaceRestoredTab( |
| 52 | Browser* browser, |
| 53 | const std::vector<TabNavigation>& navigations, |
| 54 | int selected_navigation, |
| 55 | bool from_last_session, |
| 56 | const std::string& extension_app_id, |
[email protected] | 8d0f331 | 2012-08-18 01:47:53 | [diff] [blame^] | 57 | content::SessionStorageNamespace* session_storage_namespace, |
| 58 | const std::string& user_agent_override); |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 59 | |
| 60 | |
| 61 | } // namespace chrome |
| 62 | |
| 63 | #endif // CHROME_BROWSER_UI_BROWSER_TABRESTORE_H_ |