Commit b4a21288 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Add "Open as window" checkbox back to Create shortcut

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=368714&signed_aid=jxynzMCcaUtxgGB-6k_3_w==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=368715&signed_aid=lXnbrTuQdIjEmsYnpGspxA==&inline=1

Bug: 907339
Change-Id: I8ed455084acc4d85f96ecbd3e124c13773bf3e25
Reviewed-on: https://chromium-review.googlesource.com/c/1349136
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610758}
parent 7883e6b9
......@@ -450,12 +450,6 @@ void BookmarkAppHelper::FinishInstallation(const Extension* extension) {
LaunchType launch_type =
web_app_info_.open_as_window ? LAUNCH_TYPE_WINDOW : LAUNCH_TYPE_REGULAR;
if (base::FeatureList::IsEnabled(::features::kDesktopPWAWindowing)) {
DCHECK_NE(web_app::ForInstallableSite::kUnknown, for_installable_site_);
launch_type = for_installable_site_ == web_app::ForInstallableSite::kYes
? LAUNCH_TYPE_WINDOW
: LAUNCH_TYPE_REGULAR;
}
profile_->GetPrefs()->SetInteger(pref_names::kBookmarkAppCreationLaunchType,
launch_type);
......
......@@ -394,7 +394,6 @@ TEST_F(BookmarkAppHelperExtensionServiceTest,
auto scoped_feature_list = std::make_unique<base::test::ScopedFeatureList>();
scoped_feature_list->InitAndEnableFeature(features::kDesktopPWAWindowing);
WebApplicationInfo web_app_info;
std::map<GURL, std::vector<SkBitmap>> icon_map;
blink::Manifest manifest;
......@@ -402,6 +401,8 @@ TEST_F(BookmarkAppHelperExtensionServiceTest,
manifest.name = base::NullableString16(base::UTF8ToUTF16(kAppTitle), false);
manifest.scope = GURL(kAppScope);
{
WebApplicationInfo web_app_info;
web_app_info.open_as_window = true;
TestBookmarkAppHelper helper(service_, web_app_info, web_contents());
helper.Create(base::Bind(&TestBookmarkAppHelper::CreationComplete,
base::Unretained(&helper)));
......@@ -431,6 +432,8 @@ TEST_F(BookmarkAppHelperExtensionServiceTest,
GetLaunchContainer(ExtensionPrefs::Get(profile()), extension));
}
{
WebApplicationInfo web_app_info;
web_app_info.open_as_window = false;
TestBookmarkAppHelper helper(service_, web_app_info, web_contents());
helper.Create(base::Bind(&TestBookmarkAppHelper::CreationComplete,
base::Unretained(&helper)));
......
......@@ -90,9 +90,7 @@ BookmarkAppConfirmationView::BookmarkAppConfirmationView(
// When CanHostedAppsOpenInWindows() returns false, do not show the open as
// window checkbox to avoid confusing users.
// Desktop PWAs will choose the display mode automatically.
if (extensions::util::CanHostedAppsOpenInWindows() &&
!base::FeatureList::IsEnabled(features::kDesktopPWAWindowing)) {
if (extensions::util::CanHostedAppsOpenInWindows()) {
open_as_window_checkbox_ = new views::Checkbox(
l10n_util::GetStringUTF16(IDS_BOOKMARK_APP_BUBBLE_OPEN_AS_WINDOW));
open_as_window_checkbox_->SetChecked(web_app_info_.open_as_window);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment