#ifndef CHROME_BROWSER_APPS_APP_SERVICE_LAUNCH_UTILS_H_
#define CHROME_BROWSER_APPS_APP_SERVICE_LAUNCH_UTILS_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/intent.h"
#include "extensions/common/constants.h"
#include "ui/base/window_open_disposition.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/apps/app_service/app_service_proxy_forward.h"
#include "chromeos/crosapi/mojom/app_service_types.mojom-forward.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/components/arc/mojom/app.mojom-forward.h"
#endif
class Browser;
class Profile;
namespace base {
class CommandLine;
class FilePath;
}
namespace content {
class WebContents;
}
namespace apps {
LaunchContainer ConvertWindowModeToAppLaunchContainer(WindowMode window_mode);
std::vector<base::FilePath> GetLaunchFilesFromCommandLine(
const base::CommandLine& command_line);
Browser* CreateBrowserWithNewTabPage(Profile* profile);
AppLaunchParams CreateAppIdLaunchParamsWithEventFlags(
const std::string& app_id,
int event_flags,
LaunchSource source,
int64_t display_id,
LaunchContainer fallback_container);
AppLaunchParams CreateAppLaunchParamsForIntent(
const std::string& app_id,
int32_t event_flags,
LaunchSource source,
int64_t display_id,
LaunchContainer fallback_container,
IntentPtr&& intent,
Profile* profile);
extensions::AppLaunchSource GetAppLaunchSource(LaunchSource launch_source);
int GetEventFlags(WindowOpenDisposition disposition, bool prefer_container);
int GetSessionIdForRestoreFromWebContents(
const content::WebContents* web_contents);
#if BUILDFLAG(IS_CHROMEOS_ASH)
arc::mojom::WindowInfoPtr MakeArcWindowInfo(WindowInfoPtr window_info);
#endif
#if BUILDFLAG(IS_CHROMEOS)
crosapi::mojom::LaunchParamsPtr ConvertLaunchParamsToCrosapi(
const AppLaunchParams& params,
Profile* profile);
AppLaunchParams ConvertCrosapiToLaunchParams(
const crosapi::mojom::LaunchParamsPtr& crosapi_params,
Profile* profile);
crosapi::mojom::LaunchParamsPtr CreateCrosapiLaunchParamsWithEventFlags(
AppServiceProxy* proxy,
const std::string& app_id,
int event_flags,
LaunchSource launch_source,
int64_t display_id);
struct AppIdsToLaunchForUrl {
AppIdsToLaunchForUrl();
AppIdsToLaunchForUrl(AppIdsToLaunchForUrl&&);
~AppIdsToLaunchForUrl();
std::vector<std::string> candidates;
std::optional<std::string> preferred;
};
AppIdsToLaunchForUrl FindAppIdsToLaunchForUrl(AppServiceProxy* proxy,
const GURL& url);
void MaybeLaunchPreferredAppForUrl(Profile* profile,
const GURL& url,
LaunchSource launch_source);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
void LaunchUrlInInstalledAppOrBrowser(Profile* profile,
const GURL& url,
LaunchSource launch_source);
#endif
}
#endif