fws: Make fws policy available to lacros
This CL exposes the floating workspace (fws) enabled policy to be
seen on the lacros side.
A followup CL will use this policy flag to tie some aspects of
Desk Profiles with fws to allow filtering of windows by profile.
Low-Coverage-Reason: TRIVIAL_CHANGE This is a renaming.
BUG=b:323015572
TEST=Manual Test and CQ Dryruns
Change-Id: I3e7afa27825f8b958989fb5bb3a15508cf74fc2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5263668
Reviewed-by: April Zhou <[email protected]>
Commit-Queue: Matthew Zhu <[email protected]>
Reviewed-by: Pavol Marko <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Reviewed-by: Cait Phillips <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1261318}
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_util.cc b/chrome/browser/ash/floating_workspace/floating_workspace_util.cc
index 706a5ebd..c592aa9c 100644
--- a/chrome/browser/ash/floating_workspace/floating_workspace_util.cc
+++ b/chrome/browser/ash/floating_workspace/floating_workspace_util.cc
@@ -16,6 +16,7 @@
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
+#include "components/policy/core/common/policy_pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"
@@ -41,7 +42,6 @@
namespace floating_workspace_util {
void RegisterProfilePrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(prefs::kFloatingWorkspaceEnabled, false);
registry->RegisterBooleanPref(prefs::kFloatingWorkspaceV2Enabled, false);
}
@@ -56,13 +56,15 @@
return false;
}
const PrefService::Preference* floating_workspace_pref =
- pref_service->FindPreference(prefs::kFloatingWorkspaceEnabled);
+ pref_service->FindPreference(
+ policy::policy_prefs::kFloatingWorkspaceEnabled);
DCHECK(floating_workspace_pref);
if (floating_workspace_pref->IsManaged()) {
// If there is a policy managing the pref, return what is set by policy.
- return pref_service->GetBoolean(prefs::kFloatingWorkspaceEnabled);
+ return pref_service->GetBoolean(
+ policy::policy_prefs::kFloatingWorkspaceEnabled);
}
// TODO(b/297795546): Remove external ash feature flag.
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
index 60ffc22c..59e8189 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -1011,6 +1011,10 @@
{ key::kWebPrintingBlockedForUrls,
prefs::kManagedWebPrintingBlockedForUrls,
base::Value::Type::LIST },
+ { key::kFloatingWorkspaceEnabled,
+ policy_prefs::kFloatingWorkspaceEnabled,
+ base::Value::Type::BOOLEAN
+ },
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -1531,9 +1535,6 @@
{ key::kProjectorDogfoodForFamilyLinkEnabled,
ash::prefs::kProjectorDogfoodForFamilyLinkEnabled,
base::Value::Type::BOOLEAN },
- { key::kFloatingWorkspaceEnabled,
- ash::prefs::kFloatingWorkspaceEnabled,
- base::Value::Type::BOOLEAN },
{ key::kFloatingWorkspaceV2Enabled,
ash::prefs::kFloatingWorkspaceV2Enabled,
base::Value::Type::BOOLEAN },
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 7f72246..c305241f 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1920,6 +1920,8 @@
registry->RegisterListPref(
chromeos::prefs::kKeepFullscreenWithoutNotificationUrlAllowList,
PrefRegistry::PUBLIC);
+ registry->RegisterBooleanPref(policy::policy_prefs::kFloatingWorkspaceEnabled,
+ false);
::reporting::RegisterProfilePrefs(registry);
#if BUILDFLAG(USE_CUPS)
extensions::PrintingAPIHandler::RegisterProfilePrefs(registry);