#include "chrome/browser/ui/web_applications/web_app_launch_process.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/functional/callback_forward.h"
#include "base/memory/values_equivalent.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/launch_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/browser/ui/web_applications/share_target_utils.h"
#include "chrome/browser/ui/web_applications/web_app_launch_utils.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_launch_queue.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_tab_helper.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "components/services/app_service/public/cpp/intent.h"
#include "components/services/app_service/public/cpp/intent_util.h"
#include "extensions/common/constants.h"
#include "ui/base/window_open_disposition.h"
#include "ui/display/scoped_display_for_new_windows.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/system_web_apps/system_web_app_manager.h"
#include "chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.h"
#endif
namespace web_app {
namespace {
std::optional<GURL> GetProtocolHandlingTranslatedUrl(
OsIntegrationManager& os_integration_manager,
const apps::AppLaunchParams& params) { … }
}
content::WebContents* WebAppLaunchProcess::CreateAndRun(
Profile& profile,
WebAppRegistrar& registrar,
OsIntegrationManager& os_integration_manager,
const apps::AppLaunchParams& params) { … }
void WebAppLaunchProcess::SetOpenApplicationCallbackForTesting(
OpenApplicationCallback callback) { … }
WebAppLaunchProcess::OpenApplicationCallback&
WebAppLaunchProcess::GetOpenApplicationCallbackForTesting() { … }
WebAppLaunchProcess::WebAppLaunchProcess(
Profile& profile,
WebAppRegistrar& registrar,
OsIntegrationManager& os_integration_manager,
const apps::AppLaunchParams& params)
: … { … }
content::WebContents* WebAppLaunchProcess::Run() { … }
const apps::ShareTarget* WebAppLaunchProcess::MaybeGetShareTarget() const { … }
std::tuple<GURL, bool > WebAppLaunchProcess::GetLaunchUrl(
const apps::ShareTarget* share_target) const { … }
WindowOpenDisposition WebAppLaunchProcess::GetNavigationDisposition(
bool is_new_browser) const { … }
LaunchHandler WebAppLaunchProcess::GetLaunchHandler() const { … }
LaunchHandler::ClientMode WebAppLaunchProcess::GetLaunchClientMode() const { … }
std::tuple<Browser*, bool >
WebAppLaunchProcess::EnsureBrowser() { … }
Browser* WebAppLaunchProcess::MaybeFindBrowserForLaunch() const { … }
Browser* WebAppLaunchProcess::CreateBrowserForLaunch() { … }
WebAppLaunchProcess::NavigateResult WebAppLaunchProcess::MaybeNavigateBrowser(
Browser* browser,
bool is_new_browser,
const GURL& launch_url,
const apps::ShareTarget* share_target) { … }
void WebAppLaunchProcess::MaybeEnqueueWebLaunchParams(
const GURL& launch_url,
bool is_file_handling,
content::WebContents* web_contents,
bool started_new_navigation) { … }
}