Commit 7e541959 authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

[CCA] Retained pinned status after migrating to SWA

This CL fixes a bug that the pinned status might be lost after migrating
CCA to SWA.

Bug: 1144678
Test: Manually

Change-Id: I9bf2fd846645a77d8b7a47cbd7b9afc043950943
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516659
Commit-Queue: Wei Lee <wtlee@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825255}
parent f30e2eb5
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "chrome/browser/unexpire_flags.h" #include "chrome/browser/unexpire_flags.h"
#include "chrome/browser/unexpire_flags_gen.h" #include "chrome/browser/unexpire_flags_gen.h"
#include "chrome/browser/video_tutorials/switches.h" #include "chrome/browser/video_tutorials/switches.h"
#include "chrome/browser/web_applications/components/external_app_install_features.h"
#include "chrome/common/buildflags.h" #include "chrome/common/buildflags.h"
#include "chrome/common/channel_info.h" #include "chrome/common/channel_info.h"
#include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_content_client.h"
...@@ -3761,7 +3762,7 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -3761,7 +3762,7 @@ const FeatureEntry kFeatureEntries[] = {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
{"camera-system-web-app", flag_descriptions::kCameraSystemWebAppName, {"camera-system-web-app", flag_descriptions::kCameraSystemWebAppName,
flag_descriptions::kCameraSystemWebAppDescription, kOsCrOS, flag_descriptions::kCameraSystemWebAppDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCameraSystemWebApp)}, FEATURE_VALUE_TYPE(web_app::kCameraSystemWebApp)},
{"crostini-gpu-support", flag_descriptions::kCrostiniGpuSupportName, {"crostini-gpu-support", flag_descriptions::kCrostiniGpuSupportName,
flag_descriptions::kCrostiniGpuSupportDescription, kOsCrOS, flag_descriptions::kCrostiniGpuSupportDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCrostiniGpuSupport)}, FEATURE_VALUE_TYPE(chromeos::features::kCrostiniGpuSupport)},
......
...@@ -7,17 +7,16 @@ ...@@ -7,17 +7,16 @@
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/web_applications/components/external_app_install_features.h"
#include "chrome/browser/web_applications/system_web_app_manager_browsertest.h" #include "chrome/browser/web_applications/system_web_app_manager_browsertest.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "chromeos/constants/chromeos_features.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
#include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_navigation_observer.h"
class CameraAppIntegrationTest : public SystemWebAppIntegrationTest { class CameraAppIntegrationTest : public SystemWebAppIntegrationTest {
public: public:
CameraAppIntegrationTest() { CameraAppIntegrationTest() {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(web_app::kCameraSystemWebApp);
{chromeos::features::kCameraSystemWebApp}, {});
} }
private: private:
......
...@@ -395,10 +395,8 @@ void ComponentLoader::AddKeyboardApp() { ...@@ -395,10 +395,8 @@ void ComponentLoader::AddKeyboardApp() {
} }
void ComponentLoader::AddChromeCameraApp() { void ComponentLoader::AddChromeCameraApp() {
if (base::FeatureList::IsEnabled(chromeos::features::kCameraSystemWebApp)) { // TODO(crbug.com/1135280): Remove all the logic here once CCA is fully
return; // migrated to SWA.
}
base::FilePath resources_path; base::FilePath resources_path;
if (base::PathService::Get(chrome::DIR_RESOURCES, &resources_path)) { if (base::PathService::Get(chrome::DIR_RESOURCES, &resources_path)) {
AddComponentFromDir(resources_path.Append(extension_misc::kCameraAppPath), AddComponentFromDir(resources_path.Append(extension_misc::kCameraAppPath),
......
...@@ -16,6 +16,9 @@ namespace { ...@@ -16,6 +16,9 @@ namespace {
constexpr const base::Feature* kExternalAppInstallFeatures[] = { constexpr const base::Feature* kExternalAppInstallFeatures[] = {
&kMigrateDefaultChromeAppToWebAppsGSuite, &kMigrateDefaultChromeAppToWebAppsGSuite,
&kMigrateDefaultChromeAppToWebAppsNonGSuite, &kMigrateDefaultChromeAppToWebAppsNonGSuite,
#if defined(OS_CHROMEOS)
&kCameraSystemWebApp
#endif // OS_CHROMEOS
}; };
bool g_always_enabled_for_testing = false; bool g_always_enabled_for_testing = false;
...@@ -34,6 +37,12 @@ const base::Feature kMigrateDefaultChromeAppToWebAppsNonGSuite{ ...@@ -34,6 +37,12 @@ const base::Feature kMigrateDefaultChromeAppToWebAppsNonGSuite{
"MigrateDefaultChromeAppToWebAppsNonGSuite", "MigrateDefaultChromeAppToWebAppsNonGSuite",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enable or disables running the Camera App as a System Web App.
const base::Feature kCameraSystemWebApp{"CameraSystemWebApp",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // OS_CHROMEOS
bool IsExternalAppInstallFeatureEnabled(base::StringPiece feature_name) { bool IsExternalAppInstallFeatureEnabled(base::StringPiece feature_name) {
if (g_always_enabled_for_testing) if (g_always_enabled_for_testing)
return true; return true;
......
...@@ -15,6 +15,10 @@ extern const base::Feature kMigrateDefaultChromeAppToWebAppsGSuite; ...@@ -15,6 +15,10 @@ extern const base::Feature kMigrateDefaultChromeAppToWebAppsGSuite;
extern const base::Feature kMigrateDefaultChromeAppToWebAppsNonGSuite; extern const base::Feature kMigrateDefaultChromeAppToWebAppsNonGSuite;
#if defined(OS_CHROMEOS)
extern const base::Feature kCameraSystemWebApp;
#endif // OS_CHROMEOS
// Returns the base::Feature in |kExternalAppInstallFeatures| that corresponds // Returns the base::Feature in |kExternalAppInstallFeatures| that corresponds
// to |feature_name|. Used by external app install configs to gate installation // to |feature_name|. Used by external app install configs to gate installation
// on features listed in |kExternalAppInstallFeatures|. // on features listed in |kExternalAppInstallFeatures|.
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "chrome/browser/chromeos/web_applications/scanning_system_web_app_info.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 "chrome/browser/chromeos/web_applications/terminal_system_web_app_info.h" #include "chrome/browser/chromeos/web_applications/terminal_system_web_app_info.h"
#include "chrome/browser/web_applications/components/external_app_install_features.h"
#include "chromeos/components/camera_app_ui/url_constants.h" #include "chromeos/components/camera_app_ui/url_constants.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h" #include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/components/help_app_ui/url_constants.h" #include "chromeos/components/help_app_ui/url_constants.h"
...@@ -337,8 +338,7 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) { ...@@ -337,8 +338,7 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) {
case SystemAppType::SETTINGS: case SystemAppType::SETTINGS:
return true; return true;
case SystemAppType::CAMERA: case SystemAppType::CAMERA:
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(web_app::kCameraSystemWebApp);
chromeos::features::kCameraSystemWebApp);
case SystemAppType::TERMINAL: case SystemAppType::TERMINAL:
return true; return true;
case SystemAppType::MEDIA: case SystemAppType::MEDIA:
......
...@@ -145,10 +145,6 @@ const base::Feature kBluetoothFixA2dpPacketSize{ ...@@ -145,10 +145,6 @@ const base::Feature kBluetoothFixA2dpPacketSize{
const base::Feature kBluetoothPhoneFilter{"BluetoothPhoneFilter", const base::Feature kBluetoothPhoneFilter{"BluetoothPhoneFilter",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enable or disables running the Camera App as a System Web App.
const base::Feature kCameraSystemWebApp{"CameraSystemWebApp",
base::FEATURE_DISABLED_BY_DEFAULT};
// If enabled, will use the CDM in the Chrome OS daemon rather than loading the // If enabled, will use the CDM in the Chrome OS daemon rather than loading the
// CDM using the library CDM interface. // CDM using the library CDM interface.
const base::Feature kCdmFactoryDaemon{"CdmFactoryDaemon", const base::Feature kCdmFactoryDaemon{"CdmFactoryDaemon",
......
...@@ -80,8 +80,6 @@ extern const base::Feature kBluetoothFixA2dpPacketSize; ...@@ -80,8 +80,6 @@ extern const base::Feature kBluetoothFixA2dpPacketSize;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kBluetoothPhoneFilter; extern const base::Feature kBluetoothPhoneFilter;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kCameraSystemWebApp;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kCdmFactoryDaemon; extern const base::Feature kCdmFactoryDaemon;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kChildSpecificSignin; extern const base::Feature kChildSpecificSignin;
......
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