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.
5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_
6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_
11 #include "components/sessions/session_id.h"
18 class SerializedNavigationEntry
;
22 // Objects implement this interface to provide necessary functionality for
23 // TabRestoreService to operate. These methods are mostly copies of existing
25 class TabRestoreServiceDelegate
{
27 // see BrowserWindow::Show()
28 virtual void ShowBrowserWindow() = 0;
30 // see Browser::session_id()
31 virtual const SessionID
& GetSessionID() const = 0;
33 // see Browser::tab_count()
34 virtual int GetTabCount() const = 0;
36 // see Browser::active_index()
37 virtual int GetSelectedIndex() const = 0;
39 // see Browser::app_name()
40 virtual std::string
GetAppName() const = 0;
42 virtual sessions::LiveTab
* GetLiveTabAt(int index
) const = 0;
43 virtual sessions::LiveTab
* GetActiveLiveTab() const = 0;
44 virtual bool IsTabPinned(int index
) const = 0;
46 // Note: |tab_client_data| may be null (e.g., if |from_last_session| is true,
47 // as the tab client data is not persisted, or if the embedder did not supply
48 // client data for the tab in question).
49 virtual sessions::LiveTab
* AddRestoredTab(
50 const std::vector
<sessions::SerializedNavigationEntry
>& navigations
,
52 int selected_navigation
,
53 const std::string
& extension_app_id
,
56 bool from_last_session
,
57 const sessions::TabClientData
* tab_client_data
,
58 const std::string
& user_agent_override
) = 0;
60 // Note: |tab_client_data| may be null (e.g., if |from_last_session| is true,
61 // as the tab client data is not persisted, or if the embedder did not supply
62 virtual sessions::LiveTab
* ReplaceRestoredTab(
63 const std::vector
<sessions::SerializedNavigationEntry
>& navigations
,
64 int selected_navigation
,
65 bool from_last_session
,
66 const std::string
& extension_app_id
,
67 const sessions::TabClientData
* tab_client_data
,
68 const std::string
& user_agent_override
) = 0;
69 virtual void CloseTab() = 0;
72 virtual ~TabRestoreServiceDelegate() {}
75 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_