Prefs for tracking disabled extensions with OnTask
This change introduces a new list pref that OnTask components will use to track disabled extension ids in the user pref store. This is primarily needed to restore extensions to their previous state at the end of an OnTask session or if the device goes through a reboot cycle. Bug: b:365850329 Change-Id: Ib9a1ae96868af2b66bbf75d5ae0cb852ada68847 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5905657 Reviewed-by: April Zhou <aprilzhou@google.com> Reviewed-by: Matthew Zhu <zhumatthew@google.com> Commit-Queue: Vignesh Shenvi <vshenvi@google.com> Reviewed-by: Erik Chen <erikchen@chromium.org> Cr-Commit-Position: refs/heads/main@{#1364010}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
2ce933e311
commit
cb34fe338a
chrome/browser
chromeos/ash/components/boca/on_task
@ -5285,6 +5285,7 @@ static_library("browser") {
|
||||
"//chromeos/ash/components/audio",
|
||||
"//chromeos/ash/components/audio/public/mojom",
|
||||
"//chromeos/ash/components/boca",
|
||||
"//chromeos/ash/components/boca/on_task",
|
||||
"//chromeos/ash/components/browser_context_helper",
|
||||
"//chromeos/ash/components/carrier_lock",
|
||||
"//chromeos/ash/components/channel",
|
||||
|
@ -440,6 +440,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/reset_settings_handler.h"
|
||||
#include "chrome/browser/upgrade_detector/upgrade_detector_chromeos.h"
|
||||
#include "chromeos/ash/components/audio/audio_devices_pref_handler_impl.h"
|
||||
#include "chromeos/ash/components/boca/on_task/on_task_prefs.h"
|
||||
#include "chromeos/ash/components/local_search_service/search_metrics_reporter.h"
|
||||
#include "chromeos/ash/components/network/cellular_esim_profile_handler_impl.h"
|
||||
#include "chromeos/ash/components/network/cellular_metrics_logger.h"
|
||||
@ -2233,6 +2234,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
wallpaper_handlers::prefs::RegisterProfilePrefs(registry);
|
||||
ash::reporting::RegisterProfilePrefs(registry);
|
||||
ChromeMediaAppGuestUIDelegate::RegisterProfilePrefs(registry);
|
||||
ash::boca::RegisterOnTaskProfilePrefs(registry);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
|
@ -10,6 +10,8 @@ static_library("on_task") {
|
||||
sources = [
|
||||
"on_task_blocklist.cc",
|
||||
"on_task_blocklist.h",
|
||||
"on_task_prefs.cc",
|
||||
"on_task_prefs.h",
|
||||
"on_task_session_manager.cc",
|
||||
"on_task_session_manager.h",
|
||||
"on_task_system_web_app_manager.h",
|
||||
@ -22,6 +24,7 @@ static_library("on_task") {
|
||||
"//chromeos/ash/components/boca/proto",
|
||||
"//components/google/core/common",
|
||||
"//components/policy/core/browser",
|
||||
"//components/pref_registry",
|
||||
"//components/sessions",
|
||||
"//components/sessions:session_id",
|
||||
"//content/public/browser",
|
||||
|
20
chromeos/ash/components/boca/on_task/on_task_prefs.cc
Normal file
20
chromeos/ash/components/boca/on_task/on_task_prefs.cc
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright 2024 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chromeos/ash/components/boca/on_task/on_task_prefs.h"
|
||||
|
||||
#include "base/check.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
|
||||
namespace ash::boca {
|
||||
|
||||
// A list pref used to track disabled extensions for OnTask.
|
||||
const char kDisabledOnTaskExtensions[] = "boca.disabled_on_task_extensions";
|
||||
|
||||
void RegisterOnTaskProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
CHECK(registry);
|
||||
registry->RegisterListPref(kDisabledOnTaskExtensions);
|
||||
}
|
||||
|
||||
} // namespace ash::boca
|
21
chromeos/ash/components/boca/on_task/on_task_prefs.h
Normal file
21
chromeos/ash/components/boca/on_task/on_task_prefs.h
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2024 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROMEOS_ASH_COMPONENTS_BOCA_ON_TASK_ON_TASK_PREFS_H_
|
||||
#define CHROMEOS_ASH_COMPONENTS_BOCA_ON_TASK_ON_TASK_PREFS_H_
|
||||
|
||||
namespace user_prefs {
|
||||
class PrefRegistrySyncable;
|
||||
}
|
||||
|
||||
namespace ash::boca {
|
||||
|
||||
// A list pref used to track disabled extensions for OnTask.
|
||||
extern const char kDisabledOnTaskExtensions[];
|
||||
|
||||
void RegisterOnTaskProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
|
||||
|
||||
} // namespace ash::boca
|
||||
|
||||
#endif // CHROMEOS_ASH_COMPONENTS_BOCA_ON_TASK_ON_TASK_PREFS_H_
|
Reference in New Issue
Block a user