Update browser_commands.cc

This commit is contained in:
Alexander David Frick 2022-07-15 20:35:53 -05:00 committed by GitHub
parent 6e80ffe625
commit fb4dd65b41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,6 +178,10 @@
#include "chromeos/lacros/lacros_service.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/apps/intent_helper/supported_links_infobar_delegate.h"
#endif
namespace {
const char kOsOverrideForTabletSite[] = "Linux; Android 9; Chrome tablet";
@ -692,7 +696,7 @@ void NewWindow(Browser* browser) {
}
apps::AppLaunchParams params = apps::AppLaunchParams(
app_id, launch_container, WindowOpenDisposition::NEW_WINDOW,
apps::mojom::LaunchSource::kFromKeyboard);
apps::LaunchSource::kFromKeyboard);
apps::AppServiceProxyFactory::GetForProfile(profile)
->BrowserAppLauncher()
->LaunchAppWithParams(std::move(params));
@ -705,7 +709,7 @@ void NewWindow(Browser* browser) {
if (extension && extension->is_hosted_app()) {
const auto app_launch_params = CreateAppLaunchParamsUserContainer(
profile, extension, WindowOpenDisposition::NEW_WINDOW,
apps::mojom::LaunchSource::kFromKeyboard);
apps::LaunchSource::kFromKeyboard);
OpenApplicationWindow(
profile, app_launch_params,
extensions::AppLaunchInfo::GetLaunchWebURL(extension));
@ -1708,8 +1712,13 @@ Browser* OpenInChrome(Browser* hosted_app_browser) {
source_tabstrip->DetachWebContentsAtForInsertion(
source_tabstrip->active_index()),
true);
apps::MaybeShowIntentPicker(
target_browser->tab_strip_model()->GetActiveWebContents());
auto* web_contents =
target_browser->tab_strip_model()->GetActiveWebContents();
apps::MaybeShowIntentPicker(web_contents);
#if BUILDFLAG(IS_CHROMEOS)
apps::SupportedLinksInfoBarDelegate::RemoveSupportedLinksInfoBar(
web_contents);
#endif
target_browser->window()->Show();
return target_browser;
}