#include "chrome/browser/ui/browser_tab_strip_model_delegate.h"
#include <stddef.h>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "build/build_config.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/reading_list/reading_list_model_factory.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/task_manager/web_contents_tags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_live_tab_context.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_helpers.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_menu_model_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/unload_controller.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/common/chrome_switches.h"
#include "components/reading_list/core/reading_list_model.h"
#include "components/saved_tab_groups/features.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "components/sessions/content/content_live_tab.h"
#include "components/sessions/core/session_id.h"
#include "components/sessions/core/tab_restore_service.h"
#include "components/tab_groups/tab_group_id.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "ipc/ipc_message.h"
#include "ui/gfx/range/range.h"
namespace chrome {
BrowserTabStripModelDelegate::BrowserTabStripModelDelegate(Browser* browser)
: … { … }
BrowserTabStripModelDelegate::~BrowserTabStripModelDelegate() = default;
void BrowserTabStripModelDelegate::AddTabAt(
const GURL& url,
int index,
bool foreground,
std::optional<tab_groups::TabGroupId> group) { … }
Browser* BrowserTabStripModelDelegate::CreateNewStripWithTabs(
std::vector<NewStripContents> tabs,
const gfx::Rect& window_bounds,
bool maximize) { … }
void BrowserTabStripModelDelegate::WillAddWebContents(
content::WebContents* contents) { … }
int BrowserTabStripModelDelegate::GetDragActions() const { … }
bool BrowserTabStripModelDelegate::CanDuplicateContentsAt(int index) { … }
bool BrowserTabStripModelDelegate::IsTabStripEditable() { … }
void BrowserTabStripModelDelegate::DuplicateContentsAt(int index) { … }
void BrowserTabStripModelDelegate::MoveToExistingWindow(
const std::vector<int>& indices,
int browser_index) { … }
bool BrowserTabStripModelDelegate::CanMoveTabsToWindow(
const std::vector<int>& indices) { … }
void BrowserTabStripModelDelegate::MoveTabsToNewWindow(
const std::vector<int>& indices) { … }
void BrowserTabStripModelDelegate::MoveGroupToNewWindow(
const tab_groups::TabGroupId& group) { … }
std::optional<SessionID> BrowserTabStripModelDelegate::CreateHistoricalTab(
content::WebContents* contents) { … }
void BrowserTabStripModelDelegate::CreateHistoricalGroup(
const tab_groups::TabGroupId& group) { … }
void BrowserTabStripModelDelegate::GroupAdded(
const tab_groups::TabGroupId& group) { … }
void BrowserTabStripModelDelegate::WillCloseGroup(
const tab_groups::TabGroupId& group) { … }
void BrowserTabStripModelDelegate::GroupCloseStopped(
const tab_groups::TabGroupId& group) { … }
bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing(
content::WebContents* contents) { … }
bool BrowserTabStripModelDelegate::ShouldRunUnloadListenerBeforeClosing(
content::WebContents* contents) { … }
bool BrowserTabStripModelDelegate::ShouldDisplayFavicon(
content::WebContents* contents) const { … }
bool BrowserTabStripModelDelegate::CanReload() const { … }
void BrowserTabStripModelDelegate::AddToReadLater(
content::WebContents* web_contents) { … }
bool BrowserTabStripModelDelegate::SupportsReadLater() { … }
bool BrowserTabStripModelDelegate::IsForWebApp() { … }
void BrowserTabStripModelDelegate::CopyURL(content::WebContents* web_contents) { … }
void BrowserTabStripModelDelegate::GoBack(content::WebContents* web_contents) { … }
bool BrowserTabStripModelDelegate::CanGoBack(
content::WebContents* web_contents) { … }
bool BrowserTabStripModelDelegate::IsNormalWindow() { … }
BrowserWindowInterface*
BrowserTabStripModelDelegate::GetBrowserWindowInterface() { … }
void BrowserTabStripModelDelegate::OnGroupsDestruction(
const std::vector<tab_groups::TabGroupId>& group_ids,
base::OnceCallback<void()> callback) { … }
void BrowserTabStripModelDelegate::OnRemovingAllTabsFromGroups(
const std::vector<tab_groups::TabGroupId>& group_ids,
base::OnceCallback<void()> callback) { … }
void BrowserTabStripModelDelegate::CloseFrame() { … }
bool BrowserTabStripModelDelegate::BrowserSupportsHistoricalEntries() { … }
}