#ifndef CHROME_BROWSER_ANDROID_BACKGROUND_TAB_MANAGER_H_
#define CHROME_BROWSER_ANDROID_BACKGROUND_TAB_MANAGER_H_
#include <memory>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/singleton.h"
#include "content/public/browser/web_contents_user_data.h"
class Profile;
namespace history {
struct HistoryAddPageArgs;
class HistoryService;
}
namespace chrome {
namespace android {
class BackgroundTabManager;
class BackgroundTabManager
: public content::WebContentsUserData<BackgroundTabManager> {
public:
BackgroundTabManager(content::WebContents* web_contents, Profile* profile);
~BackgroundTabManager() override;
void UnregisterBackgroundTab();
Profile* GetProfile() const;
void CacheHistory(const history::HistoryAddPageArgs& history_item);
void CommitHistory(history::HistoryService* history_service);
private:
friend class content::WebContentsUserData<BackgroundTabManager>;
raw_ptr<Profile> profile_;
std::vector<history::HistoryAddPageArgs> cached_history_;
WEB_CONTENTS_USER_DATA_KEY_DECL();
};
}
}
#endif