Commit f456a4b8 authored by Jiewei Qian's avatar Jiewei Qian Committed by Commit Bot

system-web-apps: remove bookmark app logic in LaunchSystemWebApp

This is a cleanup after BMO is launched.

Bug: 1065748
Change-Id: Ib5af0334ca9f9a9f11419fc774d0cd1adfc4307f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2467040
Commit-Queue: Jiewei Qian  <qjw@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818375}
parent 81731597
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/check_op.h" #include "base/check_op.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/optional.h" #include "base/optional.h"
...@@ -35,10 +34,6 @@ ...@@ -35,10 +34,6 @@
#include "chrome/browser/web_applications/system_web_app_manager.h" #include "chrome/browser/web_applications/system_web_app_manager.h"
#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_launch/web_launch_files_helper.h" #include "chrome/browser/web_launch/web_launch_files_helper.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/window_open_disposition.h" #include "ui/base/window_open_disposition.h"
#include "ui/display/types/display_constants.h" #include "ui/display/types/display_constants.h"
...@@ -228,39 +223,22 @@ Browser* LaunchSystemWebApp(Profile* profile, ...@@ -228,39 +223,22 @@ Browser* LaunchSystemWebApp(Profile* profile,
content::WebContents* web_contents = nullptr; content::WebContents* web_contents = nullptr;
// TODO(crbug.com/1129340): Remove these lines and make CCA resizeable after if (!browser) {
// CCA supports responsive UI. // TODO(crbug.com/1129340): Remove these lines and make CCA resizeable after
bool can_resize = app_type != SystemAppType::CAMERA; // CCA supports responsive UI.
if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions)) { bool can_resize = app_type != SystemAppType::CAMERA;
if (!browser) { browser = CreateWebApplicationWindow(profile_for_launch, params->app_id,
browser = CreateWebApplicationWindow(profile_for_launch, params->app_id, params->disposition, can_resize);
params->disposition, can_resize); }
}
// Navigate application window to application's |url| if necessary.
// Help app always navigates because its url might not match the url inside
// the iframe, and the iframe's url is the one that matters.
web_contents = browser->tab_strip_model()->GetWebContentsAt(0);
if (!web_contents || web_contents->GetURL() != url ||
app_type == SystemAppType::HELP) {
web_contents = NavigateWebApplicationWindow(
browser, params->app_id, url, WindowOpenDisposition::CURRENT_TAB);
}
} else {
if (!browser) {
browser =
CreateApplicationWindow(profile_for_launch, *params, url, can_resize);
}
// Navigate application window to application's |url| if necessary. // Navigate application window to application's |url| if necessary.
// Help app always navigates because its url might not match the url inside // Help app always navigates because its url might not match the url inside
// the iframe, and the iframe's url is the one that matters. // the iframe, and the iframe's url is the one that matters.
web_contents = browser->tab_strip_model()->GetWebContentsAt(0); web_contents = browser->tab_strip_model()->GetWebContentsAt(0);
if (!web_contents || web_contents->GetURL() != url || if (!web_contents || web_contents->GetURL() != url ||
app_type == SystemAppType::HELP) { app_type == SystemAppType::HELP) {
web_contents = NavigateApplicationWindow( web_contents = NavigateWebApplicationWindow(
browser, *params, url, WindowOpenDisposition::CURRENT_TAB); browser, params->app_id, url, WindowOpenDisposition::CURRENT_TAB);
}
} }
// Send launch files. // Send launch files.
......
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