1 // Copyright 2015 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 COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_
6 #define COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_
8 #include "base/basictypes.h"
9 #include "components/sessions/core/tab_restore_service.h"
10 #include "components/sessions/serialized_navigation_entry.h"
11 #include "components/sessions/sessions_export.h"
15 // Interface that represents a currently-live tab to the core sessions code, and
16 // in particular, the tab restore service. This interface abstracts the concrete
17 // representation of a live tab on different platforms (e.g., WebContents on
18 // //content-based platforms).
19 class SESSIONS_EXPORT LiveTab
{
23 // Methods that return information about the navigation state of the tab.
24 virtual int GetCurrentEntryIndex() = 0;
25 virtual int GetPendingEntryIndex() = 0;
26 virtual SerializedNavigationEntry
GetEntryAtIndex(int index
) = 0;
27 virtual SerializedNavigationEntry
GetPendingEntry() = 0;
28 virtual int GetEntryCount() = 0;
30 // Returns any platform-specific data that should be associated with the
31 // TabRestoreService::Tab corresponding to this instance. The default
32 // implementation returns null.
33 virtual scoped_ptr
<PlatformSpecificTabData
> GetPlatformSpecificTabData();
35 // Loads the current page if necessary (where "necessary" is defined on a
36 // platform-specific basis).
37 virtual void LoadIfNecessary() = 0;
39 // Returns the user agent override, if any.
40 virtual const std::string
& GetUserAgentOverride() const = 0;
43 } // namespace sessions
45 #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_