#include "chrome/browser/ui/browser_tabrestore.h"
#include <map>
#include <memory>
#include <utility>
#include "build/build_config.h"
#include "chrome/browser/apps/app_service/web_contents_app_id_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/sessions/session_service_base.h"
#include "chrome/browser/sessions/session_service_lookup.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_enums.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/sessions/content/content_serialized_navigation_builder.h"
#include "components/tab_groups/tab_group_id.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/restore_type.h"
#include "content/public/browser/session_storage_namespace.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/range/range.h"
#if defined(TOOLKIT_VIEWS)
#include "chrome/browser/ui/side_search/side_search_utils.h"
#endif
NavigationEntry;
RestoreType;
WebContents;
ContentSerializedNavigationBuilder;
SerializedNavigationEntry;
namespace chrome {
namespace {
std::unique_ptr<WebContents> CreateRestoredTab(
Browser* browser,
const std::vector<SerializedNavigationEntry>& navigations,
int selected_navigation,
const std::string& extension_app_id,
base::TimeTicks last_active_time_ticks,
base::Time last_active_time,
content::SessionStorageNamespace* session_storage_namespace,
const sessions::SerializedUserAgentOverride& user_agent_override,
const std::map<std::string, std::string>& extra_data,
bool initially_hidden,
bool from_session_restore) { … }
void LoadRestoredTabIfVisible(Browser* browser,
content::WebContents* web_contents) { … }
WebContents* AddRestoredTabImpl(std::unique_ptr<WebContents> web_contents,
Browser* browser,
int tab_index,
std::optional<tab_groups::TabGroupId> group,
bool select,
bool pin,
bool from_session_restore,
std::optional<bool> is_active_browser) { … }
}
WebContents* AddRestoredTab(
Browser* browser,
const std::vector<SerializedNavigationEntry>& navigations,
int tab_index,
int selected_navigation,
const std::string& extension_app_id,
std::optional<tab_groups::TabGroupId> group,
bool select,
bool pin,
base::TimeTicks last_active_time_ticks,
base::Time last_active_time,
content::SessionStorageNamespace* session_storage_namespace,
const sessions::SerializedUserAgentOverride& user_agent_override,
const std::map<std::string, std::string>& extra_data,
bool from_session_restore,
std::optional<bool> is_active_browser) { … }
WebContents* ReplaceRestoredTab(
Browser* browser,
const std::vector<SerializedNavigationEntry>& navigations,
int selected_navigation,
const std::string& extension_app_id,
content::SessionStorageNamespace* session_storage_namespace,
const sessions::SerializedUserAgentOverride& user_agent_override,
const std::map<std::string, std::string>& extra_data,
bool from_session_restore) { … }
}