Commit 973843f3 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Revert "Convert scanning app to system web app (SWA)"

This reverts commit 29499d24.

Reason for revert: Broke the linux-chromeos-chrome bot.
https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/7735

Original change's description:
> Convert scanning app to system web app (SWA)
> 
> The SWA uses a temporary icon and is hidden behind a feature flag that
> is disabled by default.
> 
> Bug: 1059779
> Change-Id: I9cee9b2de42a49285a8ee5ba2877d6394a7ca5b2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348539
> Commit-Queue: Jesse Schettler <jschettler@chromium.org>
> Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
> Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
> Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#798367}

TBR=khorimoto@chromium.org,ortuno@chromium.org,jimmyxgong@chromium.org,jschettler@chromium.org

Change-Id: I63c9b0497c709def532c052a8c6bdc4eb8f0a200
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1059779
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358569Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798389}
parent 1eb679a0
...@@ -118,7 +118,6 @@ source_set("chromeos") { ...@@ -118,7 +118,6 @@ source_set("chromeos") {
"//chromeos/components/print_management/mojom", "//chromeos/components/print_management/mojom",
"//chromeos/components/proximity_auth", "//chromeos/components/proximity_auth",
"//chromeos/components/quick_answers/public/cpp:prefs", "//chromeos/components/quick_answers/public/cpp:prefs",
"//chromeos/components/scanning",
"//chromeos/components/smbfs", "//chromeos/components/smbfs",
"//chromeos/components/smbfs/mojom", "//chromeos/components/smbfs/mojom",
"//chromeos/components/string_matching", "//chromeos/components/string_matching",
...@@ -174,7 +173,6 @@ source_set("chromeos") { ...@@ -174,7 +173,6 @@ source_set("chromeos") {
"//chromeos/login/login_state", "//chromeos/login/login_state",
"//chromeos/login/session", "//chromeos/login/session",
"//chromeos/network", "//chromeos/network",
"//chromeos/resources:scanning_app_resources_grit",
"//chromeos/services/assistant/public/cpp", "//chromeos/services/assistant/public/cpp",
"//chromeos/services/cfm/public/buildflags", "//chromeos/services/cfm/public/buildflags",
"//chromeos/services/cros_healthd/public/cpp", "//chromeos/services/cros_healthd/public/cpp",
...@@ -2643,8 +2641,6 @@ source_set("chromeos") { ...@@ -2643,8 +2641,6 @@ source_set("chromeos") {
"web_applications/crosh_loader_factory.cc", "web_applications/crosh_loader_factory.cc",
"web_applications/crosh_loader_factory.h", "web_applications/crosh_loader_factory.h",
"web_applications/default_web_app_ids.h", "web_applications/default_web_app_ids.h",
"web_applications/scanning_system_web_app_info.cc",
"web_applications/scanning_system_web_app_info.h",
"web_applications/system_web_app_install_utils.cc", "web_applications/system_web_app_install_utils.cc",
"web_applications/system_web_app_install_utils.h", "web_applications/system_web_app_install_utils.h",
"web_applications/terminal_source.cc", "web_applications/terminal_source.cc",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chromeos/web_applications/system_web_app_integration_test.h"
#include "chrome/browser/web_applications/system_web_app_manager.h"
#include "chromeos/components/scanning/url_constants.h"
#include "chromeos/constants/chromeos_features.h"
#include "content/public/test/browser_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
class ScanningAppIntegrationTest : public SystemWebAppIntegrationTest {
public:
ScanningAppIntegrationTest() {
scoped_feature_list_.InitWithFeatures({chromeos::features::kScanningUI},
{});
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
// Test that the Scanning App installs and launches correctly by running some
// spot checks on the manifest.
IN_PROC_BROWSER_TEST_P(ScanningAppIntegrationTest, ScanningAppInLauncher) {
const GURL url(chromeos::kChromeUIScanningAppUrl);
EXPECT_NO_FATAL_FAILURE(
ExpectSystemWebAppValid(web_app::SystemAppType::SCANNING, url, "Scan"));
}
INSTANTIATE_TEST_SUITE_P(All,
ScanningAppIntegrationTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/web_applications/scanning_system_web_app_info.h"
#include <memory>
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/web_applications/system_web_app_install_utils.h"
#include "chrome/common/web_application_info.h"
#include "chromeos/components/scanning/url_constants.h"
#include "chromeos/grit/chromeos_scanning_app_resources.h"
#include "third_party/blink/public/mojom/manifest/display_mode.mojom.h"
#include "url/gurl.h"
std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForScanningSystemWebApp() {
std::unique_ptr<WebApplicationInfo> info =
std::make_unique<WebApplicationInfo>();
info->app_url = GURL(chromeos::kChromeUIScanningAppUrl);
info->scope = GURL(chromeos::kChromeUIScanningAppUrl);
// TODO(jschettler): |title| should come from a resource string once the
// string is finalized.
info->title = base::UTF8ToUTF16("Scan");
web_app::CreateIconInfoForSystemWebApp(info->app_url, "app_icon_192.png", 192,
IDR_SCANNING_APP_ICON, *info);
info->theme_color = 0xFFFFFFFF;
info->background_color = 0xFFFFFFFF;
info->display_mode = blink::mojom::DisplayMode::kStandalone;
info->open_as_window = true;
return info;
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_SCANNING_SYSTEM_WEB_APP_INFO_H_
#define CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_SCANNING_SYSTEM_WEB_APP_INFO_H_
#include <memory>
struct WebApplicationInfo;
// Returns a WebApplicationInfo used to install the app.
std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForScanningSystemWebApp();
#endif // CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_SCANNING_SYSTEM_WEB_APP_INFO_H_
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.h" #include "chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/chromeos/web_applications/default_web_app_ids.h" #include "chrome/browser/chromeos/web_applications/default_web_app_ids.h"
#include "chrome/browser/chromeos/web_applications/scanning_system_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/terminal_source.h" #include "chrome/browser/chromeos/web_applications/terminal_source.h"
#include "chromeos/components/help_app_ui/url_constants.h" #include "chromeos/components/help_app_ui/url_constants.h"
#include "chromeos/components/media_app_ui/url_constants.h" #include "chromeos/components/media_app_ui/url_constants.h"
...@@ -167,13 +166,6 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() { ...@@ -167,13 +166,6 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() {
infos.at(SystemAppType::PRINT_MANAGEMENT).minimum_window_size = {600, 320}; infos.at(SystemAppType::PRINT_MANAGEMENT).minimum_window_size = {600, 320};
} }
if (SystemWebAppManager::IsAppEnabled(SystemAppType::SCANNING)) {
infos.emplace(SystemAppType::SCANNING,
SystemAppInfo("Scanning", GURL("chrome://scanning"),
base::BindRepeating(
&CreateWebAppInfoForScanningSystemWebApp)));
}
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
if (SystemWebAppManager::IsAppEnabled(SystemAppType::TELEMETRY)) { if (SystemWebAppManager::IsAppEnabled(SystemAppType::TELEMETRY)) {
infos.emplace(SystemAppType::TELEMETRY, infos.emplace(SystemAppType::TELEMETRY,
...@@ -305,8 +297,6 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) { ...@@ -305,8 +297,6 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) {
case SystemAppType::PRINT_MANAGEMENT: case SystemAppType::PRINT_MANAGEMENT:
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
chromeos::features::kPrintJobManagementApp); chromeos::features::kPrintJobManagementApp);
case SystemAppType::SCANNING:
return base::FeatureList::IsEnabled(chromeos::features::kScanningUI);
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
case SystemAppType::TELEMETRY: case SystemAppType::TELEMETRY:
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
......
...@@ -54,7 +54,6 @@ enum class SystemAppType { ...@@ -54,7 +54,6 @@ enum class SystemAppType {
MEDIA, MEDIA,
HELP, HELP,
PRINT_MANAGEMENT, PRINT_MANAGEMENT,
SCANNING,
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
TELEMETRY, TELEMETRY,
SAMPLE, SAMPLE,
......
...@@ -2498,7 +2498,6 @@ if (!is_android) { ...@@ -2498,7 +2498,6 @@ if (!is_android) {
"../browser/chromeos/web_applications/help_app_integration_browsertest.cc", "../browser/chromeos/web_applications/help_app_integration_browsertest.cc",
"../browser/chromeos/web_applications/media_app_integration_browsertest.cc", "../browser/chromeos/web_applications/media_app_integration_browsertest.cc",
"../browser/chromeos/web_applications/print_management_app_integration_browsertest.cc", "../browser/chromeos/web_applications/print_management_app_integration_browsertest.cc",
"../browser/chromeos/web_applications/scanning_app_integration_browsertest.cc",
"../browser/chromeos/web_applications/settings_app_integration_browsertest.cc", "../browser/chromeos/web_applications/settings_app_integration_browsertest.cc",
"../browser/chromeos/web_applications/system_web_app_integration_test.cc", "../browser/chromeos/web_applications/system_web_app_integration_test.cc",
"../browser/chromeos/web_applications/system_web_app_integration_test.h", "../browser/chromeos/web_applications/system_web_app_integration_test.h",
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<!-- Privileged app host contents. --> <!-- Privileged app host contents. -->
<include name="IDR_SCANNING_APP_INDEX_HTML" file="index.html" type="BINDATA" compress="gzip" /> <include name="IDR_SCANNING_APP_INDEX_HTML" file="index.html" type="BINDATA" compress="gzip" />
<include name="IDR_SCANNING_APP_JS" file="${root_gen_dir}/chromeos/components/scanning/resources/scanning_app.js" use_base_dir="false" compress="gzip" type="BINDATA"/> <include name="IDR_SCANNING_APP_JS" file="${root_gen_dir}/chromeos/components/scanning/resources/scanning_app.js" use_base_dir="false" compress="gzip" type="BINDATA"/>
<include name="IDR_SCANNING_APP_ICON" file="app_icon_192.png" type="BINDATA" />
</includes> </includes>
</release> </release>
</grit> </grit>
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