#ifndef CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_LAUNCH_UTILS_H_
#define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_LAUNCH_UTILS_H_
#include <stdint.h>
#include <memory>
#include <optional>
#include <string>
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/web_applications/web_app_ui_manager.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "components/webapps/common/web_app_id.h"
#include "ui/gfx/geometry/rect.h"
class Profile;
class Browser;
class GURL;
enum class WindowOpenDisposition;
struct NavigateParams;
namespace apps {
struct AppLaunchParams;
}
namespace content {
class WebContents;
}
namespace web_app {
class AppBrowserController;
class WithAppResources;
enum class LaunchedAppType { … };
std::optional<webapps::AppId> GetWebAppForActiveTab(const Browser* browser);
void PrunePreScopeNavigationHistory(const GURL& scope,
content::WebContents* contents);
Browser* ReparentWebAppForActiveTab(Browser* browser);
Browser* ReparentWebContentsIntoAppBrowser(content::WebContents* contents,
const webapps::AppId& app_id);
void SetWebContentsIsPinnedHomeTab(content::WebContents* contents);
std::unique_ptr<AppBrowserController> MaybeCreateAppBrowserController(
Browser* browser);
void MaybeAddPinnedHomeTab(Browser* browser, const std::string& app_id);
Browser::CreateParams CreateParamsForApp(const webapps::AppId& app_id,
bool is_popup,
bool trusted_source,
const gfx::Rect& window_bounds,
Profile* profile,
bool user_gesture);
Browser* CreateWebAppWindowMaybeWithHomeTab(
const webapps::AppId& app_id,
const Browser::CreateParams& params);
content::WebContents* NavigateWebAppUsingParams(const std::string& app_id,
NavigateParams& nav_params);
void RecordLaunchMetrics(const webapps::AppId& app_id,
apps::LaunchContainer container,
apps::LaunchSource launch_source,
const GURL& launch_url,
content::WebContents* web_contents);
void UpdateLaunchStats(content::WebContents* web_contents,
const webapps::AppId& app_id,
const GURL& launch_url);
void LaunchWebApp(apps::AppLaunchParams params,
LaunchWebAppWindowSetting launch_setting,
Profile& profile,
WithAppResources& app_resources,
LaunchWebAppDebugValueCallback callback);
std::optional<std::pair<Browser*, int>> MaybeHandleAppNavigation(
Profile* profile,
const NavigateParams& navigate_params);
}
#endif