Skip to content

Instantly share code, notes, and snippets.

@t4kemyh4nd
Created October 15, 2023 05:56
Show Gist options
  • Save t4kemyh4nd/d172d174842d0f5f3219bd19bd6a6295 to your computer and use it in GitHub Desktop.
Save t4kemyh4nd/d172d174842d0f5f3219bd19bd6a6295 to your computer and use it in GitHub Desktop.
void WebApkInstaller::InstallAsync(content::WebContents* web_contents,
const webapps::ShortcutInfo& shortcut_info,
const SkBitmap& primary_icon,
FinishCallback finish_callback) {
DCHECK(!install_from_webapk_service_);
install_duration_timer_ = std::make_unique<base::ElapsedTimer>();
web_contents_ = web_contents->GetWeakPtr();
install_shortcut_info_ =
std::make_unique<webapps::ShortcutInfo>(shortcut_info);
install_primary_icon_ = primary_icon;
short_name_ = shortcut_info.short_name;
finish_callback_ = std::move(finish_callback);
source_ = install_shortcut_info_->source;
manifest_url_ = install_shortcut_info_->manifest_url;
task_type_ = INSTALL;
if (!server_url_.is_valid()) {
OnResult(webapps::WebApkInstallResult::SERVER_URL_INVALID);
return;
}
CheckFreeSpace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment