Skip to content

Instantly share code, notes, and snippets.

@t4kemyh4nd
Created October 15, 2023 05:54
Show Gist options
  • Save t4kemyh4nd/626384143b3f3184378a9bffd6d3aa2e to your computer and use it in GitHub Desktop.
Save t4kemyh4nd/626384143b3f3184378a9bffd6d3aa2e to your computer and use it in GitHub Desktop.
void WebApkInstallService::InstallAsync(
content::WebContents* web_contents,
const webapps::ShortcutInfo& shortcut_info,
const SkBitmap& primary_icon,
webapps::WebappInstallSource install_source) {
if (IsInstallInProgress(shortcut_info.manifest_id)) {
webapps::WebappsUtils::ShowWebApkInstallResultToast(
webapps::WebApkInstallResult::INSTALL_ALREADY_IN_PROGRESS);
return;
}
install_ids_.insert(shortcut_info.manifest_id);
webapps::InstallableMetrics::TrackInstallEvent(install_source);
ShowInstallInProgressNotification(
shortcut_info.manifest_id, shortcut_info.short_name, shortcut_info.url,
primary_icon, shortcut_info.is_primary_icon_maskable);
WebApkInstaller::InstallAsync(
browser_context_, web_contents, shortcut_info, primary_icon,
base::BindOnce(&WebApkInstallService::OnFinishedInstall,
weak_ptr_factory_.GetWeakPtr(), web_contents->GetWeakPtr(),
shortcut_info, primary_icon));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment