summaryrefslogtreecommitdiff
path: root/chromium/chrome/common
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/chrome/common
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/common')
-rw-r--r--chromium/chrome/common/BUILD.gn8
-rw-r--r--chromium/chrome/common/DEPS4
-rw-r--r--chromium/chrome/common/OWNERS6
-rw-r--r--chromium/chrome/common/apps/platform_apps/BUILD.gn3
-rw-r--r--chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.cc30
-rw-r--r--chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.h11
-rw-r--r--chromium/chrome/common/apps/platform_apps/chrome_apps_messages.h15
-rw-r--r--chromium/chrome/common/apps/platform_apps/media_galleries_permission.h1
-rw-r--r--chromium/chrome/common/apps/platform_apps/media_galleries_permission_unittest.cc2
-rw-r--r--chromium/chrome/common/cart/commerce_hints.mojom22
-rw-r--r--chromium/chrome/common/chrome_content_client.cc37
-rw-r--r--chromium/chrome/common/chrome_content_client.h10
-rw-r--r--chromium/chrome/common/chrome_features.cc140
-rw-r--r--chromium/chrome/common/chrome_features.h89
-rw-r--r--chromium/chrome/common/chrome_paths.cc28
-rw-r--r--chromium/chrome/common/chrome_paths.h9
-rw-r--r--chromium/chrome/common/chrome_paths_lacros.cc37
-rw-r--r--chromium/chrome/common/chrome_paths_lacros.h6
-rw-r--r--chromium/chrome/common/chrome_switches.cc34
-rw-r--r--chromium/chrome/common/chrome_switches.h7
-rw-r--r--chromium/chrome/common/chromeos/extensions/api/diagnostics.idl22
-rw-r--r--chromium/chrome/common/chromeos/extensions/api/telemetry.idl22
-rw-r--r--chromium/chrome/common/chromeos/extensions/chromeos_system_extension_info_unittest.cc2
-rw-r--r--chromium/chrome/common/cloud_print/BUILD.gn20
-rw-r--r--chromium/chrome/common/cloud_print/DIR_METADATA3
-rw-r--r--chromium/chrome/common/cloud_print/OWNERS3
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_constants.cc78
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_constants.h135
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_helpers.cc242
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_helpers.h86
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_helpers_unittest.cc130
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_proxy_info.cc14
-rw-r--r--chromium/chrome/common/cloud_print/cloud_print_proxy_info.h24
-rw-r--r--chromium/chrome/common/conflicts/module_watcher_win.cc1
-rw-r--r--chromium/chrome/common/crash_keys.cc5
-rw-r--r--chromium/chrome/common/extensions/api/BUILD.gn2
-rw-r--r--chromium/chrome/common/extensions/api/_api_features.json12
-rw-r--r--chromium/chrome/common/extensions/api/_features.md4
-rw-r--r--chromium/chrome/common/extensions/api/_permission_features.json21
-rw-r--r--chromium/chrome/common/extensions/api/accessibility_private.json4
-rw-r--r--chromium/chrome/common/extensions/api/autotest_private.idl69
-rw-r--r--chromium/chrome/common/extensions/api/common_extension_api_unittest.cc18
-rw-r--r--chromium/chrome/common/extensions/api/developer_private.idl16
-rw-r--r--chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc15
-rw-r--r--chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h6
-rw-r--r--chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc16
-rw-r--r--chromium/chrome/common/extensions/api/file_manager_private.idl17
-rw-r--r--chromium/chrome/common/extensions/api/input_method_private.json13
-rw-r--r--chromium/chrome/common/extensions/api/login.idl70
-rw-r--r--chromium/chrome/common/extensions/api/page_action.json79
-rw-r--r--chromium/chrome/common/extensions/api/passwords_private.idl21
-rw-r--r--chromium/chrome/common/extensions/api/platform_keys.idl2
-rw-r--r--chromium/chrome/common/extensions/api/processes.idl6
-rw-r--r--chromium/chrome/common/extensions/api/scripting.idl17
-rw-r--r--chromium/chrome/common/extensions/api/speech/tts_engine_manifest_handler_unittest.cc2
-rw-r--r--chromium/chrome/common/extensions/api/system_indicator.idl3
-rw-r--r--chromium/chrome/common/extensions/api/tabs.json12
-rw-r--r--chromium/chrome/common/extensions/api/terminal_private.json89
-rw-r--r--chromium/chrome/common/extensions/api/tts.json69
-rw-r--r--chromium/chrome/common/extensions/api/web_authentication_proxy.idl27
-rw-r--r--chromium/chrome/common/extensions/api/web_navigation.json5
-rw-r--r--chromium/chrome/common/extensions/api/webview_tag.json2
-rw-r--r--chromium/chrome/common/extensions/api/wm_desks_private.idl2
-rw-r--r--chromium/chrome/common/extensions/command.cc6
-rw-r--r--chromium/chrome/common/extensions/command_unittest.cc11
-rw-r--r--chromium/chrome/common/extensions/extension_constants.cc2
-rw-r--r--chromium/chrome/common/extensions/extension_constants.h3
-rw-r--r--chromium/chrome/common/extensions/extension_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/manifest_handlers/app_launch_info.cc9
-rw-r--r--chromium/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc3
-rw-r--r--chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_about_unittest.cc3
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc3
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc3
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc13
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc7
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc3
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_update_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/extension_manifests_web_unittest.cc6
-rw-r--r--chromium/chrome/common/extensions/manifest_tests/permissions_parser_unittest.cc69
-rw-r--r--chromium/chrome/common/extensions/permissions/chrome_api_permissions.cc1
-rw-r--r--chromium/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc8
-rw-r--r--chromium/chrome/common/extensions/permissions/permission_set_unittest.cc5
-rw-r--r--chromium/chrome/common/extensions/permissions/permissions_data_unittest.cc2
-rw-r--r--chromium/chrome/common/features.gni13
-rw-r--r--chromium/chrome/common/importer/firefox_importer_utils_unittest.cc5
-rw-r--r--chromium/chrome/common/importer/profile_import_process_param_traits.h1
-rw-r--r--chromium/chrome/common/media/cdm_host_file_path.cc9
-rw-r--r--chromium/chrome/common/media/cdm_registration.cc19
-rw-r--r--chromium/chrome/common/multi_process_lock.h33
-rw-r--r--chromium/chrome/common/multi_process_lock_linux.cc112
-rw-r--r--chromium/chrome/common/multi_process_lock_mac.cc60
-rw-r--r--chromium/chrome/common/multi_process_lock_unittest.cc165
-rw-r--r--chromium/chrome/common/multi_process_lock_win.cc64
-rw-r--r--chromium/chrome/common/net/BUILD.gn1
-rw-r--r--chromium/chrome/common/net/x509_certificate_model.cc811
-rw-r--r--chromium/chrome/common/net/x509_certificate_model.h116
-rw-r--r--chromium/chrome/common/net/x509_certificate_model_nss.h5
-rw-r--r--chromium/chrome/common/net/x509_certificate_model_unittest.cc371
-rw-r--r--chromium/chrome/common/notifications/notification_image_retainer.cc1
-rw-r--r--chromium/chrome/common/ppapi_utils.cc5
-rw-r--r--chromium/chrome/common/pref_font_webkit_names.h1
-rw-r--r--chromium/chrome/common/pref_names.cc83
-rw-r--r--chromium/chrome/common/pref_names.h28
-rw-r--r--chromium/chrome/common/printing/printer_capabilities.h6
-rw-r--r--chromium/chrome/common/printing/printer_capabilities_unittest.cc1
-rw-r--r--chromium/chrome/common/profiler/thread_profiler.cc41
-rw-r--r--chromium/chrome/common/profiler/thread_profiler_browsertest.cc32
-rw-r--r--chromium/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc24
-rw-r--r--chromium/chrome/common/renderer_configuration.mojom4
-rw-r--r--chromium/chrome/common/safe_browsing/archive_analyzer_results.cc5
-rw-r--r--chromium/chrome/common/safe_browsing/zip_analyzer.cc11
-rw-r--r--chromium/chrome/common/url_constants.cc29
-rw-r--r--chromium/chrome/common/url_constants.h23
-rw-r--r--chromium/chrome/common/webui_url_constants.cc70
-rw-r--r--chromium/chrome/common/webui_url_constants.h37
118 files changed, 2376 insertions, 1897 deletions
diff --git a/chromium/chrome/common/BUILD.gn b/chromium/chrome/common/BUILD.gn
index e1dd4b21c37..ae37955102c 100644
--- a/chromium/chrome/common/BUILD.gn
+++ b/chromium/chrome/common/BUILD.gn
@@ -124,7 +124,6 @@ static_library("common") {
"media/media_resource_provider.cc",
"media/media_resource_provider.h",
"media_galleries/metadata_types.h",
- "multi_process_lock.h",
"pdf_util.cc",
"pdf_util.h",
"pref_names_util.cc",
@@ -183,6 +182,8 @@ static_library("common") {
"//components/favicon_base",
"//components/flags_ui:switches",
"//components/gcm_driver/common",
+ "//components/history_clusters/core:history_clusters_buildflags",
+ "//components/history_clusters/history_clusters_internals/webui",
"//components/metrics",
"//components/metrics:net",
"//components/nacl/common:buildflags",
@@ -194,6 +195,7 @@ static_library("common") {
"//components/offline_pages/buildflags",
"//components/offline_pages/core:switches",
"//components/omnibox/common",
+ "//components/optimization_guide/optimization_guide_internals/webui",
"//components/page_load_metrics/common:page_load_metrics_mojom",
"//components/password_manager/core/common",
"//components/policy:generated",
@@ -345,7 +347,6 @@ static_library("common") {
"mac/launchd.mm",
"mac/service_management.h",
"mac/service_management.mm",
- "multi_process_lock_mac.cc",
]
public_deps += [ ":app_mode_app_support" ]
}
@@ -372,7 +373,6 @@ static_library("common") {
# Printing.
if (enable_basic_printing) {
public_deps += [
- "//chrome/common/cloud_print",
"//components/printing/common",
"//printing",
]
@@ -396,7 +396,6 @@ static_library("common") {
"conflicts/module_watcher_win.h",
"conflicts/remote_module_watcher_win.cc",
"conflicts/remote_module_watcher_win.h",
- "multi_process_lock_win.cc",
"protobuf_init.cc",
"protobuf_init.h",
]
@@ -462,7 +461,6 @@ static_library("common") {
sources += [
"auto_start_linux.cc",
"auto_start_linux.h",
- "multi_process_lock_linux.cc",
]
deps += [ "//sandbox/linux:sandbox_services" ]
}
diff --git a/chromium/chrome/common/DEPS b/chromium/chrome/common/DEPS
index ca59a4b15d2..bdb652a467a 100644
--- a/chromium/chrome/common/DEPS
+++ b/chromium/chrome/common/DEPS
@@ -13,6 +13,8 @@ include_rules = [
"+components/cloud_devices/common",
"+components/content_settings/core/common",
"+components/crash/core/app",
+ "+components/history_clusters",
+ "+components/optimization_guide/optimization_guide_internals/webui",
"+components/crash/core/common",
"+components/crx_file",
"+components/data_reduction_proxy/core/common",
@@ -76,4 +78,4 @@ specific_include_rules = {
"logging_chrome.cc": [
"+ash/constants/ash_switches.h",
]
-}
+} \ No newline at end of file
diff --git a/chromium/chrome/common/OWNERS b/chromium/chrome/common/OWNERS
index 964402a7552..03035c6f2a1 100644
--- a/chromium/chrome/common/OWNERS
+++ b/chromium/chrome/common/OWNERS
@@ -34,9 +34,11 @@ per-file chrome_content_client_constants.h=*
per-file chrome_content_client.h=*
per-file chrome_content_client_unittest.cc=*
+# Lacros
+per-file *_lacros*=file://chromeos/LACROS_OWNERS
+
# Pepper files.
-per-file pepper_*=raymes@chromium.org
-per-file pepper_*=dschuff@chromium.org
+per-file pepper_*=file://ppapi/OWNERS
# Other stuff.
per-file autocomplete_match_type.*=mpearson@chromium.org
diff --git a/chromium/chrome/common/apps/platform_apps/BUILD.gn b/chromium/chrome/common/apps/platform_apps/BUILD.gn
index f94a5b24de0..ba7eaeffd44 100644
--- a/chromium/chrome/common/apps/platform_apps/BUILD.gn
+++ b/chromium/chrome/common/apps/platform_apps/BUILD.gn
@@ -13,9 +13,6 @@ source_set("platform_apps") {
"chrome_apps_api_permissions.h",
"chrome_apps_api_provider.cc",
"chrome_apps_api_provider.h",
- "chrome_apps_message_generator.cc",
- "chrome_apps_message_generator.h",
- "chrome_apps_messages.h",
"media_galleries_permission.cc",
"media_galleries_permission.h",
"media_galleries_permission_data.cc",
diff --git a/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.cc b/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.cc
deleted file mode 100644
index e22ff4b8edd..00000000000
--- a/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2018 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.
-
-// Get basic type definitions.
-#define IPC_MESSAGE_IMPL
-#include "chrome/common/apps/platform_apps/chrome_apps_message_generator.h"
-
-// Generate constructors.
-#include "ipc/struct_constructor_macros.h"
-#include "chrome/common/apps/platform_apps/chrome_apps_message_generator.h"
-
-// Generate param traits write methods.
-#include "ipc/param_traits_write_macros.h"
-namespace IPC {
-#include "chrome/common/apps/platform_apps/chrome_apps_message_generator.h"
-} // namespace IPC
-
-// Generate param traits read methods.
-#include "ipc/param_traits_read_macros.h"
-namespace IPC {
-#include "chrome/common/apps/platform_apps/chrome_apps_message_generator.h"
-} // namespace IPC
-
-// Generate param traits log methods.
-#include "ipc/param_traits_log_macros.h"
-namespace IPC {
-#include "chrome/common/apps/platform_apps/chrome_apps_message_generator.h"
-} // namespace IPC
-
diff --git a/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.h b/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.h
deleted file mode 100644
index 1903b73d9b5..00000000000
--- a/chromium/chrome/common/apps/platform_apps/chrome_apps_message_generator.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018 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.
-
-// Multiply-included file, hence no include guard.
-
-#undef CHROME_COMMON_APPS_PLATFORM_APPS_CHROME_APPS_MESSAGES_H_
-#include "chrome/common/apps/platform_apps/chrome_apps_messages.h"
-#ifndef CHROME_COMMON_APPS_PLATFORM_APPS_CHROME_APPS_MESSAGES_H_
-#error "Failed to include header chrome/common/apps/platform_apps/chrome_apps_messages.h"
-#endif
diff --git a/chromium/chrome/common/apps/platform_apps/chrome_apps_messages.h b/chromium/chrome/common/apps/platform_apps/chrome_apps_messages.h
deleted file mode 100644
index f8138b4fc56..00000000000
--- a/chromium/chrome/common/apps/platform_apps/chrome_apps_messages.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2018 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_COMMON_APPS_PLATFORM_APPS_CHROME_APPS_MESSAGES_H_
-#define CHROME_COMMON_APPS_PLATFORM_APPS_CHROME_APPS_MESSAGES_H_
-
-#include "chrome/common/apps/platform_apps/media_galleries_permission_data.h"
-#include "ipc/ipc_message_macros.h"
-
-IPC_STRUCT_TRAITS_BEGIN(chrome_apps::MediaGalleriesPermissionData)
- IPC_STRUCT_TRAITS_MEMBER(permission())
-IPC_STRUCT_TRAITS_END()
-
-#endif // CHROME_COMMON_APPS_PLATFORM_APPS_CHROME_APPS_MESSAGES_H_
diff --git a/chromium/chrome/common/apps/platform_apps/media_galleries_permission.h b/chromium/chrome/common/apps/platform_apps/media_galleries_permission.h
index c5792fdab85..8feea8a0962 100644
--- a/chromium/chrome/common/apps/platform_apps/media_galleries_permission.h
+++ b/chromium/chrome/common/apps/platform_apps/media_galleries_permission.h
@@ -5,7 +5,6 @@
#ifndef CHROME_COMMON_APPS_PLATFORM_APPS_MEDIA_GALLERIES_PERMISSION_H_
#define CHROME_COMMON_APPS_PLATFORM_APPS_MEDIA_GALLERIES_PERMISSION_H_
-#include "chrome/common/apps/platform_apps/chrome_apps_messages.h"
#include "chrome/common/apps/platform_apps/media_galleries_permission_data.h"
#include "extensions/common/permissions/api_permission.h"
#include "extensions/common/permissions/set_disjunction_permission.h"
diff --git a/chromium/chrome/common/apps/platform_apps/media_galleries_permission_unittest.cc b/chromium/chrome/common/apps/platform_apps/media_galleries_permission_unittest.cc
index eafe3173e8d..310e30d20bf 100644
--- a/chromium/chrome/common/apps/platform_apps/media_galleries_permission_unittest.cc
+++ b/chromium/chrome/common/apps/platform_apps/media_galleries_permission_unittest.cc
@@ -13,8 +13,6 @@
#include "extensions/common/permissions/permissions_info.h"
#include "testing/gtest/include/gtest/gtest.h"
-using content::SocketPermissionRequest;
-using extensions::SocketPermissionData;
using extensions::mojom::APIPermissionID;
namespace chrome_apps {
diff --git a/chromium/chrome/common/cart/commerce_hints.mojom b/chromium/chrome/common/cart/commerce_hints.mojom
index 787d4c4c8a5..ac511792152 100644
--- a/chromium/chrome/common/cart/commerce_hints.mojom
+++ b/chromium/chrome/common/cart/commerce_hints.mojom
@@ -15,6 +15,15 @@ struct Product {
string product_id;
};
+struct Heuristics {
+ // Version number of the heuristics.
+ string version_number;
+ // JSON string of hint heuristics.
+ string hint_json_data;
+ // JSON string of global heuristics.
+ string global_json_data;
+};
+
// This service is implemented in the browser process and is used by the
// renderer to notify the CommerceHint events.
interface CommerceHintObserver {
@@ -40,7 +49,14 @@ interface CommerceHintObserver {
// An XMLHttpRequest is about to be sent.
OnWillSendRequest(bool is_addtocart);
- // A navigation is about to happen or has happened. Return whether
- // we should skip collecting commerce hints on current URL or not.
- OnNavigation(url.mojom.Url url) => (bool should_skip);
+ // A navigation is about to happen or has happened. Return whether we
+ // should skip collecting commerce hints on current domain or not, and
+ // the commerce heuristics that are applicable in this domain.
+ OnNavigation(url.mojom.Url url, string version_number)
+ => (bool should_skip, Heuristics heuristics);
+
+ // A cart content extraction is about to happen. Return JSON that
+ // contains product ID extraction heuristics and a JS script for cart
+ // content extraction.
+ OnCartExtraction() => (string product_id_json, string cart_extraction_script);
};
diff --git a/chromium/chrome/common/chrome_content_client.cc b/chromium/chrome/common/chrome_content_client.cc
index 9d66b770765..eeeb1f4b6fd 100644
--- a/chromium/chrome/common/chrome_content_client.cc
+++ b/chromium/chrome/common/chrome_content_client.cc
@@ -102,12 +102,6 @@ namespace {
#if BUILDFLAG(ENABLE_PDF)
const char kPDFPluginExtension[] = "pdf";
const char kPDFPluginDescription[] = "Portable Document Format";
-const uint32_t kPDFPluginPermissions = ppapi::PERMISSION_PDF |
- ppapi::PERMISSION_DEV;
-
-content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface;
-content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module;
-content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module;
#endif // BUILDFLAG(ENABLE_PDF)
#if BUILDFLAG(ENABLE_NACL)
@@ -123,6 +117,8 @@ content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module;
// regular plugins).
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
#if BUILDFLAG(ENABLE_PDF)
+ // TODO(thestig): Figure out how to make the PDF Viewer work without this
+ // PPAPI plugin registration.
content::PepperPluginInfo pdf_info;
pdf_info.is_internal = true;
pdf_info.is_out_of_process = true;
@@ -132,10 +128,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
content::WebPluginMimeType pdf_mime_type(
pdf::kInternalPluginMimeType, kPDFPluginExtension, kPDFPluginDescription);
pdf_info.mime_types.push_back(pdf_mime_type);
- pdf_info.internal_entry_points.get_interface = g_pdf_get_interface;
- pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module;
- pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module;
- pdf_info.permissions = kPDFPluginPermissions;
plugins->push_back(pdf_info);
#endif // BUILDFLAG(ENABLE_PDF)
@@ -185,17 +177,6 @@ void ChromeContentClient::SetNaClEntryFunctions(
}
#endif
-#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_PDF)
-void ChromeContentClient::SetPDFEntryFunctions(
- content::PepperPluginInfo::GetInterfaceFunc get_interface,
- content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
- content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
- g_pdf_get_interface = get_interface;
- g_pdf_initialize_module = initialize_module;
- g_pdf_shutdown_module = shutdown_module;
-}
-#endif
-
void ChromeContentClient::SetActiveURL(const GURL& url,
std::string top_origin) {
static crash_reporter::CrashKeyString<1024> active_url("url-chunk");
@@ -358,6 +339,11 @@ base::RefCountedMemory* ChromeContentClient::GetDataResourceBytes(
resource_id);
}
+std::string ChromeContentClient::GetDataResourceString(int resource_id) {
+ return ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
+ resource_id);
+}
+
gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) {
return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
resource_id);
@@ -424,12 +410,3 @@ void ChromeContentClient::ExposeInterfacesToBrowser(
}),
io_task_runner);
}
-
-std::u16string ChromeContentClient::GetLocalizedProtocolName(
- const std::string& protocol) {
- if (protocol == "mailto")
- return GetLocalizedString(IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME);
- if (protocol == "webcal")
- return GetLocalizedString(IDS_REGISTER_PROTOCOL_HANDLER_WEBCAL_NAME);
- return ContentClient::GetLocalizedProtocolName(protocol);
-}
diff --git a/chromium/chrome/common/chrome_content_client.h b/chromium/chrome/common/chrome_content_client.h
index 77a7c208de4..e27016c3929 100644
--- a/chromium/chrome/common/chrome_content_client.h
+++ b/chromium/chrome/common/chrome_content_client.h
@@ -17,7 +17,6 @@
#include "chrome/common/buildflags.h"
#include "components/nacl/common/buildflags.h"
#include "content/public/common/content_client.h"
-#include "pdf/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -59,13 +58,6 @@ class ChromeContentClient : public content::ContentClient {
content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module);
#endif
-#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_PDF)
- static void SetPDFEntryFunctions(
- content::PepperPluginInfo::GetInterfaceFunc get_interface,
- content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
- content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module);
-#endif
-
#if BUILDFLAG(ENABLE_PLUGINS)
// This returns the most recent plugin based on the plugin versions. In the
// event of a tie, a debug plugin will be considered more recent than a
@@ -88,11 +80,11 @@ class ChromeContentClient : public content::ContentClient {
std::u16string GetLocalizedString(int message_id) override;
std::u16string GetLocalizedString(int message_id,
const std::u16string& replacement) override;
- std::u16string GetLocalizedProtocolName(const std::string& protocol) override;
base::StringPiece GetDataResource(
int resource_id,
ui::ResourceScaleFactor scale_factor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
+ std::string GetDataResourceString(int resource_id) override;
gfx::Image& GetNativeImageNamed(int resource_id) override;
#if BUILDFLAG(IS_MAC)
base::FilePath GetChildProcessPath(
diff --git a/chromium/chrome/common/chrome_features.cc b/chromium/chrome/common/chrome_features.cc
index e9c636bcb54..abbc47cac25 100644
--- a/chromium/chrome/common/chrome_features.cc
+++ b/chromium/chrome/common/chrome_features.cc
@@ -30,12 +30,6 @@ const base::Feature kAdaptiveScreenBrightnessLogging{
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
-// Shows a setting that allows disabling mouse acceleration.
-const base::Feature kAllowDisableMouseAcceleration{
- "AllowDisableMouseAcceleration", base::FEATURE_ENABLED_BY_DEFAULT};
-#endif
-
-#if BUILDFLAG(IS_CHROMEOS_ASH)
// Shows settings to adjust and disable touchpad haptic feedback.
const base::Feature kAllowDisableTouchpadHapticFeedback{
"AllowDisableTouchpadHapticFeedback", base::FEATURE_ENABLED_BY_DEFAULT};
@@ -67,6 +61,11 @@ const base::Feature kAppManagementAppDetails{"AppManagementAppDetails",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+const base::Feature kAppProvisioningStatic{"AppProvisioningStatic",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
#if !BUILDFLAG(IS_ANDROID)
// App Service related flags. See components/services/app_service/README.md.
const base::Feature kAppServiceLoadIconWithoutMojom{
@@ -142,14 +141,6 @@ const base::Feature kBorealis{"Borealis", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kChangePictureVideoMode{"ChangePictureVideoMode",
base::FEATURE_ENABLED_BY_DEFAULT};
-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
-// Controls whether Chrome Apps are supported. See https://crbug.com/1221251.
-// If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome
-// Apps will not launch and will be marked in the UI as deprecated.
-const base::Feature kChromeAppsDeprecation{"ChromeAppsDeprecation",
- base::FEATURE_DISABLED_BY_DEFAULT};
-#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
-
const base::Feature kClientStorageAccessContextAuditing{
"ClientStorageAccessContextAuditing", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -270,12 +261,17 @@ const base::Feature kDesktopPWAsCacheDuringDefaultInstall{
// Generates customised default offline page that is shown when web app is
// offline if no custom page is provided by developer.
+#if BUILDFLAG(IS_ANDROID)
+const base::Feature kAndroidPWAsDefaultOfflinePage{
+ "AndroidPWAsDefaultOfflinePage", base::FEATURE_DISABLED_BY_DEFAULT};
+#else
const base::Feature kDesktopPWAsDefaultOfflinePage{
"DesktopPWAsDefaultOfflinePage", base::FEATURE_DISABLED_BY_DEFAULT};
+#endif // BUILDFLAG(IS_ANDROID)
// Moves the Extensions "puzzle piece" icon from the title bar into the app menu
// for web app windows.
-const base::Feature kDesktopPWAsElidedExtensionsMenu{
+const base::Feature kDesktopPWAsElidedExtensionsMenu {
"DesktopPWAsElidedExtensionsMenu",
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
@@ -284,6 +280,10 @@ const base::Feature kDesktopPWAsElidedExtensionsMenu{
#endif
};
+// Whether to parse and enforce the WebAppSettings policy.
+const base::Feature kDesktopPWAsEnforceWebAppSettingsPolicy{
+ "DesktopPWAsEnforceWebAppSettingsPolicy", base::FEATURE_ENABLED_BY_DEFAULT};
+
// Replaces the origin text flash and the icon in web app notifications with
// the name of the app and the icon of the app.
const base::Feature kDesktopPWAsNotificationIconAndTitle {
@@ -305,12 +305,6 @@ const base::Feature kDesktopPWAsRunOnOsLogin {
#endif
};
-// Makes user navigations via links within web app scopes get captured tab
-// tabbed app windows.
-// TODO(crbug.com/897314): Enable this feature.
-const base::Feature kDesktopPWAsTabStripLinkCapturing{
- "DesktopPWAsTabStripLinkCapturing", base::FEATURE_DISABLED_BY_DEFAULT};
-
// Adds a user settings that allows PWAs to be opened with a tab strip.
const base::Feature kDesktopPWAsTabStripSettings{
"DesktopPWAsTabStripSettings", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -324,6 +318,15 @@ const base::Feature kDesktopPWAsWebBundles{"DesktopPWAsWebBundles",
// Serves web app settings at chrome://app-settings/<app-id>.
const base::Feature kDesktopPWAsWebAppSettingsPage{
"DesktopPWAsWebAppSettingsPage", base::FEATURE_ENABLED_BY_DEFAULT};
+// Controls whether Chrome Apps are supported. See https://crbug.com/1221251.
+// If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome
+// Apps will not launch and will be marked in the UI as deprecated.
+const base::Feature kChromeAppsDeprecation{"ChromeAppsDeprecation",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+// Controls whether force installed and preinstalled apps should be exempt from
+// deprecation.
+const base::Feature kKeepForceInstalledPreinstalledApps{
+ "KeepForceInstalledPreinstalledApps", base::FEATURE_DISABLED_BY_DEFAULT};
#endif
// Enable DNS over HTTPS (DoH).
@@ -337,12 +340,6 @@ const base::Feature kDnsOverHttps {
#endif
};
-// Provides a mechanism to remove providers from the dropdown list in the
-// settings UI. Separate multiple provider ids with commas. See the
-// mapping in net/dns/dns_util.cc for provider ids.
-const base::FeatureParam<std::string> kDnsOverHttpsDisabledProvidersParam{
- &kDnsOverHttps, "DisabledProviders", ""};
-
// Set whether fallback to insecure DNS is allowed by default. This setting may
// be overridden for individual transactions.
const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
@@ -384,14 +381,14 @@ const base::Feature kEarlyLibraryLoad{"EarlyLibraryLoad",
// of the Looper's queue.
const base::Feature kElidePrioritizationOfPreNativeBootstrapTasks = {
"ElidePrioritizationOfPreNativeBootstrapTasks",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
#endif
#if BUILDFLAG(IS_ANDROID)
// Under this flag tab preloading at startup will be elided (i.e., not
// performed).
const base::Feature kElideTabPreloadAtStartup = {
- "ElideTabPreloadAtStartup", base::FEATURE_DISABLED_BY_DEFAULT};
+ "ElideTabPreloadAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
// Enables all registered system web apps, regardless of their respective
@@ -399,12 +396,6 @@ const base::Feature kElideTabPreloadAtStartup = {
const base::Feature kEnableAllSystemWebApps{"EnableAllSystemWebApps",
base::FEATURE_DISABLED_BY_DEFAULT};
-#if BUILDFLAG(IS_WIN)
-// Enables users to create a desktop shortcut for incognito mode.
-const base::Feature kEnableIncognitoShortcutOnDesktop{
- "EnableIncognitoShortcutOnDesktop", base::FEATURE_DISABLED_BY_DEFAULT};
-#endif
-
// Enable the restricted web APIs for high-trusted apps.
const base::Feature kEnableRestrictedWebApis{"EnableRestrictedWebApis",
base::FEATURE_ENABLED_BY_DEFAULT};
@@ -417,7 +408,7 @@ const base::Feature kEnableWebAppUninstallFromOsSettings{
// Lazy initialize IndividualSettings for extensions from enterprise policy
// that are not installed.
const base::Feature kExtensionDeferredIndividualSettings{
- "ExtensionDeferredIndividualSettings", base::FEATURE_DISABLED_BY_DEFAULT};
+ "ExtensionDeferredIndividualSettings", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
// Controls whether the user justification text field is visible on the
@@ -538,6 +529,10 @@ const base::Feature kHappinessTrackingSurveysForDesktopNtpModules{
"HappinessTrackingSurveysForDesktopNtpModules",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kHappinessTrackingSurveysForNtpPhotosOptOut{
+ "HappinessTrackingSurveysForrNtpPhotosOptOut",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Enables or disables the Happiness Tracking System for Chrome What's New.
const base::Feature kHappinessTrackingSurveysForDesktopWhatsNew{
"HappinessTrackingSurveysForDesktopWhatsNew",
@@ -577,6 +572,18 @@ const base::Feature kHappinessTrackingSystemArcGames{
// Enables or disables the Happiness Tracking System for Audio survey.
const base::Feature kHappinessTrackingSystemAudio{
"HappinessTrackingAudio", base::FEATURE_DISABLED_BY_DEFAULT};
+// Enables the Happiness Tracking System for Personalization Avatar survey.
+const base::Feature kHappinessTrackingPersonalizationAvatar{
+ "HappinessTrackingPersonalizationAvatar",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+// Enables the Happiness Tracking System for Personalization Screensaver survey.
+const base::Feature kHappinessTrackingPersonalizationScreensaver{
+ "HappinessTrackingPersonalizationScreensaver",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+// Enables the Happiness Tracking System for Personalization Wallpaper survey.
+const base::Feature kHappinessTrackingPersonalizationWallpaper{
+ "HappinessTrackingPersonalizationWallpaper",
+ base::FEATURE_DISABLED_BY_DEFAULT};
#endif
// Hides the origin text from showing up briefly in WebApp windows.
@@ -623,20 +630,6 @@ const base::Feature kIncognitoBrandConsistencyForAndroid{
const base::Feature kIncognitoNtpRevamp{"IncognitoNtpRevamp",
base::FEATURE_DISABLED_BY_DEFAULT};
-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
-// When enabled, removes any theme or background customization done by the user
-// on the Incognito UI.
-const base::Feature kIncognitoBrandConsistencyForDesktop{
- "IncognitoBrandConsistencyForDesktop", base::FEATURE_ENABLED_BY_DEFAULT};
-
-// When enabled, clear browsing data option would be enabled in Incognito which
-// upon clicking would show a dialog to close all Incognito windows.
-const base::Feature kIncognitoClearBrowsingDataDialogForDesktop{
- "IncognitoClearBrowsingDataDialogForDesktop",
- base::FEATURE_ENABLED_BY_DEFAULT};
-#endif
-
// When enabled, removes any entry points to the history UI from Incognito mode.
const base::Feature kUpdateHistoryEntryPointsInIncognito{
"UpdateHistoryEntryPointsInIncognito", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -653,11 +646,6 @@ const base::Feature kKernelnextVMs{"KernelnextVMs",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif
-#if !BUILDFLAG(IS_ANDROID)
-const base::Feature kLinkCapturingUiUpdate{"LinkCapturingUiUpdate",
- base::FEATURE_DISABLED_BY_DEFAULT};
-#endif
-
#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
const base::Feature kLinuxLowMemoryMonitor{"LinuxLowMemoryMonitor",
@@ -836,18 +824,25 @@ const base::Feature kPrefixWebAppWindowsWithAppName{
const base::Feature kPrerenderFallbackToPreconnect{
"PrerenderFallbackToPreconnect", base::FEATURE_ENABLED_BY_DEFAULT};
-// Enables additional contextual entry points to privacy settings.
-const base::Feature kPrivacyAdvisor{"PrivacyAdvisor",
- base::FEATURE_DISABLED_BY_DEFAULT};
-
const base::Feature kPrivacyGuide{"PrivacyGuide",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kPrivacyGuide2{"PrivacyGuide2",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Enables or disables push subscriptions keeping Chrome running in the
// background when closed.
const base::Feature kPushMessagingBackgroundMode{
"PushMessagingBackgroundMode", base::FEATURE_DISABLED_BY_DEFAULT};
+// Shows a confirmation dialog when updates to a PWAs icon has been detected.
+const base::Feature kPwaUpdateDialogForIcon{"PwaUpdateDialogForIcon",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Shows a confirmation dialog when updates to a PWAs name has been detected.
+const base::Feature kPwaUpdateDialogForName{"PwaUpdateDialogForName",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Enables using quiet prompts for notification permission requests.
const base::Feature kQuietNotificationPrompts{"QuietNotificationPrompts",
base::FEATURE_ENABLED_BY_DEFAULT};
@@ -862,8 +857,8 @@ const base::Feature kAbusiveNotificationPermissionRevocation{
"AbusiveOriginNotificationPermissionRevocation",
base::FEATURE_ENABLED_BY_DEFAULT};
-const base::Feature kRemoveStatusBarInWebApps{
- "RemoveStatusBarInWebApps",
+const base::Feature kRemoveStatusBarInWebApps {
+ "RemoveStatusBarInWebApps",
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
@@ -924,9 +919,6 @@ const base::FeatureParam<base::TimeDelta> kSCTLogMaxIngestionRandomDelay{
base::Hours(1),
};
-const base::Feature kSearchHistoryLink{"SearchHistoryLink",
- base::FEATURE_ENABLED_BY_DEFAULT};
-
// Controls whether the user is prompted when sites request attestation.
const base::Feature kSecurityKeyAttestationPrompt{
"SecurityKeyAttestationPrompt", base::FEATURE_ENABLED_BY_DEFAULT};
@@ -936,20 +928,6 @@ const base::Feature kSharesheetCopyToClipboard{
"SharesheetCopyToClipboard", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
-#if BUILDFLAG(IS_ANDROID)
-const base::Feature kShareUsageRanking{"ShareUsageRanking",
- base::FEATURE_ENABLED_BY_DEFAULT};
-const base::Feature kShareUsageRankingFixedMore{
- "ShareUsageRankingFixedMore", base::FEATURE_ENABLED_BY_DEFAULT};
-#endif
-
-#if BUILDFLAG(IS_MAC)
-// Enables the "this OS is obsolete" infobar on Mac 10.10.
-// TODO(ellyjones): Remove this after the last 10.10 release.
-const base::Feature kShow10_10ObsoleteInfobar{
- "Show1010ObsoleteInfobar", base::FEATURE_DISABLED_BY_DEFAULT};
-#endif // BUILDFLAG(IS_MAC)
-
// Alternative to switches::kSitePerProcess, for turning on full site isolation.
// Launch bug: https://crbug.com/810843. This is a //chrome-layer feature to
// avoid turning on site-per-process by default for *all* //content embedders
@@ -1137,6 +1115,12 @@ const base::Feature kWebAppManifestPolicyAppIdentityUpdate{
#if BUILDFLAG(IS_CHROMEOS_ASH)
// When this feature flag is enabled together with the LacrosAvailability
+// policy, the Chrome app Kiosk session uses Lacros-chrome as the web browser to
+// launch Chrome apps. When disabled, the Ash-chrome will be used instead.
+const base::Feature kChromeKioskEnableLacros{"ChromeKioskEnableLacros",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// When this feature flag is enabled together with the LacrosAvailability
// policy, the web (PWA) Kiosk session uses Lacros-chrome as the web browser to
// launch web (PWA) applications. When disabled, the Ash-chrome will be used
// instead.
diff --git a/chromium/chrome/common/chrome_features.h b/chromium/chrome/common/chrome_features.h
index 01e4ac7f7fd..73c06883d9e 100644
--- a/chromium/chrome/common/chrome_features.h
+++ b/chromium/chrome/common/chrome_features.h
@@ -11,6 +11,7 @@
#include "base/component_export.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
@@ -37,11 +38,6 @@ extern const base::Feature kAdaptiveScreenBrightnessLogging;
#if BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kAllowDisableMouseAcceleration;
-#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-
-#if BUILDFLAG(IS_CHROMEOS_ASH)
-COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAllowDisableTouchpadHapticFeedback;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -68,6 +64,11 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppManagementAppDetails;
#endif
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kAppProvisioningStatic;
+#endif
+
#if !BUILDFLAG(IS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppServiceLoadIconWithoutMojom;
@@ -121,11 +122,6 @@ extern const base::Feature kBrowserAppInstanceTracking;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kChangePictureVideoMode;
-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kChromeAppsDeprecation;
-#endif
-
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kClientStorageAccessContextAuditing;
@@ -194,13 +190,21 @@ extern const base::Feature kDesktopPWAsAdditionalWindowingControls;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsCacheDuringDefaultInstall;
+#if BUILDFLAG(IS_ANDROID)
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kAndroidPWAsDefaultOfflinePage;
+#else
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsDefaultOfflinePage;
+#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsElidedExtensionsMenu;
COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kDesktopPWAsEnforceWebAppSettingsPolicy;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsFlashAppNameInsteadOfOrigin;
COMPONENT_EXPORT(CHROME_FEATURES)
@@ -222,6 +226,10 @@ extern const base::Feature kDesktopPWAsWebBundles;
BUILDFLAG(IS_FUCHSIA)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsWebAppSettingsPage;
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kChromeAppsDeprecation;
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kKeepForceInstalledPreinstalledApps;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
@@ -233,8 +241,6 @@ extern const base::FeatureParam<bool> kDnsOverHttpsShowUiParam;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam;
COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::FeatureParam<std::string>
- kDnsOverHttpsDisabledProvidersParam;
#if BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(CHROME_FEATURES)
@@ -265,11 +271,6 @@ extern const base::Feature kEnableAmbientAuthenticationInGuestSession;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEnableAmbientAuthenticationInIncognito;
-#if BUILDFLAG(IS_WIN)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kEnableIncognitoShortcutOnDesktop;
-#endif
-
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEnableRestrictedWebApis;
@@ -341,6 +342,8 @@ extern const base::FeatureParam<base::TimeDelta>
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSurveysForDesktopNtpModules;
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kHappinessTrackingSurveysForNtpPhotosOptOut;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSurveysForDesktopWhatsNew;
@@ -392,6 +395,16 @@ extern const base::Feature kHappinessTrackingSystemArcGames;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSystemAudio;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kHappinessTrackingPersonalizationAvatar;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kHappinessTrackingPersonalizationScreensaver;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kHappinessTrackingPersonalizationWallpaper;
+
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
@@ -424,15 +437,6 @@ extern const base::Feature kIncognitoBrandConsistencyForAndroid;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kIncognitoNtpRevamp;
-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kIncognitoBrandConsistencyForDesktop;
-
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kIncognitoClearBrowsingDataDialogForDesktop;
-#endif
-
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUpdateHistoryEntryPointsInIncognito;
@@ -447,11 +451,6 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kKernelnextVMs;
#endif
-#if !BUILDFLAG(IS_ANDROID)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kLinkCapturingUiUpdate;
-#endif
-
#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLinuxLowMemoryMonitor;
@@ -575,15 +574,21 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPrerenderFallbackToPreconnect;
COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kPrivacyAdvisor;
+extern const base::Feature kPrivacyGuide;
COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kPrivacyGuide;
+extern const base::Feature kPrivacyGuide2;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPushMessagingBackgroundMode;
COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kPwaUpdateDialogForIcon;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kPwaUpdateDialogForName;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuietNotificationPrompts;
COMPONENT_EXPORT(CHROME_FEATURES)
@@ -622,9 +627,6 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::FeatureParam<base::TimeDelta> kSCTLogMaxIngestionRandomDelay;
COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kSearchHistoryLink;
-
-COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSecurityKeyAttestationPrompt;
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -632,18 +634,6 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSharesheetCopyToClipboard;
#endif
-#if BUILDFLAG(IS_ANDROID)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kShareUsageRanking;
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kShareUsageRankingFixedMore;
-#endif
-
-#if BUILDFLAG(IS_MAC)
-COMPONENT_EXPORT(CHROME_FEATURES)
-extern const base::Feature kShow10_10ObsoleteInfobar;
-#endif // BUILDFLAG(IS_MAC)
-
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kSitePerProcess;
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -788,6 +778,9 @@ COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWebAppsCrosapi;
COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kChromeKioskEnableLacros;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWebKioskEnableLacros;
#endif
diff --git a/chromium/chrome/common/chrome_paths.cc b/chromium/chrome/common/chrome_paths.cc
index 97f406b0a04..311ac9bfe05 100644
--- a/chromium/chrome/common/chrome_paths.cc
+++ b/chromium/chrome/common/chrome_paths.cc
@@ -42,6 +42,10 @@
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
#endif
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
+#include "chrome/common/chrome_paths_lacros.h" // nogncheck
+#endif
+
namespace {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -362,6 +366,24 @@ bool PathProvider(int key, base::FilePath* result) {
#endif
break;
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
+ case chrome::FILE_FALLBACK_RESOURCES_PACK:
+ if (!GetDefaultUserDataDirectory(&cur))
+ return false;
+ cur = cur.Append(FILE_PATH_LITERAL("resources_fallback.pak"));
+ break;
+ case chrome::FILE_ASH_RESOURCES_PACK:
+ if (!chrome::GetAshResourcesPath(&cur))
+ return false;
+ cur = cur.Append("resources.pak");
+ break;
+ case chrome::FILE_RESOURCES_MAP:
+ if (!GetDefaultUserDataDirectory(&cur))
+ return false;
+ cur = cur.Append(FILE_PATH_LITERAL("resources.map"));
+ break;
+#endif
+
#if BUILDFLAG(IS_CHROMEOS_ASH)
case chrome::DIR_CHROMEOS_WALLPAPERS:
if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur))
@@ -448,7 +470,6 @@ bool PathProvider(int key, base::FilePath* result) {
cur = cur.Append(FILE_PATH_LITERAL("Google"))
.Append(FILE_PATH_LITERAL("Chrome"))
.Append(FILE_PATH_LITERAL("External Extensions"));
- create_dir = false;
#else
if (!base::PathService::Get(base::DIR_MODULE, &cur))
return false;
@@ -512,11 +533,9 @@ bool PathProvider(int key, base::FilePath* result) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
case chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION:
cur = base::FilePath(kChromeOSTPMFirmwareUpdateLocation);
- create_dir = false;
break;
case chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA:
cur = base::FilePath(kChromeOSTPMFirmwareUpdateSRKVulnerableROCA);
- create_dir = false;
break;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
case chrome::DIR_OPTIMIZATION_GUIDE_PREDICTION_MODELS:
@@ -532,8 +551,7 @@ bool PathProvider(int key, base::FilePath* result) {
// TODO(bauerb): http://crbug.com/259796
base::ThreadRestrictions::ScopedAllowIO allow_io;
- if (create_dir && !base::PathExists(cur) &&
- !base::CreateDirectory(cur))
+ if (create_dir && !base::PathExists(cur) && !base::CreateDirectory(cur))
return false;
*result = cur;
diff --git a/chromium/chrome/common/chrome_paths.h b/chromium/chrome/common/chrome_paths.h
index 751f3a6ebcc..ac143faebfc 100644
--- a/chromium/chrome/common/chrome_paths.h
+++ b/chromium/chrome/common/chrome_paths.h
@@ -94,6 +94,15 @@ enum {
// This includes data for internal pages (e.g., html
// files and images), unless these resources are
// purposefully split into a separate file.
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
+ FILE_FALLBACK_RESOURCES_PACK, // Full path to the fallback.pak file
+ // containing binary data. This includes
+ // resources in FILE_RESOURCES_PACK which are
+ // not included in ASH_RESOURCES_PACK.
+ FILE_ASH_RESOURCES_PACK, // Full path to ash resources.pak file.
+ FILE_RESOURCES_MAP, // Full path to mapping table which maps
+ // lacros resources id to ash resources.
+#endif
FILE_DEV_UI_RESOURCES_PACK, // Full path to the .pak file containing
// binary data for internal pages (e.g., html
// files and images).
diff --git a/chromium/chrome/common/chrome_paths_lacros.cc b/chromium/chrome/common/chrome_paths_lacros.cc
index 1545a49ec56..f7e5a929b80 100644
--- a/chromium/chrome/common/chrome_paths_lacros.cc
+++ b/chromium/chrome/common/chrome_paths_lacros.cc
@@ -24,6 +24,8 @@ struct DefaultPaths {
base::FilePath removable_media_dir;
base::FilePath android_files_dir;
base::FilePath linux_files_dir;
+ base::FilePath ash_resources_dir;
+ base::FilePath share_cache_dir;
};
DefaultPaths& GetDefaultPaths() {
@@ -38,7 +40,9 @@ void SetLacrosDefaultPaths(const base::FilePath& documents_dir,
const base::FilePath& drivefs,
const base::FilePath& removable_media_dir,
const base::FilePath& android_files_dir,
- const base::FilePath& linux_files_dir) {
+ const base::FilePath& linux_files_dir,
+ const base::FilePath& ash_resources_dir,
+ const base::FilePath& share_cache_dir) {
DCHECK(!documents_dir.empty());
DCHECK(documents_dir.IsAbsolute());
GetDefaultPaths().documents_dir = documents_dir;
@@ -51,6 +55,8 @@ void SetLacrosDefaultPaths(const base::FilePath& documents_dir,
GetDefaultPaths().removable_media_dir = removable_media_dir;
GetDefaultPaths().android_files_dir = android_files_dir;
GetDefaultPaths().linux_files_dir = linux_files_dir;
+ GetDefaultPaths().ash_resources_dir = ash_resources_dir;
+ GetDefaultPaths().share_cache_dir = share_cache_dir;
}
void SetLacrosDefaultPathsFromInitParams(
@@ -71,10 +77,17 @@ void SetLacrosDefaultPathsFromInitParams(
base::FilePath linux_files_dir;
if (init_params->default_paths->linux_files.has_value())
linux_files_dir = init_params->default_paths->linux_files.value();
- chrome::SetLacrosDefaultPaths(init_params->default_paths->documents,
- init_params->default_paths->downloads,
- drivefs_dir, removable_media_dir,
- android_files_dir, linux_files_dir);
+ base::FilePath ash_resources_dir;
+ if (init_params->default_paths->ash_resources.has_value())
+ ash_resources_dir = init_params->default_paths->ash_resources.value();
+ base::FilePath share_cache_dir;
+ if (init_params->default_paths->share_cache.has_value())
+ share_cache_dir = init_params->default_paths->share_cache.value();
+
+ chrome::SetLacrosDefaultPaths(
+ init_params->default_paths->documents,
+ init_params->default_paths->downloads, drivefs_dir, removable_media_dir,
+ android_files_dir, linux_files_dir, ash_resources_dir, share_cache_dir);
}
}
@@ -170,4 +183,18 @@ bool GetLinuxFilesPath(base::FilePath* result) {
return true;
}
+bool GetAshResourcesPath(base::FilePath* result) {
+ if (GetDefaultPaths().ash_resources_dir.empty())
+ return false;
+ *result = GetDefaultPaths().ash_resources_dir;
+ return true;
+}
+
+bool GetShareCachePath(base::FilePath* result) {
+ if (GetDefaultPaths().share_cache_dir.empty())
+ return false;
+ *result = GetDefaultPaths().share_cache_dir;
+ return true;
+}
+
} // namespace chrome
diff --git a/chromium/chrome/common/chrome_paths_lacros.h b/chromium/chrome/common/chrome_paths_lacros.h
index 87f6ce3f460..b31b75f3764 100644
--- a/chromium/chrome/common/chrome_paths_lacros.h
+++ b/chromium/chrome/common/chrome_paths_lacros.h
@@ -22,7 +22,9 @@ void SetLacrosDefaultPaths(const base::FilePath& documents_dir,
const base::FilePath& drivefs,
const base::FilePath& removable_media_dir,
const base::FilePath& android_files_dir,
- const base::FilePath& linux_files_dir);
+ const base::FilePath& linux_files_dir,
+ const base::FilePath& ash_resources_dir,
+ const base::FilePath& share_cache_dir);
// Sets the default paths from BrowserInitParams received from ash on startup.
void SetLacrosDefaultPathsFromInitParams(
@@ -40,6 +42,8 @@ bool GetDriveFsMountPointPath(base::FilePath* result);
bool GetRemovableMediaPath(base::FilePath* result);
bool GetAndroidFilesPath(base::FilePath* result);
bool GetLinuxFilesPath(base::FilePath* result);
+bool GetAshResourcesPath(base::FilePath* result);
+bool GetShareCachePath(base::FilePath* result);
} // namespace chrome
#endif // CHROME_COMMON_CHROME_PATHS_LACROS_H_
diff --git a/chromium/chrome/common/chrome_switches.cc b/chromium/chrome/common/chrome_switches.cc
index ea6b3943cfb..e99b41bb748 100644
--- a/chromium/chrome/common/chrome_switches.cc
+++ b/chromium/chrome/common/chrome_switches.cc
@@ -115,22 +115,6 @@ const char kCheckForUpdateIntervalSec[] = "check-for-update-interval";
// Comma-separated list of SSL cipher suites to disable.
const char kCipherSuiteBlacklist[] = "cipher-suite-blacklist";
-// Tells chrome to display the cloud print dialog and upload the specified file
-// for printing.
-const char kCloudPrintFile[] = "cloud-print-file";
-
-// Specifies the mime type to be used when uploading data from the file
-// referenced by cloud-print-file. Defaults to "application/pdf" if
-// unspecified.
-const char kCloudPrintFileType[] = "cloud-print-file-type";
-
-// Used with kCloudPrintFile to specify a title for the resulting print job.
-const char kCloudPrintJobTitle[] = "cloud-print-job-title";
-
-// Used with kCloudPrintFile to specify a JSON print ticket for the resulting
-// print job. Defaults to null if unspecified.
-const char kCloudPrintPrintTicket[] = "cloud-print-print-ticket";
-
// Comma-separated list of BrowserThreads that cause browser process to crash if
// the given browser thread is not responsive. UI/IO are the BrowserThreads that
// are supported.
@@ -196,7 +180,7 @@ const char kDisableComponentUpdate[] = "disable-component-update";
// Disables installation of default apps on first run. This is used during
// automated testing.
-const char kDisablePreinstalledApps[] = "disable-default-apps";
+const char kDisableDefaultApps[] = "disable-default-apps";
// Disables Domain Reliability Monitoring.
const char kDisableDomainReliability[] = "disable-domain-reliability";
@@ -311,6 +295,11 @@ const char kForceAppMode[] = "force-app-mode";
// whether or not it's actually the First Run (this overrides kNoFirstRun).
const char kForceFirstRun[] = "force-first-run";
+// Displays the What's New experience when the browser is started if it has not
+// yet been shown for the current milestone (this overrides kNoFirstRun, without
+// showing the First Run experience).
+const char kForceWhatsNew[] = "force-whats-new";
+
// Does not show the crash restore bubble when the browser is started during the
// system startup phase in ChromeOS, if the ChromeOS full restore feature is
// enabled, because the ChromeOS full restore notification is shown for the user
@@ -377,10 +366,13 @@ const char kNoDefaultBrowserCheck[] = "no-default-browser-check";
// then restart chrome without this switch again.
const char kNoExperiments[] = "no-experiments";
-// Skip First Run tasks, whether or not it's actually the First Run. Overridden
-// by kForceFirstRun. This does not drop the First Run sentinel and thus doesn't
-// prevent first run from occuring the next time chrome is launched without this
-// flag.
+// Skip First Run tasks, whether or not it's actually the First Run, and the
+// What's New page. Overridden by kForceFirstRun (for FRE) and kForceWhatsNew
+// (for What's New). This does not drop the First Run sentinel and thus doesn't
+// prevent first run from occurring the next time chrome is launched without
+// this flag. It also does not update the last What's New milestone, so does not
+// prevent What's New from occurring the next time chrome is launched without
+// this flag.
const char kNoFirstRun[] = "no-first-run";
// Don't send hyperlink auditing pings
diff --git a/chromium/chrome/common/chrome_switches.h b/chromium/chrome/common/chrome_switches.h
index 717c7e09b39..f079aad00ce 100644
--- a/chromium/chrome/common/chrome_switches.h
+++ b/chromium/chrome/common/chrome_switches.h
@@ -57,10 +57,6 @@ extern const char kAutoSelectDesktopCaptureSource[];
extern const char kAutoSelectTabCaptureSourceByTitle[];
extern const char kCheckForUpdateIntervalSec[];
extern const char kCipherSuiteBlacklist[];
-extern const char kCloudPrintFile[];
-extern const char kCloudPrintFileType[];
-extern const char kCloudPrintJobTitle[];
-extern const char kCloudPrintPrintTicket[];
extern const char kCrashOnHangThreads[];
extern const char kCreateBrowserOnStartupForTests[];
extern const char kCustomDevtoolsFrontend[];
@@ -74,7 +70,7 @@ extern const char kDisableBackgroundNetworking[];
extern const char kDisableClientSidePhishingDetection[];
extern const char kDisableComponentExtensionsWithBackgroundPages[];
extern const char kDisableComponentUpdate[];
-extern const char kDisablePreinstalledApps[];
+extern const char kDisableDefaultApps[];
extern const char kDisableDomainReliability[];
extern const char kDisableExtensions[];
extern const char kDisableExtensionsExcept[];
@@ -105,6 +101,7 @@ extern const char kExtensionsInstallVerification[];
extern const char kExtensionsNotWebstore[];
extern const char kForceAppMode[];
extern const char kForceFirstRun[];
+extern const char kForceWhatsNew[];
extern const char kHideCrashRestoreBubble[];
extern const char kHomePage[];
extern const char kIncognito[];
diff --git a/chromium/chrome/common/chromeos/extensions/api/diagnostics.idl b/chromium/chrome/common/chromeos/extensions/api/diagnostics.idl
index bcf5bab3bbd..d011f9dec6b 100644
--- a/chromium/chrome/common/chromeos/extensions/api/diagnostics.idl
+++ b/chromium/chrome/common/chromeos/extensions/api/diagnostics.idl
@@ -17,9 +17,11 @@ namespace os.diagnostics {
cpu_floating_point_accuracy,
cpu_prime_search,
cpu_stress,
+ disk_read,
memory,
nvme_wear_level,
- smartctl_check
+ smartctl_check,
+ lan_connectivity
};
enum RoutineStatus {
@@ -51,6 +53,11 @@ namespace os.diagnostics {
plug_in_ac_power
};
+ enum DiskReadRoutineType {
+ linear,
+ random
+ };
+
dictionary GetAvailableRoutinesResponse {
RoutineType[] routines;
};
@@ -85,6 +92,12 @@ namespace os.diagnostics {
long length_seconds;
};
+ dictionary RunDiskReadRequest {
+ DiskReadRoutineType type;
+ long length_seconds;
+ long file_size_mb;
+ };
+
dictionary RunNvmeWearLevelRequest {
long wear_level_threshold;
};
@@ -139,6 +152,13 @@ namespace os.diagnostics {
[supportsPromises] static void runCpuStressRoutine(RunCpuRoutineRequest request,
RunRoutineCallback callback);
+ // Starts disk read routine.
+ [supportsPromises] static void runDiskReadRoutine(RunDiskReadRequest request,
+ RunRoutineCallback callback);
+
+ // Starts LAN connectivitty routine.
+ [supportsPromises] static void runLanConnectivityRoutine(RunRoutineCallback callback);
+
// Starts memory routine.
[supportsPromises] static void runMemoryRoutine(RunRoutineCallback callback);
diff --git a/chromium/chrome/common/chromeos/extensions/api/telemetry.idl b/chromium/chrome/common/chromeos/extensions/api/telemetry.idl
index 77e30fe4558..e6e6428a90b 100644
--- a/chromium/chrome/common/chromeos/extensions/api/telemetry.idl
+++ b/chromium/chrome/common/chromeos/extensions/api/telemetry.idl
@@ -77,6 +77,25 @@ namespace os.telemetry {
callback CpuInfoCallback = void (CpuInfo cpuInfo);
+ dictionary BatteryInfo {
+ double? cycleCount;
+ double? voltageNow;
+ DOMString? vendor;
+ DOMString? serialNumber;
+ double? chargeFullDesign;
+ double? chargeFull;
+ double? voltageMinDesign;
+ DOMString? modelName;
+ double? chargeNow;
+ double? currentNow;
+ DOMString? technology;
+ DOMString? status;
+ DOMString? manufactureDate;
+ double? temperature;
+ };
+
+ callback BatteryInfoCallback = void (BatteryInfo batteryInfo);
+
interface Functions {
// Retrieves VPD info.
[supportsPromises] static void getVpdInfo(VpdInfoCallback callback);
@@ -87,5 +106,8 @@ namespace os.telemetry {
[supportsPromises] static void getMemoryInfo(MemoryInfoCallback callback);
[supportsPromises] static void getCpuInfo(CpuInfoCallback callback);
+
+ // Retrieves battery info.
+ [supportsPromises] static void getBatteryInfo(BatteryInfoCallback callback);
};
};
diff --git a/chromium/chrome/common/chromeos/extensions/chromeos_system_extension_info_unittest.cc b/chromium/chrome/common/chromeos/extensions/chromeos_system_extension_info_unittest.cc
index 9726596865a..4722008f6b1 100644
--- a/chromium/chrome/common/chromeos/extensions/chromeos_system_extension_info_unittest.cc
+++ b/chromium/chrome/common/chromeos/extensions/chromeos_system_extension_info_unittest.cc
@@ -8,7 +8,7 @@
#include "testing/gtest/include/gtest/gtest.h"
TEST(ChromeOSSystemExtensionInfo, AllowlistedExtensionsSizeEqualsToOne) {
- ASSERT_EQ(2, chromeos::GetChromeOSSystemExtensionInfosSize());
+ ASSERT_EQ(2u, chromeos::GetChromeOSSystemExtensionInfosSize());
}
TEST(ChromeOSSystemExtensionInfo, GoogleExtension) {
diff --git a/chromium/chrome/common/cloud_print/BUILD.gn b/chromium/chrome/common/cloud_print/BUILD.gn
deleted file mode 100644
index 33104b58951..00000000000
--- a/chromium/chrome/common/cloud_print/BUILD.gn
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2017 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.
-
-source_set("cloud_print") {
- sources = [
- "cloud_print_constants.cc",
- "cloud_print_constants.h",
- "cloud_print_helpers.cc",
- "cloud_print_helpers.h",
- "cloud_print_proxy_info.cc",
- "cloud_print_proxy_info.h",
- ]
- deps = [
- "//base",
- "//chrome/common:channel_info",
- "//net",
- "//printing",
- ]
-}
diff --git a/chromium/chrome/common/cloud_print/DIR_METADATA b/chromium/chrome/common/cloud_print/DIR_METADATA
deleted file mode 100644
index 67273c4779a..00000000000
--- a/chromium/chrome/common/cloud_print/DIR_METADATA
+++ /dev/null
@@ -1,3 +0,0 @@
-monorail: {
- component: "Services>CloudPrint"
-}
diff --git a/chromium/chrome/common/cloud_print/OWNERS b/chromium/chrome/common/cloud_print/OWNERS
deleted file mode 100644
index a3afacdb4d1..00000000000
--- a/chromium/chrome/common/cloud_print/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This is for the common case of adding or renaming files. If you're doing
-# structural changes, use usual OWNERS rules.
-per-file BUILD.gn=*
diff --git a/chromium/chrome/common/cloud_print/cloud_print_constants.cc b/chromium/chrome/common/cloud_print/cloud_print_constants.cc
deleted file mode 100644
index 3fed5924351..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_constants.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2012 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/common/cloud_print/cloud_print_constants.h"
-
-namespace cloud_print {
-
-const char kCloudPrintUserAgent[] = "GoogleCloudPrintProxy";
-const char kChromeCloudPrintProxyHeaderName[] = "X-CloudPrint-Proxy";
-const char kChromeCloudPrintProxyHeaderValue[] = "Chrome";
-const char kCloudPrintPushNotificationsSource[] = "cloudprint.google.com";
-
-const char kProxyIdValue[] = "proxy";
-const char kPrinterNameValue[] = "printer";
-const char kPrinterDescValue[] = "description";
-const char kPrinterCapsValue[] = "capabilities";
-const char kPrinterDisplayNameValue[] = "default_display_name";
-const char kPrinterDefaultsValue[] = "defaults";
-const char kPrinterStatusValue[] = "status";
-const char kPrinterTagValue[] = "tag";
-const char kPrinterRemoveTagValue[] = "remove_tag";
-const char kPrinterLocalSettingsValue[] = "local_settings";
-const char kMessageTextValue[] = "message";
-const char kUseCDD[] = "use_cdd";
-
-const char kContentTypeJSON[] = "application/json";
-const char kContentTypePDF[] = "application/pdf";
-
-const char kPrintSystemFailedMessageId[] = "printsystemfail";
-const char kGetPrinterCapsFailedMessageId[] = "getprncapsfail";
-const char kEnumPrintersFailedMessageId[] = "enumfail";
-const char kZombiePrinterMessageId[] = "zombieprinter";
-
-const char kSuccessValue[] = "success";
-const char kNameValue[] = "name";
-const char kDisplayNameValue[] = "displayName";
-const char kIdValue[] = "id";
-const char kTicketUrlValue[] = "ticketUrl";
-const char kFileUrlValue[] = "fileUrl";
-const char kPrinterListValue[] = "printers";
-const char kJobListValue[] = "jobs";
-const char kTitleValue[] = "title";
-const char kOwnerValue[] = "ownerId";
-const char kPrinterCapsHashValue[] = "capsHash";
-const char kTagsValue[] = "tags";
-const char kXMPPJidValue[] = "xmpp_jid";
-const char kOAuthCodeValue[] = "authorization_code";
-const char kCreateTimeValue[] = "createTime";
-const char kPrinterTypeValue[] = "type";
-const char kUserValue[] = "request.user";
-const char kUsersValue[] = "request.users";
-const char kLocalSettingsPendingXmppValue[] =
- "local_settings.pending.xmpp_timeout_value";
-
-const char kNotificationUpdateSettings[] = "/update_settings";
-
-const char kChromeVersionTagName[] = "chrome_version";
-const char kSystemNameTagName[] = "system_name";
-const char kSystemVersionTagName[] = "system_version";
-
-const char kCloudPrintServiceProxyTagPrefix[] = "__cp__";
-const char kCloudPrintServiceTagsHashTagName[] = "__cp__tagshash";
-const char kCloudPrintServiceTagDryRunFlag[] = "__cp__dry_run";
-
-const char kJobFetchReasonStartup[] = "startup";
-const char kJobFetchReasonPoll[] = "poll";
-const char kJobFetchReasonNotified[] = "notified";
-const char kJobFetchReasonQueryMore[] = "querymore";
-const char kJobFetchReasonFailure[] = "failure";
-const char kJobFetchReasonRetry[] = "retry";
-
-const char kCreateLocalSettingsXmppPingFormat[] =
- "{\"current\":{\"xmpp_timeout_value\": %d}}";
-const char kUpdateLocalSettingsXmppPingFormat[] =
- "{\"current\":{\"xmpp_timeout_value\": %d},\"pending\":{}}";
-
-} // namespace cloud_print
diff --git a/chromium/chrome/common/cloud_print/cloud_print_constants.h b/chromium/chrome/common/cloud_print/cloud_print_constants.h
deleted file mode 100644
index 1a0dc6e8ebf..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_constants.h
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2012 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_COMMON_CLOUD_PRINT_CLOUD_PRINT_CONSTANTS_H_
-#define CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_CONSTANTS_H_
-
-
-namespace cloud_print {
-
-// The string to be appended to the user-agent for cloud print requests.
-extern const char kCloudPrintUserAgent[];
-// The proxy header name required by cloud print server.
-extern const char kChromeCloudPrintProxyHeaderName[];
-// The proxy header value required by cloud print server.
-extern const char kChromeCloudPrintProxyHeaderValue[];
-// The source of cloud print notifications.
-extern const char kCloudPrintPushNotificationsSource[];
-
-// Values used to register or update a printer with the cloud print service.
-extern const char kProxyIdValue[];
-extern const char kPrinterNameValue[];
-extern const char kPrinterDescValue[];
-extern const char kPrinterCapsValue[];
-extern const char kPrinterDisplayNameValue[];
-extern const char kPrinterDefaultsValue[];
-extern const char kPrinterStatusValue[];
-extern const char kPrinterTagValue[];
-extern const char kPrinterRemoveTagValue[];
-extern const char kPrinterLocalSettingsValue[];
-extern const char kMessageTextValue[];
-extern const char kUseCDD[];
-
-extern const char kContentTypeJSON[];
-extern const char kContentTypePDF[];
-
-// Value of "code" parameter in cloud print "/message" requests.
-extern const char kPrintSystemFailedMessageId[];
-extern const char kGetPrinterCapsFailedMessageId[];
-extern const char kEnumPrintersFailedMessageId[];
-extern const char kZombiePrinterMessageId[];
-
-// Values in the respone JSON from the cloud print server.
-extern const char kSuccessValue[];
-extern const char kNameValue[];
-extern const char kDisplayNameValue[];
-extern const char kIdValue[];
-extern const char kTicketUrlValue[];
-extern const char kFileUrlValue[];
-extern const char kPrinterListValue[];
-extern const char kJobListValue[];
-extern const char kTitleValue[];
-extern const char kOwnerValue[];
-extern const char kPrinterCapsHashValue[];
-extern const char kTagsValue[];
-extern const char kXMPPJidValue[];
-extern const char kOAuthCodeValue[];
-extern const char kCreateTimeValue[];
-extern const char kPrinterTypeValue[];
-extern const char kUserValue[];
-extern const char kUsersValue[];
-extern const char kLocalSettingsPendingXmppValue[];
-
-// Value in XMPP notification.
-extern const char kNotificationUpdateSettings[];
-
-// Printer tag names. Don't need prefixes. They will be added on submit.
-extern const char kChromeVersionTagName[];
-extern const char kSystemNameTagName[];
-extern const char kSystemVersionTagName[];
-
-// Tags for cloud print service.
-extern const char kCloudPrintServiceProxyTagPrefix[];
-extern const char kCloudPrintServiceTagsHashTagName[];
-extern const char kCloudPrintServiceTagDryRunFlag[];
-
-// Reasons for fetching print jobs.
-// Job fetch on proxy startup.
-extern const char kJobFetchReasonStartup[];
-// Job fetch because we are polling.
-extern const char kJobFetchReasonPoll[];
-// Job fetch on being notified by the server.
-extern const char kJobFetchReasonNotified[];
-// Job fetch after a successful print to query for more jobs.
-extern const char kJobFetchReasonQueryMore[];
-// Job fetch after a job failure to query for more jobs.
-extern const char kJobFetchReasonFailure[];
-// Job fetch due to scheduled retry.
-extern const char kJobFetchReasonRetry[];
-
-// Format of the local settings containing only XMPP ping.
-extern const char kCreateLocalSettingsXmppPingFormat[];
-extern const char kUpdateLocalSettingsXmppPingFormat[];
-
-// Max retry count for job data fetch requests.
-const int kJobDataMaxRetryCount = 1;
-// Max retry count (infinity) for API fetch requests.
-const int kCloudPrintAPIMaxRetryCount = -1;
-// Max retry count (infinity) for Registration requests.
-const int kCloudPrintRegisterMaxRetryCount = -1;
-// Max retry count (infinity) for authentication requests.
-const int kCloudPrintAuthMaxRetryCount = -1;
-
-// When we don't have XMPP notifications available, we resort to polling for
-// print jobs. We choose a random interval in seconds between these 2 values.
-const int kMinJobPollIntervalSecs = 5*60; // 5 minutes in seconds
-const int kMaxJobPollIntervalSecs = 8*60; // 8 minutes in seconds
-
-// When we have XMPP notifications available, we ping server to keep connection
-// alive or check connection status.
-const int kDefaultXmppPingTimeoutSecs = 5*60;
-const int kMinXmppPingTimeoutSecs = 1*60;
-const int kXmppPingCheckIntervalSecs = 60;
-
-// Number of failed pings before we try to reinstablish XMPP connection.
-const int kMaxFailedXmppPings = 2;
-
-// The number of seconds before the OAuth2 access token is due to expire that
-// we try and refresh it.
-const int kTokenRefreshGracePeriodSecs = 5*60; // 5 minutes in seconds
-
-// The number of retries before we abandon a print job in exponential backoff
-const int kNumRetriesBeforeAbandonJob = 5;
-
-// The wait time for the second (first with wait time) retry for a job that
-// fails due to network errors
-const int kJobFirstWaitTimeSecs = 1;
-
-// The multiplier for the wait time for retrying a job that fails due to
-// network errors
-const int kJobWaitTimeExponentialMultiplier = 2;
-
-} // namespace cloud_print
-
-#endif // CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_CONSTANTS_H_
diff --git a/chromium/chrome/common/cloud_print/cloud_print_helpers.cc b/chromium/chrome/common/cloud_print/cloud_print_helpers.cc
deleted file mode 100644
index 98d73e1c672..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_helpers.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-// Copyright (c) 2012 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/common/cloud_print/cloud_print_helpers.h"
-
-#include <stdint.h>
-
-#include <limits>
-#include <memory>
-#include <utility>
-
-#include "base/hash/md5.h"
-#include "base/json/json_reader.h"
-#include "base/logging.h"
-#include "base/notreached.h"
-#include "base/strings/stringprintf.h"
-#include "base/system/sys_info.h"
-#include "base/values.h"
-#include "chrome/common/channel_info.h"
-#include "chrome/common/cloud_print/cloud_print_constants.h"
-#include "net/base/mime_util.h"
-#include "url/gurl.h"
-
-namespace cloud_print {
-
-namespace {
-
-// Returns printer tags generated from |printer_tags| and the default tags
-// required by cloud print server.
-PrinterTags PreparePrinterTags(const PrinterTags& printer_tags) {
- PrinterTags printer_tags_out = printer_tags;
- printer_tags_out[kChromeVersionTagName] =
- chrome::GetVersionString(chrome::WithExtendedStable(false));
- printer_tags_out[kSystemNameTagName] =
- base::SysInfo::OperatingSystemName();
- printer_tags_out[kSystemVersionTagName] =
- base::SysInfo::OperatingSystemVersion();
- return printer_tags_out;
-}
-
-// Returns the hash of |printer_tags|.
-std::string HashPrinterTags(const PrinterTags& printer_tags) {
- std::string values_list;
- PrinterTags::const_iterator it;
- for (it = printer_tags.begin(); it != printer_tags.end(); ++it) {
- values_list.append(it->first);
- values_list.append(it->second);
- }
- return base::MD5String(values_list);
-}
-
-} // namespace
-
-std::string AppendPathToUrl(const GURL& url, const std::string& path) {
- DCHECK_NE(path[0], '/');
- std::string ret = url.path();
- if (url.has_path() && (ret.back() != '/'))
- ret += '/';
- ret += path;
- return ret;
-}
-
-GURL GetUrlForSearch(const GURL& cloud_print_server_url) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "search"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForSubmit(const GURL& cloud_print_server_url) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "submit"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForPrinterList(const GURL& cloud_print_server_url,
- const std::string& proxy_id) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "list"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf("proxy=%s", proxy_id.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForPrinterRegistration(const GURL& cloud_print_server_url) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "register"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url,
- const std::string& printer_id) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "update"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf("printerid=%s", printer_id.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url,
- const std::string& printer_id,
- const std::string& reason) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "delete"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf(
- "printerid=%s&reason=%s", printer_id.c_str(), reason.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForJobFetch(const GURL& cloud_print_server_url,
- const std::string& printer_id,
- const std::string& reason) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "fetch"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf(
- "printerid=%s&deb=%s", printer_id.c_str(), reason.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForJobCjt(const GURL& cloud_print_server_url,
- const std::string& job_id,
- const std::string& reason) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "ticket"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf(
- "jobid=%s&deb=%s&use_cjt=true", job_id.c_str(), reason.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForJobDelete(const GURL& cloud_print_server_url,
- const std::string& job_id) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "deletejob"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf("jobid=%s", job_id.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
- const std::string& job_id,
- const std::string& status_string,
- int connector_code) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "control"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf(
- "jobid=%s&status=%s&connector_code=%d", job_id.c_str(),
- status_string.c_str(), connector_code);
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForUserMessage(const GURL& cloud_print_server_url,
- const std::string& message_id) {
- std::string path(AppendPathToUrl(cloud_print_server_url, "message"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf("code=%s", message_id.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url,
- const std::string& oauth_client_id,
- const std::string& proxy_id) {
- // We use the internal API "createrobot" instead of "getauthcode". This API
- // will add the robot as owner to all the existing printers for this user.
- std::string path(AppendPathToUrl(cloud_print_server_url, "createrobot"));
- GURL::Replacements replacements;
- replacements.SetPathStr(path);
- std::string query = base::StringPrintf("oauth_client_id=%s&proxy=%s",
- oauth_client_id.c_str(),
- proxy_id.c_str());
- replacements.SetQueryStr(query);
- return cloud_print_server_url.ReplaceComponents(replacements);
-}
-
-base::Value ParseResponseJSON(const std::string& response_data,
- bool* succeeded) {
- absl::optional<base::Value> message_value =
- base::JSONReader::Read(response_data);
- if (!message_value || !message_value->is_dict())
- return base::Value();
-
- *succeeded = message_value->FindBoolKey(kSuccessValue).value_or(false);
- return std::move(*message_value);
-}
-
-std::string GetMultipartMimeType(const std::string& mime_boundary) {
- return std::string("multipart/form-data; boundary=") + mime_boundary;
-}
-
-std::string GetHashOfPrinterTags(const PrinterTags& printer_tags) {
- return HashPrinterTags(PreparePrinterTags(printer_tags));
-}
-
-std::string GetPostDataForPrinterTags(
- const PrinterTags& printer_tags,
- const std::string& mime_boundary,
- const std::string& proxy_tag_prefix,
- const std::string& tags_hash_tag_name) {
- PrinterTags printer_tags_prepared = PreparePrinterTags(printer_tags);
- std::string post_data;
- for (PrinterTags::const_iterator it = printer_tags_prepared.begin();
- it != printer_tags_prepared.end(); ++it) {
- // TODO(gene) Escape '=' char from name. Warning for now.
- if (it->first.find('=') != std::string::npos) {
- LOG(WARNING) <<
- "CP_PROXY: Printer option name contains '=' character";
- NOTREACHED();
- }
- // All our tags have a special prefix to identify them as such.
- std::string msg = base::StringPrintf("%s%s=%s",
- proxy_tag_prefix.c_str(), it->first.c_str(), it->second.c_str());
- net::AddMultipartValueForUpload(kPrinterTagValue, msg, mime_boundary,
- std::string(), &post_data);
- }
- std::string tags_hash_msg = base::StringPrintf("%s=%s",
- tags_hash_tag_name.c_str(),
- HashPrinterTags(printer_tags_prepared).c_str());
- net::AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg,
- mime_boundary, std::string(), &post_data);
- return post_data;
-}
-
-std::string GetCloudPrintAuthHeaderValue(const std::string& auth_token) {
- return base::StringPrintf("OAuth %s", auth_token.c_str());
-}
-
-} // namespace cloud_print
diff --git a/chromium/chrome/common/cloud_print/cloud_print_helpers.h b/chromium/chrome/common/cloud_print/cloud_print_helpers.h
deleted file mode 100644
index 569feae8a79..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_helpers.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2012 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_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
-#define CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
-
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-class GURL;
-
-namespace base {
-class Value;
-}
-
-// Helper consts and methods for both cloud print and chrome browser.
-namespace cloud_print {
-
-// A map representing printer tags.
-typedef std::map<std::string, std::string> PrinterTags;
-
-// Appends a relative path to the url making sure to append a '/' if the
-// URL's path does not end with a slash. It is assumed that |path| does not
-// begin with a '/'.
-// NOTE: Since we ALWAYS want to append here, we simply append the path string
-// instead of calling url::ResolveRelative. The input |url| may or may not
-// contain a '/' at the end.
-std::string AppendPathToUrl(const GURL& url, const std::string& path);
-
-GURL GetUrlForSearch(const GURL& cloud_print_server_url);
-GURL GetUrlForSubmit(const GURL& cloud_print_server_url);
-GURL GetUrlForPrinterList(const GURL& cloud_print_server_url,
- const std::string& proxy_id);
-GURL GetUrlForPrinterRegistration(const GURL& cloud_print_server_url);
-GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url,
- const std::string& printer_id);
-GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url,
- const std::string& printer_id,
- const std::string& reason);
-GURL GetUrlForJobFetch(const GURL& cloud_print_server_url,
- const std::string& printer_id,
- const std::string& reason);
-GURL GetUrlForJobCjt(const GURL& cloud_print_server_url,
- const std::string& job_id,
- const std::string& reason);
-GURL GetUrlForJobDelete(const GURL& cloud_print_server_url,
- const std::string& job_id);
-GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
- const std::string& job_id,
- const std::string& status_string,
- int connector_code);
-GURL GetUrlForUserMessage(const GURL& cloud_print_server_url,
- const std::string& message_id);
-GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url,
- const std::string& oauth_client_id,
- const std::string& proxy_id);
-
-// Parses the response data for any cloud print server request. The method
-// returns none Value if there was an error in parsing the JSON. The |succeeded|
-// parameters returns the value of the "success" value in the response JSON.
-// Returns the response as a dictionary value on success.
-base::Value ParseResponseJSON(const std::string& response_data,
- bool* succeeded);
-
-// Returns the MIME type of multipart with |mime_boundary|.
-std::string GetMultipartMimeType(const std::string& mime_boundary);
-
-// Returns an MD5 hash for |printer_tags| and the default required tags.
-std::string GetHashOfPrinterTags(const PrinterTags& printer_tags);
-
-// Returns the post data for |printer_tags| and the default required tags.
-std::string GetPostDataForPrinterTags(
- const PrinterTags& printer_tags,
- const std::string& mime_boundary,
- const std::string& proxy_tag_prefix,
- const std::string& tags_hash_tag_name);
-
-// Get the cloud print auth header value from |auth_token|.
-std::string GetCloudPrintAuthHeaderValue(const std::string& auth_token);
-
-} // namespace cloud_print
-
-#endif // CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
diff --git a/chromium/chrome/common/cloud_print/cloud_print_helpers_unittest.cc b/chromium/chrome/common/cloud_print/cloud_print_helpers_unittest.cc
deleted file mode 100644
index b82a29ba64c..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_helpers_unittest.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2012 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/common/cloud_print/cloud_print_helpers.h"
-
-#include "base/hash/md5.h"
-#include "base/strings/stringprintf.h"
-#include "base/system/sys_info.h"
-#include "chrome/common/channel_info.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace cloud_print {
-
-namespace {
-
-void CheckURLs(const GURL& server_base_url) {
- std::string expected_url_base = server_base_url.spec();
- if (expected_url_base.back() != '/')
- expected_url_base += "/";
-
- EXPECT_EQ(base::StringPrintf("%ssearch", expected_url_base.c_str()),
- GetUrlForSearch(server_base_url).spec());
-
- EXPECT_EQ(base::StringPrintf("%ssubmit", expected_url_base.c_str()),
- GetUrlForSubmit(server_base_url).spec());
-
- EXPECT_EQ(base::StringPrintf("%slist?proxy=demoproxy",
- expected_url_base.c_str()),
- GetUrlForPrinterList(
- server_base_url, std::string("demoproxy")).spec());
-
- EXPECT_EQ(base::StringPrintf("%sregister", expected_url_base.c_str()),
- GetUrlForPrinterRegistration(server_base_url).spec());
-
- EXPECT_EQ(base::StringPrintf("%supdate?printerid=printeridfoo",
- expected_url_base.c_str()),
- GetUrlForPrinterUpdate(server_base_url, "printeridfoo").spec());
-
- EXPECT_EQ(base::StringPrintf("%sdelete?printerid=printeridbar&reason=deleted",
- expected_url_base.c_str()),
- GetUrlForPrinterDelete(
- server_base_url, "printeridbar", "deleted").spec());
-
- EXPECT_EQ(base::StringPrintf("%sfetch?printerid=myprinter&deb=nogoodreason",
- expected_url_base.c_str()),
- GetUrlForJobFetch(
- server_base_url, "myprinter", "nogoodreason").spec());
-
- EXPECT_EQ(base::StringPrintf("%sdeletejob?jobid=myprinter",
- expected_url_base.c_str()),
- GetUrlForJobDelete(server_base_url, "myprinter").spec());
-
- EXPECT_EQ(base::StringPrintf(
- "%scontrol?jobid=myprinter&status=s1&connector_code=0",
- expected_url_base.c_str()),
- GetUrlForJobStatusUpdate(
- server_base_url, "myprinter", "s1", 0).spec());
-
- EXPECT_EQ(base::StringPrintf("%smessage?code=testmsg",
- expected_url_base.c_str()),
- GetUrlForUserMessage(server_base_url, "testmsg").spec());
-
- EXPECT_EQ(base::StringPrintf(
- "%screaterobot?oauth_client_id=democlientid&proxy=demoproxy",
- expected_url_base.c_str()),
- GetUrlForGetAuthCode(
- server_base_url, "democlientid", "demoproxy").spec());
-}
-
-} // namespace
-
-TEST(CloudPrintHelpersTest, GetURLs) {
- CheckURLs(GURL("https://www.google.com/cloudprint"));
- CheckURLs(GURL("https://www.google.com/cloudprint/"));
- CheckURLs(GURL("http://www.myprinterserver.com"));
- CheckURLs(GURL("http://www.myprinterserver.com/"));
-}
-
-TEST(CloudPrintHelpersTest, GetHashOfPrinterTags) {
- PrinterTags printer_tags;
- printer_tags["tag1"] = std::string("value1");
- printer_tags["tag2"] = std::string("value2");
-
- std::string expected_list_string = base::StringPrintf(
- "chrome_version%ssystem_name%ssystem_version%stag1value1tag2value2",
- chrome::GetVersionString(chrome::WithExtendedStable(false)).c_str(),
- base::SysInfo::OperatingSystemName().c_str(),
- base::SysInfo::OperatingSystemVersion().c_str());
- EXPECT_EQ(base::MD5String(expected_list_string),
- GetHashOfPrinterTags(printer_tags));
-}
-
-TEST(CloudPrintHelpersTest, GetPostDataForPrinterTags) {
- PrinterTags printer_tags;
- printer_tags["tag1"] = std::string("value1");
- printer_tags["tag2"] = std::string("value2");
-
- std::string expected = base::StringPrintf(
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__chrome_version=%s\r\n"
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__system_name=%s\r\n"
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__system_version=%s\r\n"
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__tag1=value1\r\n"
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__tag2=value2\r\n"
- "--test_mime_boundary\r\nContent-Disposition: form-data; name=\"tag\""
- "\r\n\r\n__test__tagshash=%s\r\n",
- chrome::GetVersionString(chrome::WithExtendedStable(false)).c_str(),
- base::SysInfo::OperatingSystemName().c_str(),
- base::SysInfo::OperatingSystemVersion().c_str(),
- GetHashOfPrinterTags(printer_tags).c_str());
-
- EXPECT_EQ(expected, GetPostDataForPrinterTags(
- printer_tags,
- std::string("test_mime_boundary"),
- std::string("__test__"),
- std::string("__test__tagshash")));
-}
-
-TEST(CloudPrintHelpersTest, GetCloudPrintAuthHeaderValue) {
- std::string test_auth("testauth");
- EXPECT_EQ("OAuth testauth", GetCloudPrintAuthHeaderValue(test_auth));
-}
-
-} // namespace cloud_print
diff --git a/chromium/chrome/common/cloud_print/cloud_print_proxy_info.cc b/chromium/chrome/common/cloud_print/cloud_print_proxy_info.cc
deleted file mode 100644
index 6e38663cb3b..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_proxy_info.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2011 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/common/cloud_print/cloud_print_proxy_info.h"
-
-namespace cloud_print {
-
-CloudPrintProxyInfo::CloudPrintProxyInfo() : enabled(false) {
-}
-
-CloudPrintProxyInfo::~CloudPrintProxyInfo() {}
-
-} // namespace cloud_print
diff --git a/chromium/chrome/common/cloud_print/cloud_print_proxy_info.h b/chromium/chrome/common/cloud_print/cloud_print_proxy_info.h
deleted file mode 100644
index 2b97378bd72..00000000000
--- a/chromium/chrome/common/cloud_print/cloud_print_proxy_info.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2011 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_COMMON_CLOUD_PRINT_CLOUD_PRINT_PROXY_INFO_H_
-#define CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_PROXY_INFO_H_
-
-#include <string>
-
-namespace cloud_print {
-
-// This struct is used for ServiceHostMsg_CloudPrint_Info IPC message.
-struct CloudPrintProxyInfo {
- CloudPrintProxyInfo();
- ~CloudPrintProxyInfo();
-
- bool enabled;
- std::string email;
- std::string proxy_id;
-};
-
-} // namespace cloud_print
-
-#endif // CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_PROXY_INFO_H_
diff --git a/chromium/chrome/common/conflicts/module_watcher_win.cc b/chromium/chrome/common/conflicts/module_watcher_win.cc
index 6e1b3346268..9f6be770d7f 100644
--- a/chromium/chrome/common/conflicts/module_watcher_win.cc
+++ b/chromium/chrome/common/conflicts/module_watcher_win.cc
@@ -18,7 +18,6 @@
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
-#include "base/task/post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
diff --git a/chromium/chrome/common/crash_keys.cc b/chromium/chrome/common/crash_keys.cc
index f6850e85411..3a954d5ce17 100644
--- a/chromium/chrome/common/crash_keys.cc
+++ b/chromium/chrome/common/crash_keys.cc
@@ -6,7 +6,6 @@
#include "base/base_switches.h"
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -100,7 +99,7 @@ bool IsBoringSwitch(const std::string& flag) {
return false;
size_t end = flag.find("=");
size_t len = (end == std::string::npos) ? flag.length() - 2 : end - 2;
- for (size_t i = 0; i < base::size(kIgnoreSwitches); ++i) {
+ for (size_t i = 0; i < std::size(kIgnoreSwitches); ++i) {
if (flag.compare(2, len, kIgnoreSwitches[i]) == 0)
return true;
}
@@ -135,7 +134,7 @@ void SetActiveExtensions(const std::set<std::string>& extensions) {
};
auto it = extensions.begin();
- for (size_t i = 0; i < base::size(extension_ids); ++i) {
+ for (size_t i = 0; i < std::size(extension_ids); ++i) {
if (it == extensions.end()) {
extension_ids[i].Clear();
} else {
diff --git a/chromium/chrome/common/extensions/api/BUILD.gn b/chromium/chrome/common/extensions/api/BUILD.gn
index bd52a161034..65b9f44029e 100644
--- a/chromium/chrome/common/extensions/api/BUILD.gn
+++ b/chromium/chrome/common/extensions/api/BUILD.gn
@@ -57,7 +57,7 @@ generated_json_strings("generated_api_json_strings") {
"tts.json",
"tts_engine.json",
]
- if (is_chromeos_ash || is_chromeos_lacros) {
+ if (is_chromeos) {
sources += [ "file_browser_handler.json" ]
}
if (!is_chromeos_ash) {
diff --git a/chromium/chrome/common/extensions/api/_api_features.json b/chromium/chrome/common/extensions/api/_api_features.json
index cc5d7a049d1..77afa893eef 100644
--- a/chromium/chrome/common/extensions/api/_api_features.json
+++ b/chromium/chrome/common/extensions/api/_api_features.json
@@ -300,7 +300,8 @@
}],
"debugger": {
"dependencies": ["permission:debugger"],
- "contexts": ["blessed_extension"]
+ "contexts": ["blessed_extension"],
+ "developer_mode_only": true
},
"declarativeContent": {
"dependencies": ["permission:declarativeContent"],
@@ -672,19 +673,16 @@
},
"platformKeys": {
"dependencies": ["permission:platformKeys"],
- "contexts": ["blessed_extension"],
- "disallow_for_service_workers": true
+ "contexts": ["blessed_extension"]
},
"platformKeysInternal": [{
"dependencies": ["permission:platformKeys"],
"internal": true,
- "contexts": ["blessed_extension"],
- "disallow_for_service_workers": true
+ "contexts": ["blessed_extension"]
},{
"dependencies": ["permission:enterprise.platformKeys"],
"internal": true,
- "contexts": ["blessed_extension"],
- "disallow_for_service_workers": true
+ "contexts": ["blessed_extension"]
}],
"printing": {
"dependencies": ["permission:printing"],
diff --git a/chromium/chrome/common/extensions/api/_features.md b/chromium/chrome/common/extensions/api/_features.md
index 9f81ca07ca5..c1b2398b173 100644
--- a/chromium/chrome/common/extensions/api/_features.md
+++ b/chromium/chrome/common/extensions/api/_features.md
@@ -314,8 +314,8 @@ The only accepted value is the bool `true`.
The `platforms` property specifies the properties the feature should be
available on.
-The accepted values are lists of strings from `chromeos`, `mac`, `lacros`,
-`linux`, and `win`.
+The accepted values are lists of strings from `chromeos`, `fuchsia`, `lacros`,
+`linux`, `mac`, and `win`.
### session\_types
diff --git a/chromium/chrome/common/extensions/api/_permission_features.json b/chromium/chrome/common/extensions/api/_permission_features.json
index 9f7b832b83f..6fddbd89da1 100644
--- a/chromium/chrome/common/extensions/api/_permission_features.json
+++ b/chromium/chrome/common/extensions/api/_permission_features.json
@@ -337,7 +337,8 @@
"031E5E4A54C39E4F46E11CE643584E9187915908", // https://crbug.com/882461 SecureConnect
"349E89FE0296161007623C0B4096B617D7CECD54", // https://crbug.com/882461 SecureConnect
"18B761AA5B58FA89E596EB7996B4C92C86775C7F", // https://crbug.com/882461 SecureConnect
- "2012C0122892D332325339998251D1CC3CAE396A" // https://crbug.com/882461 SecureConnect
+ "2012C0122892D332325339998251D1CC3CAE396A", // https://crbug.com/882461 SecureConnect
+ "C8F4673FC69965390BC376C0761EC341492F9D87" // Contact Center Insights
]
},
"experimental": {
@@ -347,6 +348,12 @@
"extension", "legacy_packaged_app", "hosted_app", "platform_app"
]
},
+ "favicon": {
+ "channel": "canary",
+ "extension_types": [
+ "extension"
+ ]
+ },
"fileBrowserHandler": {
"channel": "stable",
"extension_types": ["extension", "legacy_packaged_app", "platform_app"],
@@ -623,6 +630,12 @@
{
"channel": "stable",
"extension_types": ["platform_app"]
+ },
+ {
+ "channel": "dev",
+ "extension_types": ["extension"],
+ "platforms": ["chromeos", "lacros"],
+ "session_types": ["kiosk"]
}],
"notifications": [{
// The chrome.notifications functionality listed in notifications.idl is
@@ -902,7 +915,8 @@
"webAuthenticationProxy": {
"channel": "trunk",
"extension_types": ["extension"],
- "min_manifest_version": 3
+ "min_manifest_version": 3,
+ "platforms": ["win", "linux", "mac"]
},
"webNavigation": {
"channel": "stable",
@@ -983,7 +997,8 @@
"74801F84D31D23D08BEA48AB82C6A6120EDB4D45",
"6A4D7AEC6414492BD25219C7A479265BF1177D42", // http://crbug.com/1206836
"F80B163C896D50A685E0B683BEEEA94217F253D6", // http://crbug.com/1206836
- "454738352012A22901C55B348E5E530BDE1AF2B0" // http://crbug.com/1259253
+ "454738352012A22901C55B348E5E530BDE1AF2B0", // http://crbug.com/1259253
+ "7D5A66C88A25019F997E548DEC5E0011E2855591" // http://crbug.com/1206836
]
}
}
diff --git a/chromium/chrome/common/extensions/api/accessibility_private.json b/chromium/chrome/common/extensions/api/accessibility_private.json
index f38508ec185..3b41c26cdd4 100644
--- a/chromium/chrome/common/extensions/api/accessibility_private.json
+++ b/chromium/chrome/common/extensions/api/accessibility_private.json
@@ -89,7 +89,7 @@
{
"id": "SwitchAccessMenuAction",
"type": "string",
- "enum": [ "copy", "cut", "decrement", "dictation", "endTextSelection", "increment", "itemScan", "jumpToBeginningOfText", "jumpToEndOfText", "keyboard", "leftClick", "moveBackwardOneCharOfText", "moveBackwardOneWordOfText", "moveCursor", "moveDownOneLineOfText", "moveForwardOneCharOfText", "moveForwardOneWordOfText", "moveUpOneLineOfText", "paste", "pointScan", "rightClick", "scrollDown", "scrollLeft", "scrollRight", "scrollUp", "select", "settings", "startTextSelection", "shortcuts", "leaveGroup", "webMenu", "webBookmark", "webBottomOfPage", "webTopOfPage", "webFindInPage", "webDownloads", "webClearHistory", "systemMenu", "systemStatusBar", "systemLauncher", "systemTaskManager", "systemDiagnostics", "systemScreenshot", "systemHelp", "mediaMenu", "mediaMute", "mediaVolumeDown", "mediaVolumeUp", "mediaRewind", "mediaPlayPause", "mediaFastforward", "displayMenu", "displayMirror", "displayBrightnessDown", "displayBrightnessUp", "displayRotate", "displayZoomOut", "displayZoomIn", "userMenu", "userLock", "userPreviousUser", "userNextUser", "userSignOut", "actionRecorder", "startRecording", "stopRecording", "executeMacro"],
+ "enum": [ "copy", "cut", "decrement", "dictation", "endTextSelection", "increment", "itemScan", "jumpToBeginningOfText", "jumpToEndOfText", "keyboard", "leftClick", "moveBackwardOneCharOfText", "moveBackwardOneWordOfText", "moveCursor", "moveDownOneLineOfText", "moveForwardOneCharOfText", "moveForwardOneWordOfText", "moveUpOneLineOfText", "paste", "pointScan", "rightClick", "scrollDown", "scrollLeft", "scrollRight", "scrollUp", "select", "settings", "startTextSelection" ],
"description": "Available actions to be shown in the Switch Access menu. Must be kept in sync with the strings in ash/system/accessibility/switch_access/switch_access_menu_view.cc"
},
{
@@ -234,7 +234,7 @@
{
"id": "AccessibilityFeature",
"type": "string",
- "enum": [ "enhancedNetworkVoices", "dictationCommands", "dictationHints" ],
+ "enum": [ "enhancedNetworkVoices", "dictationCommands", "dictationHints" , "googleTtsLanguagePacks"],
"description": "Subset of accessibility features."
},
{
diff --git a/chromium/chrome/common/extensions/api/autotest_private.idl b/chromium/chrome/common/extensions/api/autotest_private.idl
index 15841070917..20eca521e17 100644
--- a/chromium/chrome/common/extensions/api/autotest_private.idl
+++ b/chromium/chrome/common/extensions/api/autotest_private.idl
@@ -117,7 +117,9 @@ namespace autotestPrivate {
enum MouseButton {
Left,
Middle,
- Right
+ Right,
+ Back,
+ Forward
};
// A paramter used in setArcAppWindowState() function.
@@ -255,6 +257,18 @@ namespace autotestPrivate {
callback IsArcPackageListInitialRefreshedCallback = void (boolean refreshed);
+ callback IsLacrosPrimaryBrowserCallback = void (boolean primary);
+
+ dictionary LacrosInfo {
+ // True iff lacros is running currently.
+ boolean isRunning;
+ // Path to lacros-chrome directory. Note that this may change over time if
+ // omaha is used. This also may be empty if lacros is not running.
+ DOMString lacrosPath;
+ };
+
+ callback GetLacrosInfoCallback = void (LacrosInfo info);
+
dictionary ArcAppDict {
DOMString name;
DOMString packageName;
@@ -343,6 +357,14 @@ namespace autotestPrivate {
callback GetAllInstalledAppsCallback = void (App[] apps);
+ dictionary CryptohomeRecoveryDataDict {
+ DOMString reauthProofToken;
+ DOMString refreshToken;
+ };
+
+ callback GetCryptohomeRecoveryDataCallback = void (
+ CryptohomeRecoveryDataDict dict);
+
dictionary ShelfItem {
DOMString appId;
DOMString launchId;
@@ -611,6 +633,20 @@ namespace autotestPrivate {
callback CouldAllowCrostiniCallback = void (boolean canBeAllowed);
+ // Collected chromeos::LoginEventRecorder data.
+ dictionary LoginEventRecorderData {
+ // Event name
+ DOMString name;
+ // Number of frames actually shown for this animation.
+ long microsecnods_since_unix_epoch;
+ };
+
+ // Callback invoked to report the collection ui::LoginEventRecorder data
+ // after getLoginEventRecorderLoginEvents is called.
+ callback GetLoginEventRecorderLoginEventsCallback = void
+ (LoginEventRecorderData[] data);
+
+
interface Functions {
// Must be called to allow autotestPrivateAPI events to be fired.
static void initializeEvents();
@@ -714,6 +750,17 @@ namespace autotestPrivate {
[supportsPromises] static void isArcProvisioned(
IsArcProvisionedCallback callback);
+ // Returns true if Lacros is the primary browser. This includes the case
+ // where Lacros is the only browser.
+ // NOTE: Because the answer depends on the policy, this function should
+ // be used only after profile initialization.
+ [supportsPromises] static void isLacrosPrimaryBrowser(
+ IsLacrosPrimaryBrowserCallback callback);
+
+ // Gets various information about the state of lacros on the system.
+ [supportsPromises] static void getLacrosInfo(
+ GetLacrosInfoCallback callback);
+
// Gets information about the requested ARC app.
[supportsPromises] static void getArcApp(DOMString appId,
GetArcAppCallback callback);
@@ -723,6 +770,10 @@ namespace autotestPrivate {
DOMString packageName,
GetArcPackageCallback callback);
+ // Gets the data needed for Cryptohome Recovery.
+ [supportsPromises] static void getCryptohomeRecoveryData(
+ GetCryptohomeRecoveryDataCallback callback);
+
// Waits for system web apps to complete the installation.
[supportsPromises] static void waitForSystemWebAppsInstall(
VoidCallback callback);
@@ -866,6 +917,11 @@ namespace autotestPrivate {
[supportsPromises] static void bootstrapMachineLearningService(
VoidCallback callback);
+ // Triggers an on-demand update of smart dim component and checks whether
+ // it's successfully loaded by smart dim ml_agent.
+ // |callback|: Called when the operation has completed.
+ [supportsPromises] static void loadSmartDimComponent(VoidCallback callback);
+
// Enables/disables the Google Assistant.
// |callback|: Called when the operation has completed.
[supportsPromises] static void setAssistantEnabled(boolean enabled,
@@ -1249,6 +1305,17 @@ namespace autotestPrivate {
[supportsPromises] static void resetHoldingSpace(
optional ResetHoldingSpaceOptions options,
VoidCallback callback);
+
+ // Starts collection of ui::LoginEventRecorder data.
+ static void startLoginEventRecorderDataCollection(VoidCallback callback);
+
+ // Stops ui::LoginEventRecorder data collection and reports all the
+ // collected data.
+ static void getLoginEventRecorderLoginEvents(
+ GetLoginEventRecorderLoginEventsCallback callback);
+
+ // Adds login event to test LoginEventRecorderDataCollection API.
+ static void addLoginEventForTesting(VoidCallback callback);
};
interface Events {
diff --git a/chromium/chrome/common/extensions/api/common_extension_api_unittest.cc b/chromium/chrome/common/extensions/api/common_extension_api_unittest.cc
index 699dc43e77c..4a6d573906b 100644
--- a/chromium/chrome/common/extensions/api/common_extension_api_unittest.cc
+++ b/chromium/chrome/common/extensions/api/common_extension_api_unittest.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "extensions/common/extension_api.h"
-
#include <stddef.h>
#include <memory>
@@ -11,7 +9,6 @@
#include <utility>
#include <vector>
-#include "base/cxx17_backports.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
@@ -27,6 +24,7 @@
#include "chrome/common/extensions/extension_features_unittest.h"
#include "extensions/common/api/extension_action/action_info.h"
#include "extensions/common/extension.h"
+#include "extensions/common/extension_api.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature_session_type.h"
#include "extensions/common/features/simple_feature.h"
@@ -100,7 +98,7 @@ TEST(ExtensionAPITest, Creation) {
{ &empty_instance, false }
};
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
EXPECT_EQ(test_data[i].expect_populated,
test_data[i].api->GetSchema("bookmarks.create") != nullptr);
}
@@ -118,7 +116,7 @@ TEST(ExtensionAPITest, SplitDependencyName) {
{"foo:bar", "foo", "bar"},
{"foo:bar.baz", "foo", "bar.baz"}};
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
std::string feature_type;
std::string feature_name;
ExtensionAPI::SplitDependencyName(
@@ -225,7 +223,7 @@ TEST(ExtensionAPITest, APIFeatures) {
FeatureProvider api_feature_provider;
AddUnittestAPIFeatures(&api_feature_provider);
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
TestExtensionAPI api;
api.RegisterDependencyProvider("api", &api_feature_provider);
for (auto* key : kTestFeatures)
@@ -363,7 +361,7 @@ TEST(ExtensionAPITest, IsAnyFeatureAvailableToContext) {
FeatureProvider api_feature_provider;
AddUnittestAPIFeatures(&api_feature_provider);
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
TestExtensionAPI api;
api.RegisterDependencyProvider("api", &api_feature_provider);
for (auto* key : kTestFeatures)
@@ -804,7 +802,7 @@ TEST(ExtensionAPITest, GetAPINameFromFullName) {
std::unique_ptr<ExtensionAPI> api(
ExtensionAPI::CreateWithDefaultConfiguration());
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
std::string child_name;
std::string api_name = api->GetAPINameFromFullName(test_data[i].input,
&child_name);
@@ -828,7 +826,7 @@ TEST(ExtensionAPITest, DefaultConfigurationFeatures) {
// TODO(aa): More stuff to test over time.
} test_data[] = {{browser_action}, {browser_action_set_title}};
- for (size_t i = 0; i < base::size(test_data); ++i) {
+ for (size_t i = 0; i < std::size(test_data); ++i) {
const SimpleFeature* feature = test_data[i].feature;
ASSERT_TRUE(feature) << i;
@@ -982,7 +980,7 @@ TEST(ExtensionAPITest, NoPermissions) {
ExtensionAPI::CreateWithDefaultConfiguration());
scoped_refptr<const Extension> extension = ExtensionBuilder("Test").Build();
- for (size_t i = 0; i < base::size(kTests); ++i) {
+ for (size_t i = 0; i < std::size(kTests); ++i) {
EXPECT_EQ(
kTests[i].expect_success,
extension_api
diff --git a/chromium/chrome/common/extensions/api/developer_private.idl b/chromium/chrome/common/extensions/api/developer_private.idl
index e59638fb6db..7aeaee4665c 100644
--- a/chromium/chrome/common/extensions/api/developer_private.idl
+++ b/chromium/chrome/common/extensions/api/developer_private.idl
@@ -366,8 +366,8 @@ namespace developerPrivate {
// Specifies which set of user specified sites that the host will be added
// to or removed from.
UserSiteSet siteList;
- // The site to add/remove.
- DOMString host;
+ // The sites to add/remove.
+ DOMString[] hosts;
};
dictionary UserSiteSettings {
@@ -734,16 +734,16 @@ namespace developerPrivate {
[supportsPromises] static void getUserSiteSettings(
optional UserSiteSettingsCallback callback);
- // Adds a host to the set of user permitted or restricted sites. If the host
- // in the other set than what's specified in `options`, then it is removed
- // from that set.
- [supportsPromises] static void addUserSpecifiedSite(
+ // Adds hosts to the set of user permitted or restricted sites. If any hosts
+ // are in the other set than what's specified in `options`, then they are
+ // removed from that set.
+ [supportsPromises] static void addUserSpecifiedSites(
UserSiteSettingsOptions options,
optional VoidCallback callback);
- // Removes a host from the specified set of user permitted or restricted
+ // Removes hosts from the specified set of user permitted or restricted
// sites.
- [supportsPromises] static void removeUserSpecifiedSite(
+ [supportsPromises] static void removeUserSpecifiedSites(
UserSiteSettingsOptions options,
optional VoidCallback callback);
diff --git a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
index 8aad94f65c3..b19b2f166ed 100644
--- a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
+++ b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
@@ -131,11 +131,20 @@ FileBrowserHandler::GetHandlers(const extensions::Extension* extension) {
return &info->file_browser_handlers;
}
-FileBrowserHandlerParser::FileBrowserHandlerParser() {
+// static
+const FileBrowserHandler* FileBrowserHandler::FindForActionId(
+ const extensions::Extension* extension,
+ const std::string& action_id) {
+ for (const auto& handler : *FileBrowserHandler::GetHandlers(extension)) {
+ if (handler->id() == action_id)
+ return handler.get();
+ }
+ return nullptr;
}
-FileBrowserHandlerParser::~FileBrowserHandlerParser() {
-}
+FileBrowserHandlerParser::FileBrowserHandlerParser() = default;
+
+FileBrowserHandlerParser::~FileBrowserHandlerParser() = default;
namespace {
diff --git a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
index f15883e44bf..2e20713f90a 100644
--- a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
+++ b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
@@ -74,6 +74,12 @@ class FileBrowserHandler {
// Returns the file browser handlers associated with the |extension|.
static List* GetHandlers(const extensions::Extension* extension);
+ // Returns file browser handler in |extension| matching |action_id|, or
+ // nullptr if not found.
+ static const FileBrowserHandler* FindForActionId(
+ const extensions::Extension* extension,
+ const std::string& action_id);
+
private:
// The id for the extension this action belongs to (as defined in the
// extension manifest).
diff --git a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc
index a116f5e8edf..ee5f825553e 100644
--- a/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc
+++ b/chromium/chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc
@@ -5,7 +5,6 @@
#include <memory>
#include <utility>
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
@@ -96,7 +95,7 @@ TEST_F(FileBrowserHandlerManifestTest, InvalidFileBrowserHandlers) {
Testcase("filebrowser_invalid_file_filters_url.json",
extensions::ErrorUtils::FormatErrorMessage(
errors::kInvalidURLPatternError, "http:*.html"))};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
RunTestcase(Testcase("filebrowser_missing_permission.json",
errors::kInvalidFileBrowserHandlerMissingPermission),
EXPECT_TYPE_WARNING);
@@ -145,6 +144,11 @@ TEST_F(FileBrowserHandlerManifestTest, ValidFileBrowserHandler) {
EXPECT_FALSE(action->HasCreateAccessPermission());
EXPECT_TRUE(action->CanRead());
EXPECT_TRUE(action->CanWrite());
+
+ EXPECT_EQ(action, FileBrowserHandler::FindForActionId(extension.get(),
+ "ExtremelyCoolAction"));
+ EXPECT_EQ(nullptr, FileBrowserHandler::FindForActionId(extension.get(),
+ "(does not exist)"));
}
TEST_F(FileBrowserHandlerManifestTest, ValidFileBrowserHandlerMIMETypes) {
@@ -185,6 +189,10 @@ TEST_F(FileBrowserHandlerManifestTest, ValidFileBrowserHandlerMIMETypes) {
ASSERT_EQ(1U, patterns.patterns().size());
EXPECT_TRUE(action->MatchesURL(
GURL("filesystem:chrome-extension://foo/local/test.txt")));
+
+ EXPECT_EQ(action, FileBrowserHandler::FindForActionId(extension.get(), "ID"));
+ EXPECT_EQ(nullptr, FileBrowserHandler::FindForActionId(extension.get(),
+ "(does not exist)"));
}
TEST_F(FileBrowserHandlerManifestTest, ValidFileBrowserHandlerWithCreate) {
@@ -228,6 +236,10 @@ TEST_F(FileBrowserHandlerManifestTest, ValidFileBrowserHandlerWithCreate) {
EXPECT_TRUE(action->HasCreateAccessPermission());
EXPECT_FALSE(action->CanRead());
EXPECT_FALSE(action->CanWrite());
+
+ EXPECT_EQ(action, FileBrowserHandler::FindForActionId(extension.get(), "ID"));
+ EXPECT_EQ(nullptr, FileBrowserHandler::FindForActionId(extension.get(),
+ "(does not exist)"));
}
} // namespace
diff --git a/chromium/chrome/common/extensions/api/file_manager_private.idl b/chromium/chrome/common/extensions/api/file_manager_private.idl
index a87d2f93fc5..e7123626889 100644
--- a/chromium/chrome/common/extensions/api/file_manager_private.idl
+++ b/chromium/chrome/common/extensions/api/file_manager_private.idl
@@ -49,7 +49,7 @@ namespace fileManagerPrivate {
// Type of the mounted volume.
enum VolumeType { drive, downloads, removable, archive, provided, mtp,
media_view, crostini, android_files, documents_provider,
- testing, smb, system_internal };
+ testing, smb, system_internal, guest_os };
// Device type. Available if this is removable volume.
enum DeviceType { usb, sd, optical, mobile, unknown };
@@ -321,7 +321,8 @@ enum RecentFileType {
all,
audio,
image,
- video
+ video,
+ document
};
enum CrostiniEventType {
@@ -368,9 +369,8 @@ dictionary FileTaskDescriptor {
};
// A file task represents an action that the file manager can perform over the
-// currently selected files. See
-// chrome/browser/chromeos/extensions/file_manager/file_tasks.h for details
-// about how file tasks are handled.
+// currently selected files. See chrome/browser/ash/file_manager/file_tasks.h
+// for details about how file tasks are handled.
dictionary FileTask {
// Unique identifier for the task.
FileTaskDescriptor descriptor;
@@ -1648,6 +1648,13 @@ interface Functions {
// Lists mountable Guest OSs.
static void listMountableGuests(ListMountableGuestsCallback callback);
+
+ // Starts and mounts the target Guest OS.
+ // |callback|
+ static void mountGuest(long id, SimpleCallback callback);
+
+ // Tells DriveFS to update its cached pin states of hosted files (once).
+ static void pollDriveHostedFilePinStates();
};
// Events supported by fileManagerPrivate API. These events are broadcasted.
diff --git a/chromium/chrome/common/extensions/api/input_method_private.json b/chromium/chrome/common/extensions/api/input_method_private.json
index 42e84b23dc9..df4f49fb554 100644
--- a/chromium/chrome/common/extensions/api/input_method_private.json
+++ b/chromium/chrome/common/extensions/api/input_method_private.json
@@ -219,6 +219,19 @@
"parameters": []
}
]
+ }, {
+ "name": "switchToLastUsedInputMethod",
+ "type": "function",
+ "description": "Switches to the last used input method. If no last used input method, this is a no-op.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "Callback which is called once the input method is swapped (if applicable). If unsuccessful $(ref:runtime.lastError) is set.",
+ "parameters": []
+ }
+ ]
}, {
"name": "fetchAllDictionaryWords",
"type": "function",
diff --git a/chromium/chrome/common/extensions/api/login.idl b/chromium/chrome/common/extensions/api/login.idl
index 6d4c6b519ce..e8d05a86f58 100644
--- a/chromium/chrome/common/extensions/api/login.idl
+++ b/chromium/chrome/common/extensions/api/login.idl
@@ -8,6 +8,19 @@
namespace login {
callback VoidCallback = void ();
callback StringCallback = void (DOMString result);
+ dictionary SamlUserSessionProperties {
+ // User's email address.
+ DOMString email;
+
+ // User's Gaia ID.
+ DOMString gaiaId;
+
+ // User's password.
+ DOMString password;
+
+ // Oauth_code cookie set in the SAML handshake.
+ DOMString oauthCode;
+ };
interface Functions {
// Launches a managed guest session if one is set up via the admin console.
@@ -40,23 +53,45 @@ namespace login {
[supportsPromises] static void fetchDataForNextLoginAttempt(
StringCallback callback);
- // Locks the current managed guest session. The session has to have been
- // launched by $(ref:launchManagedGuestSession) with a password.
- [supportsPromises] static void lockManagedGuestSession(
+ // Deprecated. Please use $(ref:lockCurrentSession) instead.
+ [supportsPromises, deprecated="Use $(ref:lockCurrentSession) instead."]
+ static void lockManagedGuestSession(optional VoidCallback callback);
+
+ // Locks the current session. The session has to be either a user session or
+ // a Managed Guest Session launched by $(ref:launchManagedGuestSession) with
+ // a password.
+ [supportsPromises] static void lockCurrentSession(
optional VoidCallback callback);
- // Unlocks a managed guest session which was launched by
- // $(ref:launchManagedGuestSession) with a password. The session will
- // unlock if the provided password matches the one provided earlier.
+ // Deprecated. Please use $(ref:unlockCurrentSession) instead.
+ [supportsPromises, deprecated="Use $(ref:unlockCurrentSession) instead."]
+ static void unlockManagedGuestSession(
+ DOMString password,
+ optional VoidCallback callback);
+
+ // Unlocks the current session. The session has to be either a user session
+ // or a Managed Guest Session launched by $(ref:launchManagedGuestSession)
+ // with a password. The session will unlock if the provided password matches
+ // the one used to launch the session.
// |password|: The password which will be used to unlock the session.
// |callback|: Note: If the function succeeds, the callback is not
// guaranteed to be invoked as the extension will be disabled when the
// session starts. Use this callback only to handle the failure case by
// checking $(ref:runtime.lastError).
- [supportsPromises] static void unlockManagedGuestSession(
+ [supportsPromises] static void unlockCurrentSession(
DOMString password,
optional VoidCallback callback);
+ // Launches a SAML-backed user session.
+ // |properties|: User's email address, gaia ID, password and oauth_code.
+ // |callback|: Note: If the function succeeds, the callback is not
+ // guaranteed to be invoked as the extension will be disabled when the
+ // session starts. Use this callback only to handle the failure case by
+ // checking $(ref:runtime.lastError).
+ [supportsPromises] static void launchSamlUserSession(
+ SamlUserSessionProperties properties,
+ optional VoidCallback callback);
+
// Starts a ChromeOS Managed Guest Session which will host the shared user
// sessions. An initial shared session is entered with |password| as the
// password. When this shared session is locked, it can only be unlocked by
@@ -75,7 +110,7 @@ namespace login {
// Enters the shared session with the given password. If the session is
// locked, it can only be unlocked by calling $(ref:unlockSharedSession)
- // with the same password.
+ // with the same password.
// Fails if calling extension is not the same as the one which called
// $(ref:launchSharedManagedGuestSession) or there is already a shared
// session running. Can only be called from the lock screen.
@@ -122,5 +157,24 @@ namespace login {
DOMString dataForNextLoginAttempt,
optional VoidCallback callback);
+ // Dispatches a $(ref:onRequestExternalLogout) event. Called from the login
+ // screen extension on the lock screen.
+ [supportsPromises] static void requestExternalLogout(
+ optional VoidCallback callback);
+
+ // Dispatches a $(ref:onExternalLogoutDone) event. Called from the
+ // in-session extension.
+ [supportsPromises] static void notifyExternalLogoutDone(
+ optional VoidCallback callback);
+ };
+
+ interface Events {
+ // Event dispatched when an external logout is requested. The in-session
+ // extension listens for this event.
+ static void onRequestExternalLogout();
+
+ // Event dispatched when an external logout is completed. The login screen
+ // extension on the lock screen listens for this event.
+ static void onExternalLogoutDone();
};
};
diff --git a/chromium/chrome/common/extensions/api/page_action.json b/chromium/chrome/common/extensions/api/page_action.json
index 69cdd98251c..9f0f461bed5 100644
--- a/chromium/chrome/common/extensions/api/page_action.json
+++ b/chromium/chrome/common/extensions/api/page_action.json
@@ -31,18 +31,18 @@
"type": "function",
"description": "Shows the page action. The page action is shown whenever the tab is selected.",
"parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- {"type": "function", "name": "callback", "parameters": [], "optional": true}
- ]
+ {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
+ ],
+ "returns_async": {"name": "callback", "parameters": [], "optional": true}
},
{
"name": "hide",
"type": "function",
"description": "Hides the page action. Hidden page actions still appear in the Chrome toolbar, but are grayed out.",
"parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- {"type": "function", "name": "callback", "parameters": [], "optional": true}
- ]
+ {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
+ ],
+ "returns_async": {"name": "callback", "parameters": [], "optional": true}
},
{
"name": "setTitle",
@@ -56,9 +56,9 @@
"tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
"title": {"type": "string", "description": "The tooltip string."}
}
- },
- {"type": "function", "name": "callback", "parameters": [], "optional": true}
- ]
+ }
+ ],
+ "returns_async": {"name": "callback", "parameters": [], "optional": true}
},
{
"name": "getTitle",
@@ -68,18 +68,17 @@
{
"name": "details",
"$ref": "TabDetails"
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
},
{
"name": "setIcon",
@@ -120,14 +119,13 @@
"optional": true
}
}
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
},
{
"name": "setPopup",
@@ -144,9 +142,9 @@
"description": "The relative path to the HTML file to show in a popup. If set to the empty string (<code>''</code>), no popup is shown."
}
}
- },
- {"type": "function", "name": "callback", "parameters": [], "optional": true}
- ]
+ }
+ ],
+ "returns_async": {"name": "callback", "parameters": [], "optional": true}
},
{
"name": "getPopup",
@@ -156,18 +154,17 @@
{
"name": "details",
"$ref": "TabDetails"
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
}
],
"events": [
diff --git a/chromium/chrome/common/extensions/api/passwords_private.idl b/chromium/chrome/common/extensions/api/passwords_private.idl
index aaf8b7b0c01..bb82a16a54b 100644
--- a/chromium/chrome/common/extensions/api/passwords_private.idl
+++ b/chromium/chrome/common/extensions/api/passwords_private.idl
@@ -89,6 +89,9 @@ namespace passwordsPrivate {
// If true, the entry came from the Gaia-account-scoped password store
// rather than from the profile-scoped one.
boolean fromAccountStore;
+
+ // The value of the attached note.
+ DOMString passwordNote;
};
dictionary ExceptionEntry {
@@ -210,6 +213,18 @@ namespace passwordsPrivate {
boolean useAccountStore;
};
+ // Object describing the changes for a password entry.
+ dictionary ChangeSavedPasswordParams {
+ // The new username of the password.
+ DOMString username;
+
+ // The password value to be saved.
+ DOMString password;
+
+ // The note attached to the password. Omitting the note will clear it.
+ DOMString? note;
+ };
+
callback PlaintextPasswordCallback = void(DOMString password);
callback PasswordListCallback = void(PasswordUiEntry[] entries);
callback ExceptionListCallback = void(ExceptionEntry[] exceptions);
@@ -234,13 +249,11 @@ namespace passwordsPrivate {
// the password for accountId and deviceId. Invokes |callback| or raises an
// error depending on whether the operation succeeded.
// |ids|: The ids for the password entry being updated.
- // |new_username|: The new username.
- // |new_password|: The new password.
+ // |params|: The dictionary which holds the changed parameters.
// |callback|: The callback that gets invoked in the end.
[supportsPromises] static void changeSavedPassword(
long[] ids,
- DOMString new_username,
- DOMString new_password,
+ ChangeSavedPasswordParams params,
optional VoidCallback callback);
// Removes the saved password corresponding to |id|. If no saved password
diff --git a/chromium/chrome/common/extensions/api/platform_keys.idl b/chromium/chrome/common/extensions/api/platform_keys.idl
index 9e315258c8a..c2b4af8d48a 100644
--- a/chromium/chrome/common/extensions/api/platform_keys.idl
+++ b/chromium/chrome/common/extensions/api/platform_keys.idl
@@ -120,7 +120,7 @@ namespace platformKeys {
// |certificate|: The certificate of a $(ref:Match) returned by
// $(ref:selectClientCertificates).
// |parameters|: Determines signature/hash algorithm parameters additionally
- // to the parameters fixed by the key itself. The same parameters are
+ // to the parameters fixed by the key itself. The same parameters are
// accepted as by WebCrypto's <a
// href="http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey">importKey</a>
// function, e.g. <code>RsaHashedImportParams</code> for a RSASSA-PKCS1-v1_5
diff --git a/chromium/chrome/common/extensions/api/processes.idl b/chromium/chrome/common/extensions/api/processes.idl
index 0e0c2da8743..eb730e82308 100644
--- a/chromium/chrome/common/extensions/api/processes.idl
+++ b/chromium/chrome/common/extensions/api/processes.idl
@@ -54,8 +54,8 @@ namespace processes {
long naclDebugPort;
// Array of TaskInfos representing the tasks running on this process.
TaskInfo[] tasks;
- // The most recent measurement of the process’s CPU usage, expressed as the
- // percentage of a single CPU core used in total, by all of the process’s
+ // The most recent measurement of the process's CPU usage, expressed as the
+ // percentage of a single CPU core used in total, by all of the process's
// threads. This gives a value from zero to CpuInfo.numOfProcessors*100,
// which can exceed 100% in multi-threaded processes.
// Only available when receiving the object as part of a callback from
@@ -77,7 +77,7 @@ namespace processes {
// bytes. Only available when receiving the object as part of a callback
// from onUpdated or onUpdatedWithMemory.
double? jsMemoryUsed;
- // The most recent measurement of the process’s SQLite memory usage, in
+ // The most recent measurement of the process's SQLite memory usage, in
// bytes. Only available when receiving the object as part of a callback
// from onUpdated or onUpdatedWithMemory.
double? sqliteMemory;
diff --git a/chromium/chrome/common/extensions/api/scripting.idl b/chromium/chrome/common/extensions/api/scripting.idl
index 550a51999ff..d87a87292d9 100644
--- a/chromium/chrome/common/extensions/api/scripting.idl
+++ b/chromium/chrome/common/extensions/api/scripting.idl
@@ -31,6 +31,11 @@ namespace scripting {
// of specific frames to inject into.
long[]? frameIds;
+ // The <a href="https://developer.chrome.com/extensions/webNavigation#document_ids">IDs</a>
+ // of specific documentIds to inject into. This must not be set if
+ // <code>frameIds</code> is set.
+ [nodoc] DOMString[]? documentIds;
+
// Whether the script should inject into all frames within the tab. Defaults
// to false.
// This must not be true if <code>frameIds</code> is specified.
@@ -69,6 +74,12 @@ namespace scripting {
// The JavaScript "world" to run the script in. Defaults to
// <code>ISOLATED</code>.
ExecutionWorld? world;
+
+ // Whether the injection should be triggered in the target as soon as
+ // possible. Note that this is not a guarantee that injection will occur
+ // prior to page load, as the page may have already loaded by the time the
+ // script reaches the target.
+ boolean? injectImmediately;
};
dictionary CSSInjection {
@@ -96,6 +107,9 @@ namespace scripting {
// The frame associated with the injection.
long frameId;
+
+ // The document associated with the injection.
+ [nodoc] DOMString documentId;
};
// Describes a content script to be injected into a web page registered
@@ -136,6 +150,9 @@ namespace scripting {
// Specifies if this content script will persist into future sessions. The
// default is true.
boolean? persistAcrossSessions;
+ // The JavaScript "world" to run the script in. Defaults to
+ // <code>ISOLATED</code>.
+ ExecutionWorld? world;
};
// An object used to filter content scripts for
diff --git a/chromium/chrome/common/extensions/api/speech/tts_engine_manifest_handler_unittest.cc b/chromium/chrome/common/extensions/api/speech/tts_engine_manifest_handler_unittest.cc
index 355b75b6042..b123fb7567c 100644
--- a/chromium/chrome/common/extensions/api/speech/tts_engine_manifest_handler_unittest.cc
+++ b/chromium/chrome/common/extensions/api/speech/tts_engine_manifest_handler_unittest.cc
@@ -56,7 +56,7 @@ TEST_F(TtsManifestTest, TtsEngine) {
Testcase("tts_engine_invalid_buffer_size_4.json",
errors::kInvalidTtsRequiresSampleRateAndBufferSize),
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
LoadAndExpectSuccess("tts_engine_valid_voices.json");
LoadAndExpectSuccess("tts_engine_valid_sample_rate_buffer_size.json");
diff --git a/chromium/chrome/common/extensions/api/system_indicator.idl b/chromium/chrome/common/extensions/api/system_indicator.idl
index c24f8142efc..23bc903c819 100644
--- a/chromium/chrome/common/extensions/api/system_indicator.idl
+++ b/chromium/chrome/common/extensions/api/system_indicator.idl
@@ -19,7 +19,8 @@ namespace systemIndicator {
// objects. These objects should have multiple resolutions so that an
// appropriate size can be selected for the given icon size and DPI scaling
// settings. Only square ImageData objects are accepted.
- static void setIcon(SetIconDetails details, optional DoneCallback callback);
+ [supportsPromises] static void setIcon(SetIconDetails details,
+ optional DoneCallback callback);
// Show the icon in the status tray.
static void enable();
diff --git a/chromium/chrome/common/extensions/api/tabs.json b/chromium/chrome/common/extensions/api/tabs.json
index f92fdcb2ba1..421c39e7fe2 100644
--- a/chromium/chrome/common/extensions/api/tabs.json
+++ b/chromium/chrome/common/extensions/api/tabs.json
@@ -206,6 +206,12 @@
"optional": true,
"minimum": 0,
"description": "Open a port to a specific <a href='webNavigation#frame_ids'>frame</a> identified by <code>frameId</code> instead of all frames in the tab."
+ },
+ "documentId": {
+ "type": "string",
+ "optional": true,
+ "nodoc": true,
+ "description": "Open a port to a specific <a href='webNavigation#document_ids'>document</a> identified by <code>documentId</code> instead of all frames in the tab."
}
},
"optional": true
@@ -270,6 +276,12 @@
"optional": true,
"minimum": 0,
"description": "Send a message to a specific <a href='webNavigation#frame_ids'>frame</a> identified by <code>frameId</code> instead of all frames in the tab."
+ },
+ "documentId": {
+ "type": "string",
+ "optional": true,
+ "nodoc": true,
+ "description": "Send a message to a specific <a href='webNavigation#document_ids'>document</a> identified by <code>documentId</code> instead of all frames in the tab."
}
},
"optional": true
diff --git a/chromium/chrome/common/extensions/api/terminal_private.json b/chromium/chrome/common/extensions/api/terminal_private.json
index 95249d77441..2943a3c8af4 100644
--- a/chromium/chrome/common/extensions/api/terminal_private.json
+++ b/chromium/chrome/common/extensions/api/terminal_private.json
@@ -209,6 +209,23 @@
}
},
{
+ "name": "openSettingsSubpage",
+ "type": "function",
+ "description": "Open the System Settings at the specified subpage.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "subpage",
+ "description": "Name of subpage to open. Currently only 'crostini' supported."
+ }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "description": "Callback that will be called when complete.",
+ "parameters": []
+ }
+ },
+ {
"name": "getOSInfo",
"type": "function",
"description": "Returns an object containing info about ChromeOS settings that affect the Terminal, e.g. which feature flags are enabled.",
@@ -232,37 +249,46 @@
}
},
{
- "name": "getSettings",
+ "name": "getPrefs",
"type": "function",
- "description": "Returns an object (DictionaryValue) containing UI settings such as font style and colors used by terminal and stored as a syncable pref. The UI currently has ~70 properties and we wish to allow flexibility for these to change in the UI without updating this API, so we allow any properties.",
- "parameters": [],
+ "description": "Returns specified pref values, ignoring any not in allowlist.",
+ "parameters": [
+ {
+ "name": "paths",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Paths of prefs to fetch."
+ }
+ ],
"returns_async": {
"name": "callback",
- "description": "Callback that will be called with settings.",
+ "description": "Callback that will be called with prefs.",
"parameters": [
{
- "name": "settings",
+ "name": "prefs",
"type": "object",
"additionalProperties":
{
"type": "any" ,
"preserveNull": true
},
- "description": "Settings from prefs.",
+ "description": "prefs keyed by paths.",
"preserveNull": true
}
]
}
},
{
- "name": "setSettings",
+ "name": "setPrefs",
"type": "function",
- "description": "Sets terminal UI settings which are stored as a syncable pref.",
+ "description": "Sets specified prefs, ignoring any not in allowlist.",
"parameters": [
{
- "name": "settings",
+ "name": "prefs",
"type": "object",
- "description": "Settings to update into prefs.",
+ "description": "Prefs to update keyed by paths.",
"additionalProperties":
{
"type": "any" ,
@@ -276,23 +302,6 @@
"description": "Callback that will be called when complete.",
"parameters": []
}
- },
- {
- "name": "getA11yStatus",
- "type": "function",
- "description": "Returns a boolean indicating whether the accessibility spoken feedback is on.",
- "parameters": [],
- "returns_async": {
- "name": "callback",
- "description": "Callback that will be called with the a11y status.",
- "parameters": [
- {
- "name": "a11yStatus",
- "type": "boolean",
- "description": "True if a11y spoken feedback is on."
- }
- ]
- }
}
],
"events": [
@@ -312,21 +321,21 @@
"description": "Type of the output stream from which output came. When process exits, output type will be set to exit"
},
{
- "name": "text",
- "type": "string",
- "description": "Text that was written to the output stream."
+ "name": "data",
+ "type": "binary",
+ "description": "Data that was written to the output stream."
}
]
},
{
- "name": "onSettingsChanged",
+ "name": "onPrefChanged",
"type": "function",
- "description": "Fired when terminal UI settings change.",
+ "description": "Fired when pref changes.",
"parameters": [
{
- "name": "settings",
+ "name": "prefs",
"type": "object",
- "description": "Terminal UI Settings with updated values.",
+ "description": "Prefs keyed by paths.",
"additionalProperties":
{
"type": "any" ,
@@ -335,18 +344,6 @@
"preserveNull": true
}
]
- },
- {
- "name": "onA11yStatusChanged",
- "type": "function",
- "description": "Fired when a11y spoken feedback is enabled/disabled.",
- "parameters": [
- {
- "name": "status",
- "type": "boolean",
- "description": "True if a11y spoken feedback is on."
- }
- ]
}
]
}
diff --git a/chromium/chrome/common/extensions/api/tts.json b/chromium/chrome/common/extensions/api/tts.json
index 5b43290bdd3..569e8a0e16b 100644
--- a/chromium/chrome/common/extensions/api/tts.json
+++ b/chromium/chrome/common/extensions/api/tts.json
@@ -190,15 +190,14 @@
"name": "options",
"optional": true,
"description": "The speech options."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called right away, before speech finishes. Check $(ref:runtime.lastError) to make sure there were no errors. Use options.onEvent to get more detailed feedback.",
- "parameters": []
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "description": "Called right away, before speech finishes. Check $(ref:runtime.lastError) to make sure there were no errors. Use options.onEvent to get more detailed feedback.",
+ "parameters": []
+ }
},
{
"name": "stop",
@@ -222,40 +221,36 @@
"name": "isSpeaking",
"type": "function",
"description": "Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome.",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "speaking",
- "type": "boolean",
- "description": "True if speaking, false otherwise."
- }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "speaking",
+ "type": "boolean",
+ "description": "True if speaking, false otherwise."
+ }
+ ]
+ }
},
{
"name": "getVoices",
"type": "function",
"description": "Gets an array of all available voices.",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "type": "array",
- "name": "voices",
- "items": { "$ref": "TtsVoice" },
- "description": "Array of $(ref:tts.TtsVoice) objects representing the available voices for speech synthesis."
- }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "name": "voices",
+ "items": { "$ref": "TtsVoice" },
+ "description": "Array of $(ref:tts.TtsVoice) objects representing the available voices for speech synthesis."
+ }
+ ]
+ }
}
],
"events": [
diff --git a/chromium/chrome/common/extensions/api/web_authentication_proxy.idl b/chromium/chrome/common/extensions/api/web_authentication_proxy.idl
index f942978cb5c..d89455e2c57 100644
--- a/chromium/chrome/common/extensions/api/web_authentication_proxy.idl
+++ b/chromium/chrome/common/extensions/api/web_authentication_proxy.idl
@@ -44,6 +44,25 @@ namespace webAuthenticationProxy {
// request. Regular processing of WebAuthn requests in the local Chrome
// instance is disabled when these events are subscribed to.
interface Events {
+ // A native application associated with this extension can cause this
+ // event to be fired by writing to a file with a name equal to the
+ // extension's ID in a directory named
+ // `WebAuthenticationProxyRemoteSessionStateChange` inside the [default
+ // user data
+ // directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#default-location).
+ //
+ // The contents of the file should be empty. I.e., it is not necessary to
+ // change the contents of the file in order to trigger this event.
+ //
+ // The native host application may use this event mechanism to signal a
+ // possible remote session state change (i.e. from detached to attached, or
+ // vice versa) while the extension service worker is possibly suspended. In
+ // the handler for this event, the extension can call the `attach()` or
+ // `detach()` API methods accordingly.
+ //
+ // The event listener must be registered synchronously at load time.
+ static void onRemoteSessionStateChange();
+
// Fires when a WebAuthn navigator.credentials.create() call occurs. The
// extension must supply a response by calling
// completeCreateRequest() with the given requestId.
@@ -153,6 +172,10 @@ namespace webAuthenticationProxy {
// session has ended in order to resume regular WebAuthn request
// processing. Extensions automatically become detached if they are
// unloaded.
+ //
+ // Refer to the `onRemoteSessionStateChange` event for signaling a change
+ // of remote session attachment from a native application to to the
+ // (possibly suspended) extension.
[supportsPromises] static void attach(ErrorCallback callback);
// Removes this extension from being the active Web Authentication API
@@ -161,6 +184,10 @@ namespace webAuthenticationProxy {
// This method is typically called when the extension detects that a remote
// desktop session was terminated. Once this method returns without error,
// regular processing of WebAuthn requests continues.
+ //
+ // Refer to the `onRemoteSessionStateChange` event for signaling a change
+ // of remote session attachment from a native application to to the
+ // (possibly suspended) extension.
[supportsPromises] static void detach(ErrorCallback callback);
};
};
diff --git a/chromium/chrome/common/extensions/api/web_navigation.json b/chromium/chrome/common/extensions/api/web_navigation.json
index 1ba0e910466..77f907c9bbd 100644
--- a/chromium/chrome/common/extensions/api/web_navigation.json
+++ b/chromium/chrome/common/extensions/api/web_navigation.json
@@ -30,14 +30,15 @@
"name": "details",
"description": "Information about the frame to retrieve information about.",
"properties": {
- "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab in which the frame is." },
+ "tabId": { "type": "integer", "optional": true, "minimum": 0, "description": "The ID of the tab in which the frame is." },
"processId": {
"type": "integer",
"optional": true,
"deprecated": "Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored.",
"description": "The ID of the process that runs the renderer for this tab."
},
- "frameId": { "type": "integer", "minimum": 0, "description": "The ID of the frame in the given tab." }
+ "frameId": { "type": "integer", "optional": true, "minimum": 0, "description": "The ID of the frame in the given tab." },
+ "documentId": { "type": "string", "optional": true, "nodoc": true, "description": "The UUID of the document. If the frameId and/or tabId are provided they will be validated to match the document found by provided document ID." }
}
}
],
diff --git a/chromium/chrome/common/extensions/api/webview_tag.json b/chromium/chrome/common/extensions/api/webview_tag.json
index 183de3bb37a..a012f388b2a 100644
--- a/chromium/chrome/common/extensions/api/webview_tag.json
+++ b/chromium/chrome/common/extensions/api/webview_tag.json
@@ -1029,7 +1029,7 @@
{
"name": "setUserAgentOverride",
"type": "function",
- "description": "Override the user agent string used by the <code>webview</code> for guest page requests.",
+ "description": "Override the user agent string used by the <code>webview</code> for guest page requests. Overriding will cause the User-Agent Client Hint header values and the values returned by <code>navigator.userAgentData</code> to be empty for guest page requests this override is applied to.",
"parameters": [
{
"name": "userAgent",
diff --git a/chromium/chrome/common/extensions/api/wm_desks_private.idl b/chromium/chrome/common/extensions/api/wm_desks_private.idl
index a36b3c17c8d..1e15436711d 100644
--- a/chromium/chrome/common/extensions/api/wm_desks_private.idl
+++ b/chromium/chrome/common/extensions/api/wm_desks_private.idl
@@ -48,7 +48,7 @@ namespace wmDesksPrivate {
// Launches the desk template with |templateUuid| as a new desk.
// |templateId| should be the unique id for an existing desk template. If
- // no such id can be found or a new desk can’t be created, an error will be
+ // no such id can be found or a new desk can't be created, an error will be
// returned.
static void launchDeskTemplate(DOMString templateUuid,
DeskTemplateVoidCallback callback);
diff --git a/chromium/chrome/common/extensions/command.cc b/chromium/chrome/common/extensions/command.cc
index f2c90272e61..89929f29f7c 100644
--- a/chromium/chrome/common/extensions/command.cc
+++ b/chromium/chrome/common/extensions/command.cc
@@ -297,8 +297,12 @@ std::string Command::CommandPlatform() {
return values::kKeybindingPlatformChromeOs;
#elif BUILDFLAG(IS_LINUX)
return values::kKeybindingPlatformLinux;
+#elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(crbug.com/1312215): Change this once we decide what string should be
+ // used for Fuchsia.
+ return values::kKeybindingPlatformLinux;
#else
- return "";
+#error Unsupported platform
#endif
}
diff --git a/chromium/chrome/common/extensions/command_unittest.cc b/chromium/chrome/common/extensions/command_unittest.cc
index ce3b6b26bea..0cdcd16a63c 100644
--- a/chromium/chrome/common/extensions/command_unittest.cc
+++ b/chromium/chrome/common/extensions/command_unittest.cc
@@ -198,7 +198,7 @@ TEST(CommandTest, ExtensionCommandParsing) {
all_platforms.push_back("mac");
all_platforms.push_back("windows");
- for (size_t i = 0; i < base::size(kTests); ++i)
+ for (size_t i = 0; i < std::size(kTests); ++i)
CheckParse(kTests[i], i, false, all_platforms);
}
@@ -237,6 +237,11 @@ TEST(CommandTest, ExtensionCommandParsingFallback) {
#elif BUILDFLAG(IS_LINUX)
ui::Accelerator accelerator(ui::VKEY_L,
ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
+#elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(crbug.com/1312215): Change this once we decide on a unique platform
+ // key for Fuchsia.
+ ui::Accelerator accelerator(ui::VKEY_L,
+ ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
#else
ui::Accelerator accelerator(ui::VKEY_D,
ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
@@ -300,7 +305,7 @@ TEST(CommandTest, ExtensionCommandParsingPlatformSpecific) {
std::vector<std::string> chromeos;
chromeos.push_back("chromeos");
- for (size_t i = 0; i < base::size(kChromeOsTests); ++i)
+ for (size_t i = 0; i < std::size(kChromeOsTests); ++i)
CheckParse(kChromeOsTests[i], i, true, chromeos);
ConstCommandsTestData kNonChromeOsSearchTests[] = {
@@ -312,7 +317,7 @@ TEST(CommandTest, ExtensionCommandParsingPlatformSpecific) {
non_chromeos.push_back("mac");
non_chromeos.push_back("linux");
- for (size_t i = 0; i < base::size(kNonChromeOsSearchTests); ++i)
+ for (size_t i = 0; i < std::size(kNonChromeOsSearchTests); ++i)
CheckParse(kNonChromeOsSearchTests[i], i, true, non_chromeos);
}
diff --git a/chromium/chrome/common/extensions/extension_constants.cc b/chromium/chrome/common/extensions/extension_constants.cc
index bb06c7bb1e0..506d738e4e8 100644
--- a/chromium/chrome/common/extensions/extension_constants.cc
+++ b/chromium/chrome/common/extensions/extension_constants.cc
@@ -21,7 +21,6 @@ const char kLaunchSourceAppListInfoDialog[] = "chrome-app-launcher-info-dialog";
namespace extension_misc {
const char kCalendarAppId[] = "ejjicmeblgpmajnghnpcppodonldlgfn";
-const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng";
const char kDataSaverExtensionId[] = "pfmgfdlgomnbgkofeojodiodmgpgmkac";
const char kDocsOfflineExtensionId[] = "ghbmnnjooekpmoecnnnilnnbdlolhkhi";
const char kEnterpriseWebStoreAppId[] = "afchcafgojfnemjkcbhfekplkmjaldaa";
@@ -39,7 +38,6 @@ const char kKeyboardExtensionId[] = "mppnpdlheglhdfmldimlhpnegondlapf";
const char* const kBuiltInFirstPartyExtensionIds[] = {
kCalculatorAppId,
kCalendarAppId,
- kCloudPrintAppId,
kDataSaverExtensionId,
kDocsOfflineExtensionId,
kGoogleDriveAppId,
diff --git a/chromium/chrome/common/extensions/extension_constants.h b/chromium/chrome/common/extensions/extension_constants.h
index 592168c0b05..c024513aa42 100644
--- a/chromium/chrome/common/extensions/extension_constants.h
+++ b/chromium/chrome/common/extensions/extension_constants.h
@@ -29,9 +29,6 @@ namespace extension_misc {
// The extension id of the Calendar application.
extern const char kCalendarAppId[];
-// The extension id of the Cloud Print component application.
-extern const char kCloudPrintAppId[];
-
// The extension id of the Data Saver extension.
extern const char kDataSaverExtensionId[];
diff --git a/chromium/chrome/common/extensions/extension_unittest.cc b/chromium/chrome/common/extensions/extension_unittest.cc
index 1433d3a6b67..d6f16ec3f03 100644
--- a/chromium/chrome/common/extensions/extension_unittest.cc
+++ b/chromium/chrome/common/extensions/extension_unittest.cc
@@ -4,7 +4,6 @@
#include <stddef.h>
-#include "base/cxx17_backports.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/path_service.h"
@@ -274,9 +273,9 @@ TEST(ExtensionTest, GetResource) {
scoped_refptr<Extension> extension = LoadManifestStrict("empty_manifest",
"empty.json");
EXPECT_TRUE(extension.get());
- for (size_t i = 0; i < base::size(valid_path_test_cases); ++i)
+ for (size_t i = 0; i < std::size(valid_path_test_cases); ++i)
EXPECT_TRUE(!extension->GetResource(valid_path_test_cases[i]).empty());
- for (size_t i = 0; i < base::size(invalid_path_test_cases); ++i)
+ for (size_t i = 0; i < std::size(invalid_path_test_cases); ++i)
EXPECT_TRUE(extension->GetResource(invalid_path_test_cases[i]).empty());
}
diff --git a/chromium/chrome/common/extensions/manifest_handlers/app_launch_info.cc b/chromium/chrome/common/extensions/manifest_handlers/app_launch_info.cc
index 56b9760dc16..47c51ba5283 100644
--- a/chromium/chrome/common/extensions/manifest_handlers/app_launch_info.cc
+++ b/chromium/chrome/common/extensions/manifest_handlers/app_launch_info.cc
@@ -14,7 +14,6 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/url_constants.h"
#include "components/app_constants/constants.h"
-#include "components/cloud_devices/common/cloud_devices_urls.h"
#include "components/services/app_service/public/mojom/types.mojom-shared.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
@@ -213,14 +212,6 @@ bool AppLaunchInfo::LoadLaunchURL(Extension* extension, std::u16string* error) {
GURL gallery_url(gallery_url_str);
OverrideLaunchURL(extension, gallery_url);
}
- } else if (extension->id() == extension_misc::kCloudPrintAppId) {
- // In order for the --type=service switch to work, we must update the launch
- // URL and web extent.
- GURL url =
- cloud_devices::GetCloudPrintRelativeURL("enable_chrome_connector");
- if (!url.is_empty()) {
- OverrideLaunchURL(extension, url);
- }
}
return true;
diff --git a/chromium/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc b/chromium/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
index a3ee370c167..15d64eccf91 100644
--- a/chromium/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
@@ -43,7 +42,7 @@ TEST_F(ContentScriptsManifestTest, MatchPattern) {
"Error at key 'content_scripts'. Parsing array failed at index "
"0: Error at key 'matches': Parsing array failed at index 0: "
"expected string, got integer")};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
LoadAndExpectSuccess("ports_in_content_scripts.json");
}
diff --git a/chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc b/chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc
index 61346a3fdfb..655d21913e9 100644
--- a/chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/extension.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,7 +16,7 @@ TEST_F(ExcludeMatchesManifestTest, ExcludeMatchPatterns) {
Testcase("exclude_matches.json"),
Testcase("exclude_matches_empty.json")
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_SUCCESS);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_SUCCESS);
Testcase testcases2[] = {
Testcase("exclude_matches_not_list.json",
@@ -26,7 +25,7 @@ TEST_F(ExcludeMatchesManifestTest, ExcludeMatchPatterns) {
Testcase("exclude_matches_invalid_host.json",
"Invalid value for 'content_scripts[0].exclude_matches[0]': "
"Invalid host wildcard.")};
- RunTestcases(testcases2, base::size(testcases2), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases2, std::size(testcases2), EXPECT_TYPE_ERROR);
}
} // namespace extensions
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_about_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_about_unittest.cc
index 792c0df3791..50443cb0690 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_about_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_about_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_url_handlers.h"
@@ -26,5 +25,5 @@ TEST_F(AboutPageManifestTest, AboutPageInSharedModules) {
// Forbid absolute URLs.
Testcase("shared_module_about_absolute.json",
errors::kInvalidAboutPageExpectRelativePath)};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
index 65b96c19482..dd91a987484 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
@@ -31,5 +30,5 @@ TEST_F(ContentSecurityPolicyManifestTest, InsecureContentSecurityPolicy) {
ErrorUtils::FormatErrorMessage(
errors::kInvalidCSPMissingSecureSrc,
keys::kContentSecurityPolicy, "object-src"))};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_WARNING);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_WARNING);
}
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
index 312e60df0aa..27f81e20a50 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "base/strings/string_util.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/extension.h"
@@ -27,7 +26,7 @@ TEST_F(HomepageURLManifestTest, ParseHomepageURLs) {
Testcase("homepage_bad_schema.json",
errors::kInvalidHomepageURL)
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
TEST_F(HomepageURLManifestTest, GetHomepageURL) {
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
index c641d18d3c2..6ebcb145cf7 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/i18n/rtl.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
@@ -11,6 +10,7 @@
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "components/crx_file/id_util.h"
#include "extensions/common/constants.h"
+#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
#include "extensions/common/features/simple_feature.h"
#include "extensions/common/manifest_constants.h"
@@ -89,9 +89,14 @@ TEST_F(InitValueManifestTest, InitFromValueInvalid) {
Testcase("init_invalid_permissions_invalid.json",
errors::kInvalidPermissions),
Testcase("init_invalid_host_permissions_invalid.json",
- errors::kInvalidHostPermissions),
+ ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidHostPermissions, keys::kHostPermissions)),
Testcase("init_invalid_permissions_item_invalid.json",
errors::kInvalidPermission),
+ Testcase(
+ "init_invalid_optional_host_permissions_invalid.json",
+ ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidHostPermissions,
+ keys::kOptionalHostPermissions)),
Testcase("init_invalid_options_url_invalid.json",
errors::kInvalidOptionsPage),
Testcase("init_invalid_locale_invalid.json",
@@ -105,7 +110,7 @@ TEST_F(InitValueManifestTest, InitFromValueInvalid) {
Testcase("init_invalid_short_name_type.json", errors::kInvalidShortName),
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
TEST_F(InitValueManifestTest, InitFromValueValid) {
@@ -167,7 +172,7 @@ TEST_F(InitValueManifestTest, InitFromValueValid) {
Testcase("init_valid_permissions_unknown.json")
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_SUCCESS);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_SUCCESS);
}
TEST_F(InitValueManifestTest, InitFromValueValidNameInRTL) {
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
index b072c8ce6c5..d995661065c 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
@@ -65,7 +64,7 @@ TEST_F(AppLaunchManifestTest, AppLaunchContainer) {
errors::kInvalidLaunchValue,
keys::kLaunchHeight))
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
TEST_F(AppLaunchManifestTest, AppLaunchURL) {
@@ -103,7 +102,7 @@ TEST_F(AppLaunchManifestTest, AppLaunchURL) {
errors::kInvalidLaunchValue,
keys::kLaunchWebURL))
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
scoped_refptr<Extension> extension =
LoadAndExpectSuccess("launch_local_path.json");
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
index 531097f3f13..1caef239e3c 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "base/strings/stringprintf.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/error_utils.h"
@@ -89,7 +88,7 @@ TEST_F(OptionsPageManifestTest, OptionsPageInApps) {
Testcase(
"packaged_app_absolute_options.json",
extensions::manifest_errors::kInvalidOptionsPageExpectUrlInPackage)};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
// Tests for the options_ui.page manifest field.
@@ -110,7 +109,7 @@ TEST_F(OptionsPageManifestTest, OptionsUIPage) {
Testcase testcases[] = {Testcase("options_ui_page_bad_url.json",
"'page': expected page, got null")};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_WARNING);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_WARNING);
}
// Runs TestOptionsUIChromeStyleAndOpenInTab with and without the
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
index 4c71e751585..73758c68526 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
@@ -5,7 +5,6 @@
#include <memory>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/json/json_file_value_serializer.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/error_utils.h"
@@ -46,7 +45,7 @@ TEST_F(PlatformAppsManifestTest, PlatformApps) {
errors::kInvalidManifestVersionUnsupported, "either 2 or 3",
"apps")),
};
- RunTestcases(error_testcases, base::size(error_testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(error_testcases, std::size(error_testcases), EXPECT_TYPE_ERROR);
Testcase warning_testcases[] = {
Testcase(
@@ -66,7 +65,7 @@ TEST_F(PlatformAppsManifestTest, PlatformApps) {
"apps, "
"but this is a packaged app."),
};
- RunTestcases(warning_testcases, base::size(warning_testcases),
+ RunTestcases(warning_testcases, std::size(warning_testcases),
EXPECT_TYPE_WARNING);
}
@@ -83,7 +82,7 @@ TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) {
"'app.content_security_policy' is not allowed for specified extension "
"ID.")
};
- RunTestcases(warning_testcases, base::size(warning_testcases),
+ RunTestcases(warning_testcases, std::size(warning_testcases),
EXPECT_TYPE_WARNING);
// Allowlisted ones can (this is the ID corresponding to the base 64 encoded
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc
index 9360e8f0a37..fa3d30a4156 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
@@ -35,7 +34,7 @@ TEST_F(RequirementsManifestTest, RequirementsInvalid) {
"Error at key 'requirements.3D.features'. Manifest key is required."),
};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
}
TEST_F(RequirementsManifestTest, RequirementsValid) {
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_update_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_update_unittest.cc
index 2020fbe7db6..061af5e3151 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_update_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_update_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/cxx17_backports.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_url_handlers.h"
@@ -27,7 +26,7 @@ TEST_F(UpdateURLManifestTest, UpdateUrls) {
Extension::NO_FLAGS),
Testcase("update_url_valid_4.json", ManifestLocation::kInternal,
Extension::NO_FLAGS)};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_SUCCESS);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_SUCCESS);
// Test some invalid update urls
Testcase testcases2[] = {
@@ -37,5 +36,5 @@ TEST_F(UpdateURLManifestTest, UpdateUrls) {
ManifestLocation::kInternal, Extension::NO_FLAGS),
Testcase("update_url_invalid_3.json", errors::kInvalidUpdateURL,
ManifestLocation::kInternal, Extension::NO_FLAGS)};
- RunTestcases(testcases2, base::size(testcases2), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases2, std::size(testcases2), EXPECT_TYPE_ERROR);
}
diff --git a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_web_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_web_unittest.cc
index 8ff93907cab..a106559c81c 100644
--- a/chromium/chrome/common/extensions/manifest_tests/extension_manifests_web_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/extension_manifests_web_unittest.cc
@@ -2,11 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
-
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,7 +38,7 @@ TEST_F(ChromeManifestTest, AppWebUrls) {
ErrorUtils::FormatErrorMessage(
errors::kInvalidWebURL, base::NumberToString(1),
errors::kCannotClaimAllHostsInExtent))};
- RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR);
+ RunTestcases(testcases, std::size(testcases), EXPECT_TYPE_ERROR);
LoadAndExpectSuccess("web_urls_has_port.json");
diff --git a/chromium/chrome/common/extensions/manifest_tests/permissions_parser_unittest.cc b/chromium/chrome/common/extensions/manifest_tests/permissions_parser_unittest.cc
index 2999bbcb59e..088bae3c86f 100644
--- a/chromium/chrome/common/extensions/manifest_tests/permissions_parser_unittest.cc
+++ b/chromium/chrome/common/extensions/manifest_tests/permissions_parser_unittest.cc
@@ -65,6 +65,34 @@ TEST_F(PermissionsParserTest, RemoveOverlappingHostPermissions) {
testing::UnorderedElementsAre("*://chromium.org/*"));
}
+// Same as the above test, except host permissions are specified in
+// `host_permissions` and `optional_host_permissions` as the extension is
+// running Manifest V3.
+TEST_F(PermissionsParserTest, RemoveOverlappingHostPermissions_ManifestV3) {
+ scoped_refptr<Extension> extension(LoadAndExpectWarning(
+ "permissions_overlapping_host_permissions_mv3.json",
+ ErrorUtils::FormatErrorMessage(
+ manifest_errors::kPermissionMarkedOptionalAndRequired,
+ "https://google.com/*")));
+
+ const URLPatternSet& required_hosts =
+ PermissionsParser::GetRequiredPermissions(extension.get())
+ .explicit_hosts();
+
+ const URLPatternSet& optional_hosts =
+ PermissionsParser::GetOptionalPermissions(extension.get())
+ .explicit_hosts();
+
+ // Check that required hosts have not changed at all while
+ // "https://google.com/maps" is removed from optional hosts as it is a strict
+ // subset of hosts specified as required.
+ EXPECT_THAT(*required_hosts.ToStringVector(),
+ testing::UnorderedElementsAre("https://example.com/*",
+ "https://*.google.com/*"));
+ EXPECT_THAT(*optional_hosts.ToStringVector(),
+ testing::UnorderedElementsAre("*://chromium.org/*"));
+}
+
TEST_F(PermissionsParserTest, RequiredHostPermissionsAllURLs) {
scoped_refptr<Extension> extension(LoadAndExpectWarning(
"permissions_all_urls_host_permissions.json",
@@ -114,11 +142,14 @@ TEST_F(PermissionsParserTest, OptionalHostPermissionsInvalidScheme) {
}
TEST_F(PermissionsParserTest, HostPermissionsKey) {
- std::string expected_warning = ErrorUtils::FormatErrorMessage(
- manifest_errors::kPermissionUnknownOrMalformed, "https://google.com/*");
+ std::vector<std::string> expected_warnings;
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
+ manifest_errors::kPermissionUnknownOrMalformed, "https://google.com/*"));
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
+ manifest_errors::kPermissionUnknownOrMalformed, "http://chromium.org/*"));
scoped_refptr<Extension> extension(
- LoadAndExpectWarning("host_permissions_key.json", expected_warning));
+ LoadAndExpectWarnings("host_permissions_key.json", expected_warnings));
// Expect that the host specified in |host_permissions| is parsed.
const URLPatternSet& required_hosts =
@@ -127,23 +158,39 @@ TEST_F(PermissionsParserTest, HostPermissionsKey) {
EXPECT_THAT(*required_hosts.ToStringVector(),
testing::UnorderedElementsAre("https://example.com/*"));
+
+ // Expect that the host specified in |optional_host_permissions| is parsed.
+ const URLPatternSet& optional_hosts =
+ PermissionsParser::GetOptionalPermissions(extension.get())
+ .explicit_hosts();
+
+ EXPECT_THAT(*optional_hosts.ToStringVector(),
+ testing::UnorderedElementsAre("https://optional.com/*"));
}
TEST_F(PermissionsParserTest, HostPermissionsKeyInvalidHosts) {
- std::string expected_warning = ErrorUtils::FormatErrorMessage(
- manifest_errors::kPermissionUnknownOrMalformed, "malformed_host");
+ std::vector<std::string> expected_warnings;
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
+ manifest_errors::kPermissionUnknownOrMalformed, "malformed_host"));
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
+ manifest_errors::kPermissionUnknownOrMalformed,
+ "optional_malformed_host"));
- scoped_refptr<Extension> extension(LoadAndExpectWarning(
- "host_permissions_key_invalid_hosts.json", expected_warning));
+ scoped_refptr<Extension> extension(LoadAndExpectWarnings(
+ "host_permissions_key_invalid_hosts.json", expected_warnings));
}
TEST_F(PermissionsParserTest, HostPermissionsKeyInvalidScheme) {
- std::string expected_warning = ErrorUtils::FormatErrorMessage(
+ std::vector<std::string> expected_warnings;
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
+ manifest_errors::kInvalidPermissionScheme,
+ manifest_keys::kHostPermissions, "chrome://extensions/"));
+ expected_warnings.push_back(ErrorUtils::FormatErrorMessage(
manifest_errors::kInvalidPermissionScheme,
- manifest_keys::kHostPermissions, "chrome://extensions/");
+ manifest_keys::kOptionalHostPermissions, "chrome://settings/"));
- scoped_refptr<Extension> extension(LoadAndExpectWarning(
- "host_permissions_key_invalid_scheme.json", expected_warning));
+ scoped_refptr<Extension> extension(LoadAndExpectWarnings(
+ "host_permissions_key_invalid_scheme.json", expected_warnings));
}
// Tests that listing a permissions as optional when that permission cannot be
diff --git a/chromium/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chromium/chrome/common/extensions/permissions/chrome_api_permissions.cc
index b056ffe2f6a..ae30c893a33 100644
--- a/chromium/chrome/common/extensions/permissions/chrome_api_permissions.cc
+++ b/chromium/chrome/common/extensions/permissions/chrome_api_permissions.cc
@@ -105,6 +105,7 @@ constexpr APIPermissionInfo::InitInfo permissions_to_register[] = {
APIPermissionInfo::kFlagRequiresManagementUIWarning},
{APIPermissionID::kSearch, "search",
APIPermissionInfo::kFlagDoesNotRequireManagedSessionFullLoginWarning},
+ {APIPermissionID::kFavicon, "favicon"},
{APIPermissionID::kScripting, "scripting",
APIPermissionInfo::kFlagRequiresManagementUIWarning},
{APIPermissionID::kSessions, "sessions"},
diff --git a/chromium/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc b/chromium/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
index 324d33b7740..000c1c0df3b 100644
--- a/chromium/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
+++ b/chromium/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
@@ -132,10 +132,10 @@ TEST_F(ChromePermissionMessageProviderUnittest,
new UsbDevicePermission(PermissionsInfo::GetInstance()->GetByID(
mojom::APIPermissionID::kUsbDevice)));
std::unique_ptr<base::ListValue> devices_list(new base::ListValue());
- devices_list->Append(
- UsbDevicePermissionData(0x02ad, 0x138c, -1, -1).ToValue());
- devices_list->Append(
- UsbDevicePermissionData(0x02ad, 0x138d, -1, -1).ToValue());
+ devices_list->Append(base::Value::FromUniquePtrValue(
+ UsbDevicePermissionData(0x02ad, 0x138c, -1, -1).ToValue()));
+ devices_list->Append(base::Value::FromUniquePtrValue(
+ UsbDevicePermissionData(0x02ad, 0x138d, -1, -1).ToValue()));
ASSERT_TRUE(usb->FromValue(devices_list.get(), nullptr, nullptr));
permissions.insert(std::move(usb));
diff --git a/chromium/chrome/common/extensions/permissions/permission_set_unittest.cc b/chromium/chrome/common/extensions/permissions/permission_set_unittest.cc
index 1247e74e707..c42251cd152 100644
--- a/chromium/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chromium/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -8,7 +8,6 @@
#include <utility>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/json/json_file_value_serializer.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
@@ -689,7 +688,7 @@ TEST(PermissionsTest, IsPrivilegeIncrease) {
{"sockets3", true}, // tcp:a.com:80 -> tcp:*:*
};
- for (size_t i = 0; i < base::size(kTests); ++i) {
+ for (size_t i = 0; i < std::size(kTests); ++i) {
scoped_refptr<Extension> old_extension(
LoadManifest("allow_silent_upgrade",
std::string(kTests[i].base_name) + "_old.json"));
@@ -1673,7 +1672,7 @@ TEST(PermissionsTest, IsHostPrivilegeIncrease) {
false},
};
const PermissionMessageProvider* provider = PermissionMessageProvider::Get();
- for (size_t i = 0; i < base::size(test_cases); ++i) {
+ for (size_t i = 0; i < std::size(test_cases); ++i) {
URLPatternSet explicit_hosts1;
URLPatternSet explicit_hosts2;
const auto& test_case = test_cases[i];
diff --git a/chromium/chrome/common/extensions/permissions/permissions_data_unittest.cc b/chromium/chrome/common/extensions/permissions/permissions_data_unittest.cc
index b1414be305c..7fbd5f8f90e 100644
--- a/chromium/chrome/common/extensions/permissions/permissions_data_unittest.cc
+++ b/chromium/chrome/common/extensions/permissions/permissions_data_unittest.cc
@@ -21,6 +21,7 @@
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
+#include "extensions/common/extensions_client.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/api_permission.h"
@@ -30,6 +31,7 @@
#include "extensions/common/permissions/socket_permission.h"
#include "extensions/common/switches.h"
#include "extensions/common/url_pattern_set.h"
+#include "extensions/common/user_script.h"
#include "extensions/common/value_builder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
diff --git a/chromium/chrome/common/features.gni b/chromium/chrome/common/features.gni
index c453fe0c0d2..77ecd420a94 100644
--- a/chromium/chrome/common/features.gni
+++ b/chromium/chrome/common/features.gni
@@ -15,6 +15,7 @@ import("//device/vr/buildflags/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")
import("//media/media_options.gni")
import("//net/features.gni")
+import("//pdf/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//ui/base/ui_features.gni")
@@ -38,7 +39,7 @@ declare_args() {
# Enable the printing system dialog for platforms that support printing
# and have a system dialog.
- enable_basic_print_dialog = enable_basic_printing && !is_chromeos_ash
+ enable_basic_print_dialog = enable_basic_printing && !is_chromeos
# Enables usage of notifications via Chrome's MessageCenter.
enable_chrome_notifications = is_mac || is_win || is_linux || is_fuchsia
@@ -51,7 +52,7 @@ declare_args() {
enable_hangout_services_extension = is_chrome_branded
enable_one_click_signin = is_win || is_mac || is_fuchsia ||
- ((is_linux || is_chromeos_lacros) && !is_chromecast)
+ ((is_linux && !is_chromecast) || is_chromeos_lacros)
enable_service_discovery = (enable_mdns && !is_android) || is_mac
@@ -60,10 +61,11 @@ declare_args() {
enable_session_service = !is_android && !is_chromecast
# Enables usage of the side search feature, which is disabled by default.
- # This feature is only approved for release on ChromeOS at this time.
- enable_side_search = is_chromeos
+ enable_side_search = toolkit_views
- enable_supervised_users = is_chromeos_ash || is_android
+ # Enables supervision for Family Link users.
+ # Supervision is only supported on Chrome OS and Android.
+ enable_supervised_users = is_chromeos || is_android
# Enables usage of the system-provided notification center.
enable_system_notifications =
@@ -87,6 +89,7 @@ chrome_grit_defines = [
"enable_extensions=$enable_extensions",
"enable_hangout_services_extension=$enable_hangout_services_extension",
"enable_plugins=$enable_plugins",
+ "enable_pdf=$enable_pdf",
"enable_print_preview=$enable_print_preview",
"enable_printing=$enable_basic_printing",
"enable_service_discovery=$enable_service_discovery",
diff --git a/chromium/chrome/common/importer/firefox_importer_utils_unittest.cc b/chromium/chrome/common/importer/firefox_importer_utils_unittest.cc
index 80ba0c42001..7a744884710 100644
--- a/chromium/chrome/common/importer/firefox_importer_utils_unittest.cc
+++ b/chromium/chrome/common/importer/firefox_importer_utils_unittest.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "base/cxx17_backports.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/utf_string_conversions.h"
@@ -101,7 +100,7 @@ struct GetFirefoxImporterNameCase {
} // anonymous namespace
TEST(FirefoxImporterUtilsTest, GetPrefsJsValue) {
- for (size_t i = 0; i < base::size(GetPrefsJsValueCases); ++i) {
+ for (size_t i = 0; i < std::size(GetPrefsJsValueCases); ++i) {
EXPECT_EQ(
GetPrefsJsValueCases[i].pref_value,
GetPrefsJsValue(GetPrefsJsValueCases[i].prefs_content,
@@ -114,7 +113,7 @@ TEST(FirefoxImporterUtilsTest, GetFirefoxImporterName) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
const base::FilePath app_ini_file(
temp_dir.GetPath().AppendASCII("application.ini"));
- for (size_t i = 0; i < base::size(GetFirefoxImporterNameCases); ++i) {
+ for (size_t i = 0; i < std::size(GetFirefoxImporterNameCases); ++i) {
base::WriteFile(app_ini_file,
GetFirefoxImporterNameCases[i].app_ini_content.c_str(),
GetFirefoxImporterNameCases[i].app_ini_content.size());
diff --git a/chromium/chrome/common/importer/profile_import_process_param_traits.h b/chromium/chrome/common/importer/profile_import_process_param_traits.h
index 9b01d8e6f37..a0a33f604cf 100644
--- a/chromium/chrome/common/importer/profile_import_process_param_traits.h
+++ b/chromium/chrome/common/importer/profile_import_process_param_traits.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/notreached.h"
#include "chrome/common/importer/importer_data_types.h"
#include "chrome/common/importer/profile_import.mojom.h"
#include "chrome/common/importer/profile_import_process_param_traits_macros.h"
diff --git a/chromium/chrome/common/media/cdm_host_file_path.cc b/chromium/chrome/common/media/cdm_host_file_path.cc
index fe954034fce..279708d2b46 100644
--- a/chromium/chrome/common/media/cdm_host_file_path.cc
+++ b/chromium/chrome/common/media/cdm_host_file_path.cc
@@ -5,7 +5,6 @@
#include "chrome/common/media/cdm_host_file_path.h"
#include "base/check.h"
-#include "base/cxx17_backports.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
@@ -58,11 +57,11 @@ void AddCdmHostFilePaths(
NOTREACHED();
base::FilePath version_dir(chrome_exe_dir.AppendASCII(CHROME_VERSION_STRING));
- cdm_host_file_paths->reserve(base::size(kUnversionedFiles) +
- base::size(kVersionedFiles));
+ cdm_host_file_paths->reserve(std::size(kUnversionedFiles) +
+ std::size(kVersionedFiles));
// Signature files are always in the version directory.
- for (size_t i = 0; i < base::size(kUnversionedFiles); ++i) {
+ for (size_t i = 0; i < std::size(kUnversionedFiles); ++i) {
base::FilePath file_path = chrome_exe_dir.Append(kUnversionedFiles[i]);
base::FilePath sig_path =
GetSigFilePath(version_dir.Append(kUnversionedFiles[i]));
@@ -71,7 +70,7 @@ void AddCdmHostFilePaths(
cdm_host_file_paths->emplace_back(file_path, sig_path);
}
- for (size_t i = 0; i < base::size(kVersionedFiles); ++i) {
+ for (size_t i = 0; i < std::size(kVersionedFiles); ++i) {
base::FilePath file_path = version_dir.Append(kVersionedFiles[i]);
DVLOG(2) << __func__ << ": versioned file " << i << " at "
<< file_path.value();
diff --git a/chromium/chrome/common/media/cdm_registration.cc b/chromium/chrome/common/media/cdm_registration.cc
index 2fd0dc65e39..7a1d144a0a2 100644
--- a/chromium/chrome/common/media/cdm_registration.cc
+++ b/chromium/chrome/common/media/cdm_registration.cc
@@ -32,10 +32,14 @@
#include "base/no_destructor.h"
#include "components/cdm/common/cdm_manifest.h"
#include "media/cdm/supported_audio_codecs.h"
-// TODO(crbug.com/663554): Needed for WIDEVINE_CDM_VERSION_STRING. Support
-// component updated CDM on all desktop platforms and remove this.
-// This file is In SHARED_INTERMEDIATE_DIR.
+// Needed for WIDEVINE_CDM_MIN_GLIBC_VERSION. This file is in
+// SHARED_INTERMEDIATE_DIR.
#include "widevine_cdm_version.h" // nogncheck
+// The following must be after widevine_cdm_version.h.
+#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+#include <gnu/libc-version.h>
+#include "base/version.h"
+#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/common/media/component_widevine_cdm_hint_file_linux.h"
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -138,6 +142,15 @@ content::CdmInfo* GetComponentUpdatedWidevine() {
void AddSoftwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+ base::Version glibc_version(gnu_get_libc_version());
+ DCHECK(glibc_version.IsValid());
+ if (glibc_version < base::Version(WIDEVINE_CDM_MIN_GLIBC_VERSION)) {
+ LOG(WARNING) << "Widevine not registered because glibc version is too low";
+ return;
+ }
+#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+
// The Widevine CDM on Linux needs to be registered (and loaded) before the
// zygote is locked down. The CDM can be found from the version bundled with
// Chrome (if BUNDLE_WIDEVINE_CDM = true) and/or the version downloaded by
diff --git a/chromium/chrome/common/multi_process_lock.h b/chromium/chrome/common/multi_process_lock.h
deleted file mode 100644
index 622c58fba3b..00000000000
--- a/chromium/chrome/common/multi_process_lock.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 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_COMMON_MULTI_PROCESS_LOCK_H_
-#define CHROME_COMMON_MULTI_PROCESS_LOCK_H_
-
-#include <sys/types.h>
-#include <memory>
-#include <string>
-
-// Platform abstraction for a lock that can be shared between processes.
-// The process that owns the lock will release it on exit even if
-// the exit is due to a crash. Locks are not recursive.
-class MultiProcessLock {
- public:
- // Factory method for creating a multi-process lock.
- // |name| is the name of the lock. The name has special meaning on Windows
- // where the prefix can determine the namespace of the lock.
- // See http://msdn.microsoft.com/en-us/library/aa382954(v=VS.85).aspx for
- // details.
- static std::unique_ptr<MultiProcessLock> Create(const std::string& name);
-
- virtual ~MultiProcessLock() { }
-
- // Try to grab ownership of the lock.
- virtual bool TryLock() = 0;
-
- // Release ownership of the lock.
- virtual void Unlock() = 0;
-};
-
-#endif // CHROME_COMMON_MULTI_PROCESS_LOCK_H_
diff --git a/chromium/chrome/common/multi_process_lock_linux.cc b/chromium/chrome/common/multi_process_lock_linux.cc
deleted file mode 100644
index 6f5d3f7f6f9..00000000000
--- a/chromium/chrome/common/multi_process_lock_linux.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2011 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/common/multi_process_lock.h"
-
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <unistd.h>
-
-#include "base/compiler_specific.h"
-#include "base/logging.h"
-#include "base/posix/eintr_wrapper.h"
-
-class MultiProcessLockLinux : public MultiProcessLock {
- public:
- explicit MultiProcessLockLinux(const std::string& name)
- : name_(name), fd_(-1) { }
-
- MultiProcessLockLinux(const MultiProcessLockLinux&) = delete;
- MultiProcessLockLinux& operator=(const MultiProcessLockLinux&) = delete;
-
- ~MultiProcessLockLinux() override {
- if (fd_ != -1) {
- Unlock();
- }
- }
-
- bool TryLock() override {
- struct sockaddr_un address;
-
- // +1 for terminator, +1 for 0 in position 0 that makes it an
- // abstract named socket.
- const size_t max_len = sizeof(address.sun_path) - 2;
-
- if (fd_ != -1) {
- DLOG(ERROR) << "MultiProcessLock is already locked - " << name_;
- return true;
- }
-
- if (name_.length() > max_len) {
- LOG(ERROR) << "Socket name too long (" << name_.length()
- << " > " << max_len << ") - " << name_;
- return false;
- }
-
- memset(&address, 0, sizeof(address));
- int print_length = snprintf(&address.sun_path[1],
- max_len + 1,
- "%s", name_.c_str());
-
- if (print_length < 0 ||
- print_length > static_cast<int>(max_len)) {
- PLOG(ERROR) << "Couldn't create sun_path - " << name_;
- return false;
- }
-
- // Must set the first character of the path to something non-zero
- // before we call SUN_LEN which depends on strcpy working.
- address.sun_path[0] = '@';
- size_t length = SUN_LEN(&address);
-
- // Reset the first character of the path back to zero so that
- // bind returns an abstract name socket.
- address.sun_path[0] = 0;
- address.sun_family = AF_LOCAL;
-
- int socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0);
- if (socket_fd < 0) {
- PLOG(ERROR) << "Couldn't create socket - " << name_;
- return false;
- }
-
- if (bind(socket_fd,
- reinterpret_cast<sockaddr *>(&address),
- length) == 0) {
- fd_ = socket_fd;
- return true;
- } else {
- DVLOG(1) << "Couldn't bind socket - "
- << &(address.sun_path[1])
- << " Length: " << length;
- if (IGNORE_EINTR(close(socket_fd)) < 0) {
- PLOG(ERROR) << "close";
- }
- return false;
- }
- }
-
- void Unlock() override {
- if (fd_ == -1) {
- DLOG(ERROR) << "Over-unlocked MultiProcessLock - " << name_;
- return;
- }
- if (IGNORE_EINTR(close(fd_)) < 0) {
- DPLOG(ERROR) << "close";
- }
- fd_ = -1;
- }
-
- private:
- std::string name_;
- int fd_;
-};
-
-std::unique_ptr<MultiProcessLock> MultiProcessLock::Create(
- const std::string& name) {
- return std::make_unique<MultiProcessLockLinux>(name);
-}
diff --git a/chromium/chrome/common/multi_process_lock_mac.cc b/chromium/chrome/common/multi_process_lock_mac.cc
deleted file mode 100644
index 2a13cdabbdd..00000000000
--- a/chromium/chrome/common/multi_process_lock_mac.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2011 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/common/multi_process_lock.h"
-
-#include "base/logging.h"
-#include "base/mac/scoped_cftyperef.h"
-#include "base/strings/sys_string_conversions.h"
-
-#include <servers/bootstrap.h>
-
-class MultiProcessLockMac : public MultiProcessLock {
- public:
- explicit MultiProcessLockMac(const std::string& name) : name_(name) { }
-
- MultiProcessLockMac(const MultiProcessLockMac&) = delete;
- MultiProcessLockMac& operator=(const MultiProcessLockMac&) = delete;
-
- ~MultiProcessLockMac() override {
- if (port_ != NULL) {
- Unlock();
- }
- }
-
- bool TryLock() override {
- if (port_ != NULL) {
- DLOG(ERROR) << "MultiProcessLock is already locked - " << name_;
- return true;
- }
-
- if (name_.length() >= BOOTSTRAP_MAX_NAME_LEN) {
- LOG(ERROR) << "Socket name too long (" << name_.length()
- << " >= " << BOOTSTRAP_MAX_NAME_LEN << ") - " << name_;
- return false;
- }
-
- base::ScopedCFTypeRef<CFStringRef> cf_name =
- base::SysUTF8ToCFStringRef(name_);
- port_.reset(CFMessagePortCreateLocal(NULL, cf_name, NULL, NULL, NULL));
- return port_ != NULL;
- }
-
- void Unlock() override {
- if (port_ == NULL) {
- DLOG(ERROR) << "Over-unlocked MultiProcessLock - " << name_;
- return;
- }
- port_.reset();
- }
-
- private:
- std::string name_;
- base::ScopedCFTypeRef<CFMessagePortRef> port_;
-};
-
-std::unique_ptr<MultiProcessLock> MultiProcessLock::Create(
- const std::string& name) {
- return std::make_unique<MultiProcessLockMac>(name);
-}
diff --git a/chromium/chrome/common/multi_process_lock_unittest.cc b/chromium/chrome/common/multi_process_lock_unittest.cc
deleted file mode 100644
index b2972439764..00000000000
--- a/chromium/chrome/common/multi_process_lock_unittest.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (c) 2011 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/common/multi_process_lock.h"
-
-#include <memory>
-
-#include "base/environment.h"
-#include "base/logging.h"
-#include "base/process/kill.h"
-#include "base/rand_util.h"
-#include "base/scoped_environment_variable_override.h"
-#include "base/strings/stringprintf.h"
-#include "base/test/multiprocess_test.h"
-#include "base/time/time.h"
-#include "build/build_config.h"
-#include "testing/multiprocess_func_list.h"
-
-class MultiProcessLockTest : public base::MultiProcessTest {
- public:
- static const char kLockEnvironmentVarName[];
-
- std::string GenerateLockName();
- void ExpectLockIsLocked(const std::string &name);
- void ExpectLockIsUnlocked(const std::string &name);
-};
-
-const char MultiProcessLockTest::kLockEnvironmentVarName[] =
- "MULTI_PROCESS_TEST_LOCK_NAME";
-
-std::string MultiProcessLockTest::GenerateLockName() {
- base::Time now = base::Time::NowFromSystemTime();
- return base::StringPrintf("multi_process_test_lock %lf%lf",
- now.ToDoubleT(), base::RandDouble());
-}
-
-void MultiProcessLockTest::ExpectLockIsLocked(const std::string &name) {
- base::ScopedEnvironmentVariableOverride var(kLockEnvironmentVarName, name);
- EXPECT_FALSE(var.WasSet());
-
- base::Process process = SpawnChild("MultiProcessLockTryFailMain");
- ASSERT_TRUE(process.IsValid());
- int exit_code = -1;
- EXPECT_TRUE(process.WaitForExit(&exit_code));
- EXPECT_EQ(0, exit_code);
-}
-
-void MultiProcessLockTest::ExpectLockIsUnlocked(
- const std::string &name) {
- base::ScopedEnvironmentVariableOverride var(kLockEnvironmentVarName, name);
- EXPECT_FALSE(var.WasSet());
- base::Process process = SpawnChild("MultiProcessLockTrySucceedMain");
- ASSERT_TRUE(process.IsValid());
- int exit_code = -1;
- EXPECT_TRUE(process.WaitForExit(&exit_code));
- EXPECT_EQ(0, exit_code);
-}
-
-TEST_F(MultiProcessLockTest, BasicCreationTest) {
- // Test basic creation/destruction with no lock taken
- std::string name = GenerateLockName();
- std::unique_ptr<MultiProcessLock> scoped = MultiProcessLock::Create(name);
- ExpectLockIsUnlocked(name);
- scoped.reset(NULL);
-}
-
-TEST_F(MultiProcessLockTest, LongNameTest) {
- // Every platform has has it's own max path name size,
- // so different checks are needed for them.
- // POSIX: sizeof(address.sun_path) - 2
- // Mac OS X: BOOTSTRAP_MAX_NAME_LEN
- // Windows: MAX_PATH
- LOG(INFO) << "Following error log due to long name is expected";
-#if BUILDFLAG(IS_MAC)
- std::string name("This is a name that is longer than one hundred and "
- "twenty-eight characters to make sure that we fail appropriately on "
- "Mac OS X when we have a path that is too long for Mac OS X to handle");
-#elif BUILDFLAG(IS_POSIX)
- std::string name("This is a name that is longer than one hundred and eight "
- "characters to make sure that we fail appropriately on POSIX systems "
- "when we have a path that is too long for the system to handle");
-#elif BUILDFLAG(IS_WIN)
- std::string name("This is a name that is longer than two hundred and sixty "
- "characters to make sure that we fail appropriately on Windows when we "
- "have a path that is too long for Windows to handle "
- "This limitation comes from the MAX_PATH definition which is obviously "
- "defined to be a maximum of two hundred and sixty characters ");
-#endif
- std::unique_ptr<MultiProcessLock> test_lock = MultiProcessLock::Create(name);
- EXPECT_FALSE(test_lock->TryLock());
-}
-
-TEST_F(MultiProcessLockTest, SimpleLock) {
- std::string name = GenerateLockName();
- std::unique_ptr<MultiProcessLock> test_lock = MultiProcessLock::Create(name);
- EXPECT_TRUE(test_lock->TryLock());
- ExpectLockIsLocked(name);
- test_lock->Unlock();
- ExpectLockIsUnlocked(name);
-}
-
-TEST_F(MultiProcessLockTest, RecursiveLock) {
- std::string name = GenerateLockName();
- std::unique_ptr<MultiProcessLock> test_lock = MultiProcessLock::Create(name);
- EXPECT_TRUE(test_lock->TryLock());
- ExpectLockIsLocked(name);
- LOG(INFO) << "Following error log "
- << "'MultiProcessLock is already locked' is expected";
- EXPECT_TRUE(test_lock->TryLock());
- ExpectLockIsLocked(name);
- test_lock->Unlock();
- ExpectLockIsUnlocked(name);
- LOG(INFO) << "Following error log "
- << "'Over-unlocked MultiProcessLock' is expected";
- test_lock->Unlock();
- ExpectLockIsUnlocked(name);
- test_lock.reset();
-}
-
-TEST_F(MultiProcessLockTest, LockScope) {
- // Check to see that lock is released when it goes out of scope.
- std::string name = GenerateLockName();
- {
- std::unique_ptr<MultiProcessLock> test_lock =
- MultiProcessLock::Create(name);
- EXPECT_TRUE(test_lock->TryLock());
- ExpectLockIsLocked(name);
- }
- ExpectLockIsUnlocked(name);
-}
-
-MULTIPROCESS_TEST_MAIN(MultiProcessLockTryFailMain) {
- std::string name;
- std::unique_ptr<base::Environment> environment(base::Environment::Create());
- EXPECT_TRUE(environment->GetVar(MultiProcessLockTest::kLockEnvironmentVarName,
- &name));
-#if BUILDFLAG(IS_MAC)
- // OS X sends out a log if a lock fails.
- // Hopefully this will keep people from panicking about it when they
- // are perusing the build logs.
- LOG(INFO) << "Following error log "
- << "\"CFMessagePort: bootstrap_register(): failed 1100 (0x44c) "
- << "'Permission denied'\" is expected";
-#endif // BUILDFLAG(IS_MAC)
- std::unique_ptr<MultiProcessLock> test_lock = MultiProcessLock::Create(name);
-
- // Expect locking to fail because it is claimed by another process.
- bool locked_successfully = test_lock->TryLock();
- EXPECT_FALSE(locked_successfully);
- return locked_successfully;
-}
-
-MULTIPROCESS_TEST_MAIN(MultiProcessLockTrySucceedMain) {
- std::string name;
- std::unique_ptr<base::Environment> environment(base::Environment::Create());
- EXPECT_TRUE(environment->GetVar(MultiProcessLockTest::kLockEnvironmentVarName,
- &name));
- std::unique_ptr<MultiProcessLock> test_lock = MultiProcessLock::Create(name);
-
- // Expect locking to succeed because it is not claimed yet.
- bool locked_successfully = test_lock->TryLock();
- EXPECT_TRUE(locked_successfully);
- return !locked_successfully;
-}
diff --git a/chromium/chrome/common/multi_process_lock_win.cc b/chromium/chrome/common/multi_process_lock_win.cc
deleted file mode 100644
index f7f1e52ed6f..00000000000
--- a/chromium/chrome/common/multi_process_lock_win.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2011 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/common/multi_process_lock.h"
-
-#include "base/logging.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/win/scoped_handle.h"
-
-#include <windows.h>
-
-class MultiProcessLockWin : public MultiProcessLock {
- public:
- explicit MultiProcessLockWin(const std::string& name) : name_(name) { }
-
- MultiProcessLockWin(const MultiProcessLockWin&) = delete;
- MultiProcessLockWin& operator=(const MultiProcessLockWin&) = delete;
-
- ~MultiProcessLockWin() override {
- if (event_.Get() != NULL) {
- Unlock();
- }
- }
-
- bool TryLock() override {
- if (event_.Get() != NULL) {
- DLOG(ERROR) << "MultiProcessLock is already locked - " << name_;
- return true;
- }
-
- if (name_.length() >= MAX_PATH) {
- LOG(ERROR) << "Socket name too long (" << name_.length()
- << " >= " << MAX_PATH << ") - " << name_;
- return false;
- }
-
- std::wstring wname = base::UTF8ToWide(name_);
- event_.Set(CreateEvent(NULL, FALSE, FALSE, wname.c_str()));
- if (event_.Get() && GetLastError() != ERROR_ALREADY_EXISTS) {
- return true;
- } else {
- event_.Set(NULL);
- return false;
- }
- }
-
- void Unlock() override {
- if (event_.Get() == NULL) {
- DLOG(ERROR) << "Over-unlocked MultiProcessLock - " << name_;
- return;
- }
- event_.Set(NULL);
- }
-
- private:
- std::string name_;
- base::win::ScopedHandle event_;
-};
-
-std::unique_ptr<MultiProcessLock> MultiProcessLock::Create(
- const std::string& name) {
- return std::make_unique<MultiProcessLockWin>(name);
-}
diff --git a/chromium/chrome/common/net/BUILD.gn b/chromium/chrome/common/net/BUILD.gn
index b556c69bb5a..e34814cfc20 100644
--- a/chromium/chrome/common/net/BUILD.gn
+++ b/chromium/chrome/common/net/BUILD.gn
@@ -20,6 +20,7 @@ static_library("net") {
"//chrome:resources",
"//chrome:strings",
"//components/google/core/common",
+ "//components/strings:components_strings_grit",
"//components/url_formatter",
"//crypto",
"//net",
diff --git a/chromium/chrome/common/net/x509_certificate_model.cc b/chromium/chrome/common/net/x509_certificate_model.cc
index 30fdb8e0445..a953c5daff1 100644
--- a/chromium/chrome/common/net/x509_certificate_model.cc
+++ b/chromium/chrome/common/net/x509_certificate_model.cc
@@ -4,18 +4,829 @@
#include "chrome/common/net/x509_certificate_model.h"
+#include "base/containers/adapters.h"
+#include "base/containers/fixed_flat_map.h"
+#include "base/hash/sha1.h"
#include "base/i18n/number_formatting.h"
+#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/grit/generated_resources.h"
+#include "components/strings/grit/components_strings.h"
#include "components/url_formatter/url_formatter.h"
+#include "crypto/sha2.h"
+#include "net/cert/internal/cert_errors.h"
+#include "net/cert/internal/extended_key_usage.h"
+#include "net/cert/internal/parse_name.h"
+#include "net/cert/x509_util.h"
+#include "net/der/encode_values.h"
+#include "net/der/input.h"
+#include "net/der/parse_values.h"
+#include "net/der/tag.h"
+#include "third_party/boringssl/src/include/openssl/bytestring.h"
+#include "third_party/boringssl/src/include/openssl/mem.h"
#include "ui/base/l10n/l10n_util.h"
namespace x509_certificate_model {
+namespace {
+
+// 2.5.4.46 NAME 'dnQualifier'
+constexpr uint8_t kTypeDnQualifierOid[] = {0x55, 0x04, 0x2e};
+// 2.5.4.15 NAME 'businessCategory'
+constexpr uint8_t kTypeBusinessCategory[] = {0x55, 0x04, 0x0f};
+// 2.5.4.17 NAME 'postalCode'
+constexpr uint8_t kTypePostalCode[] = {0x55, 0x04, 0x11};
+
+// TODO(mattm): we can probably just remove these RFC 1274 OIDs.
+//
+// ccitt is {0} but not explicitly defined in the RFC 1274.
+// RFC 1274:
+// data OBJECT IDENTIFIER ::= {ccitt 9}
+// pss OBJECT IDENTIFIER ::= {data 2342}
+// ucl OBJECT IDENTIFIER ::= {pss 19200300}
+// pilot OBJECT IDENTIFIER ::= {ucl 100}
+// pilotAttributeType OBJECT IDENTIFIER ::= {pilot 1}
+// userid ::= {pilotAttributeType 1}
+constexpr uint8_t kRFC1274UidOid[] = {0x09, 0x92, 0x26, 0x89, 0x93,
+ 0xf2, 0x2c, 0x64, 0x01, 0x01};
+// rfc822Mailbox :: = {pilotAttributeType 3}
+constexpr uint8_t kRFC1274MailOid[] = {0x09, 0x92, 0x26, 0x89, 0x93,
+ 0xf2, 0x2c, 0x64, 0x01, 0x03};
+
+// jurisdictionLocalityName (OID: 1.3.6.1.4.1.311.60.2.1.1)
+constexpr uint8_t kEVJurisdictionLocalityName[] = {
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3c, 0x02, 0x01, 0x01};
+// jurisdictionStateOrProvinceName (OID: 1.3.6.1.4.1.311.60.2.1.2)
+constexpr uint8_t kEVJurisdictionStateOrProvinceName[] = {
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3c, 0x02, 0x01, 0x02};
+// jurisdictionCountryName (OID: 1.3.6.1.4.1.311.60.2.1.3)
+constexpr uint8_t kEVJurisdictionCountryName[] = {
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3c, 0x02, 0x01, 0x03};
+
+// From RFC 5280:
+// id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 }
+// In dotted notation: 2.5.29.18
+constexpr uint8_t kIssuerAltNameOid[] = {0x55, 0x1d, 0x12};
+// From RFC 5280:
+// id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::= { id-ce 9 }
+// In dotted notation: 2.5.29.9
+constexpr uint8_t kSubjectDirectoryAttributesOid[] = {0x55, 0x1d, 0x09};
+
+// Old Netscape OIDs. Do we still need all these?
+// #define NETSCAPE_OID 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42
+// #define NETSCAPE_CERT_EXT NETSCAPE_OID, 0x01
+//
+// CONST_OID nsExtCertType[] = { NETSCAPE_CERT_EXT, 0x01 };
+constexpr uint8_t kNetscapeCertificateTypeOid[] = {0x60, 0x86, 0x48, 0x01, 0x86,
+ 0xf8, 0x42, 0x01, 0x01};
+
+// The certificate viewer may be used to view client certificates, so use the
+// relaxed parsing mode. See crbug.com/770323 and crbug.com/788655.
+constexpr auto kNameStringHandling =
+ net::X509NameAttribute::PrintableStringHandling::kAsUTF8Hack;
+
+std::string ProcessRawBytes(net::der::Input data) {
+ return x509_certificate_model::ProcessRawBytes(data.UnsafeData(),
+ data.Length());
+}
+
+OptionalStringOrError FindAttributeOfType(
+ net::der::Input oid,
+ const net::RelativeDistinguishedName& rdn) {
+ // In X.509, RelativeDistinguishedName is a Set, so order has no meaning, and
+ // generally only has one element anyway. Just traverse in encoded order.
+ for (const net::X509NameAttribute& name_attribute : rdn) {
+ if (name_attribute.type == oid) {
+ std::string rv;
+ if (!name_attribute.ValueAsStringWithUnsafeOptions(kNameStringHandling,
+ &rv)) {
+ return Error();
+ }
+ return rv;
+ }
+ }
+ return NotPresent();
+}
+
+// Returns the value of the most general name of |oid| type.
+// Distinguished Names are specified in least to most specific.
+OptionalStringOrError FindFirstNameOfType(net::der::Input oid,
+ const net::RDNSequence& rdns) {
+ for (const net::RelativeDistinguishedName& rdn : rdns) {
+ OptionalStringOrError r = FindAttributeOfType(oid, rdn);
+ if (!absl::holds_alternative<NotPresent>(r))
+ return r;
+ }
+ return NotPresent();
+}
+
+// Returns the value of the most specific name of |oid| type.
+// Distinguished Names are specified in least to most specific.
+OptionalStringOrError FindLastNameOfType(net::der::Input oid,
+ const net::RDNSequence& rdns) {
+ for (const net::RelativeDistinguishedName& rdn : base::Reversed(rdns)) {
+ OptionalStringOrError r = FindAttributeOfType(oid, rdn);
+ if (!absl::holds_alternative<NotPresent>(r))
+ return r;
+ }
+ return NotPresent();
+}
+
+// Returns a string containing the dotted numeric form of |oid| prefixed by
+// "OID.", or an empty string on error.
+std::string OidToNumericString(net::der::Input oid) {
+ CBS cbs;
+ CBS_init(&cbs, oid.UnsafeData(), oid.Length());
+ bssl::UniquePtr<char> text(CBS_asn1_oid_to_text(&cbs));
+ if (!text)
+ return std::string();
+ return std::string("OID.") + text.get();
+}
+
+constexpr auto kOidStringMap = base::MakeFixedFlatMap<net::der::Input, int>({
+ // Distinguished Name fields:
+ {net::der::Input(net::kTypeCommonNameOid), IDS_CERT_OID_AVA_COMMON_NAME},
+ {net::der::Input(net::kTypeStateOrProvinceNameOid),
+ IDS_CERT_OID_AVA_STATE_OR_PROVINCE},
+ {net::der::Input(net::kTypeOrganizationNameOid),
+ IDS_CERT_OID_AVA_ORGANIZATION_NAME},
+ {net::der::Input(net::kTypeOrganizationUnitNameOid),
+ IDS_CERT_OID_AVA_ORGANIZATIONAL_UNIT_NAME},
+ {net::der::Input(kTypeDnQualifierOid), IDS_CERT_OID_AVA_DN_QUALIFIER},
+ {net::der::Input(net::kTypeCountryNameOid), IDS_CERT_OID_AVA_COUNTRY_NAME},
+ {net::der::Input(net::kTypeSerialNumberOid),
+ IDS_CERT_OID_AVA_SERIAL_NUMBER},
+ {net::der::Input(net::kTypeLocalityNameOid), IDS_CERT_OID_AVA_LOCALITY},
+ {net::der::Input(net::kTypeDomainComponentOid), IDS_CERT_OID_AVA_DC},
+ {net::der::Input(kRFC1274MailOid), IDS_CERT_OID_RFC1274_MAIL},
+ {net::der::Input(kRFC1274UidOid), IDS_CERT_OID_RFC1274_UID},
+ {net::der::Input(net::kTypeEmailAddressOid),
+ IDS_CERT_OID_PKCS9_EMAIL_ADDRESS},
+
+ // Extended Validation (EV) name fields:
+ {net::der::Input(kTypeBusinessCategory), IDS_CERT_OID_BUSINESS_CATEGORY},
+ {net::der::Input(kEVJurisdictionLocalityName),
+ IDS_CERT_OID_EV_INCORPORATION_LOCALITY},
+ {net::der::Input(kEVJurisdictionStateOrProvinceName),
+ IDS_CERT_OID_EV_INCORPORATION_STATE},
+ {net::der::Input(kEVJurisdictionCountryName),
+ IDS_CERT_OID_EV_INCORPORATION_COUNTRY},
+ {net::der::Input(net::kTypeStreetAddressOid),
+ IDS_CERT_OID_AVA_STREET_ADDRESS},
+ {net::der::Input(kTypePostalCode), IDS_CERT_OID_AVA_POSTAL_CODE},
+
+ // Extension fields (including details of extensions):
+ {net::der::Input(kNetscapeCertificateTypeOid), IDS_CERT_EXT_NS_CERT_TYPE},
+ {net::der::Input(kSubjectDirectoryAttributesOid),
+ IDS_CERT_X509_SUBJECT_DIRECTORY_ATTR},
+ {net::der::Input(net::kSubjectKeyIdentifierOid),
+ IDS_CERT_X509_SUBJECT_KEYID},
+ {net::der::Input(net::kAuthorityKeyIdentifierOid),
+ IDS_CERT_X509_AUTH_KEYID},
+ {net::der::Input(net::kKeyUsageOid), IDS_CERT_X509_KEY_USAGE},
+ {net::der::Input(net::kSubjectAltNameOid), IDS_CERT_X509_SUBJECT_ALT_NAME},
+ {net::der::Input(kIssuerAltNameOid), IDS_CERT_X509_ISSUER_ALT_NAME},
+ {net::der::Input(net::kBasicConstraintsOid),
+ IDS_CERT_X509_BASIC_CONSTRAINTS},
+ {net::der::Input(net::kNameConstraintsOid), IDS_CERT_X509_NAME_CONSTRAINTS},
+ {net::der::Input(net::kCrlDistributionPointsOid),
+ IDS_CERT_X509_CRL_DIST_POINTS},
+ {net::der::Input(net::kCertificatePoliciesOid),
+ IDS_CERT_X509_CERT_POLICIES},
+ {net::der::Input(net::kPolicyMappingsOid), IDS_CERT_X509_POLICY_MAPPINGS},
+ {net::der::Input(net::kPolicyConstraintsOid),
+ IDS_CERT_X509_POLICY_CONSTRAINTS},
+ {net::der::Input(net::kExtKeyUsageOid), IDS_CERT_X509_EXT_KEY_USAGE},
+ {net::der::Input(net::kAuthorityInfoAccessOid),
+ IDS_CERT_X509_AUTH_INFO_ACCESS},
+ {net::der::Input(net::kCpsPointerId), IDS_CERT_PKIX_CPS_POINTER_QUALIFIER},
+ {net::der::Input(net::kUserNoticeId), IDS_CERT_PKIX_USER_NOTICE_QUALIFIER},
+
+ // Extended Key Usages:
+ {net::der::Input(net::kAnyEKU), IDS_CERT_EKU_ANY_EKU},
+ {net::der::Input(net::kServerAuth),
+ IDS_CERT_EKU_TLS_WEB_SERVER_AUTHENTICATION},
+ {net::der::Input(net::kClientAuth),
+ IDS_CERT_EKU_TLS_WEB_CLIENT_AUTHENTICATION},
+ {net::der::Input(net::kCodeSigning), IDS_CERT_EKU_CODE_SIGNING},
+ {net::der::Input(net::kEmailProtection), IDS_CERT_EKU_EMAIL_PROTECTION},
+ {net::der::Input(net::kTimeStamping), IDS_CERT_EKU_TIME_STAMPING},
+ {net::der::Input(net::kOCSPSigning), IDS_CERT_EKU_OCSP_SIGNING},
+ {net::der::Input(net::kNetscapeServerGatedCrypto),
+ IDS_CERT_EKU_NETSCAPE_INTERNATIONAL_STEP_UP},
+});
+
+absl::optional<std::string> GetOidText(net::der::Input oid) {
+ // TODO(crbug.com/1311404): this should be "const auto i" since it's an
+ // iterator, but fixed_flat_map iterators are raw pointers and the
+ // chromium-style plugin complains.
+ const auto* i = kOidStringMap.find(oid);
+ if (i != kOidStringMap.end())
+ return l10n_util::GetStringUTF8(i->second);
+ return absl::nullopt;
+}
+
+std::string GetOidTextOrNumeric(net::der::Input oid) {
+ absl::optional<std::string> oid_text = GetOidText(oid);
+ return oid_text ? *oid_text : OidToNumericString(oid);
+}
+
+std::string ProcessRDN(const net::RelativeDistinguishedName& rdn) {
+ std::string rv;
+ // In X.509, RelativeDistinguishedName is a Set, so "last" has no meaning,
+ // and generally only has one element anyway. Just traverse in encoded
+ // order.
+ for (const net::X509NameAttribute& name_attribute : rdn) {
+ std::string oid_text = GetOidTextOrNumeric(name_attribute.type);
+ if (oid_text.empty())
+ return std::string();
+ rv += oid_text;
+ std::string value;
+ if (!name_attribute.ValueAsStringWithUnsafeOptions(kNameStringHandling,
+ &value)) {
+ return std::string();
+ }
+ rv += " = ";
+ if (name_attribute.type == net::der::Input(net::kTypeCommonNameOid))
+ value = ProcessIDN(value);
+ rv += value;
+ rv += "\n";
+ }
+ return rv;
+}
+
+// Note: This was called ProcessName in the x509_certificate_model_nss impl.
+OptionalStringOrError RDNSequenceToStringMultiLine(
+ const net::RDNSequence& rdns) {
+ if (rdns.empty())
+ return NotPresent();
+
+ std::string rv;
+ // Note: this has high level similarity to net::ConvertToRFC2253, but
+ // this one is multi-line, and prints in reverse order, and has a different
+ // set of oids that it has printable names for, and different handling of
+ // unprintable values, and IDN processing...
+ for (const net::RelativeDistinguishedName& rdn : base::Reversed(rdns)) {
+ std::string rdn_value = ProcessRDN(rdn);
+ if (rdn_value.empty())
+ return Error();
+ rv += rdn_value;
+ }
+ return rv;
+}
+
+// Returns a comma-separated string of the strings in |string_map| for the bits
+// in |bitfield| that are set.
+// string_map may contain -1 for reserved positions that should not be set.
+absl::optional<std::string> ProcessBitField(net::der::BitString bitfield,
+ base::span<const int> string_map,
+ char separator) {
+ std::string rv;
+ for (size_t i = 0; i < string_map.size(); ++i) {
+ if (bitfield.AssertsBit(i)) {
+ int string_id = string_map[i];
+ // TODO(mattm): is returning an error here correct? Or should it encode
+ // some generic string like "reserved bit N set"?
+ if (string_id < 0)
+ return absl::nullopt;
+ if (!rv.empty())
+ rv += separator;
+ rv += l10n_util::GetStringUTF8(string_id);
+ }
+ }
+ // TODO(mattm): should it be an error if bitfield asserts bits beyond |len|?
+ // Or encode them with some generic string like "bit N set"?
+ return rv;
+}
+
+// Returns nullopt on error, or empty string if no bits were set.
+absl::optional<std::string> ProcessBitStringExtension(
+ net::der::Input extension_data,
+ base::span<const int> string_map,
+ char separator) {
+ net::der::BitString decoded;
+ net::der::Input value;
+ net::der::Parser parser(extension_data);
+ if (!parser.ReadTag(net::der::kBitString, &value) || parser.HasMore() ||
+ !net::der::ParseBitString(value, &decoded)) {
+ return absl::nullopt;
+ }
+ return ProcessBitField(decoded, string_map, separator);
+}
+
+absl::optional<std::string> ProcessNSCertTypeExtension(
+ net::der::Input extension_data) {
+ static const int usage_strings[] = {
+ IDS_CERT_USAGE_SSL_CLIENT,
+ IDS_CERT_USAGE_SSL_SERVER,
+ IDS_CERT_EXT_NS_CERT_TYPE_EMAIL,
+ IDS_CERT_USAGE_OBJECT_SIGNER,
+ -1, // reserved
+ IDS_CERT_USAGE_SSL_CA,
+ IDS_CERT_EXT_NS_CERT_TYPE_EMAIL_CA,
+ IDS_CERT_USAGE_OBJECT_SIGNER,
+ };
+ return ProcessBitStringExtension(extension_data, usage_strings, '\n');
+}
+
+absl::optional<std::string> ProcessKeyUsageExtension(
+ net::der::Input extension_data) {
+ static const int usage_strings[] = {
+ IDS_CERT_X509_KEY_USAGE_SIGNING,
+ IDS_CERT_X509_KEY_USAGE_NONREP,
+ IDS_CERT_X509_KEY_USAGE_ENCIPHERMENT,
+ IDS_CERT_X509_KEY_USAGE_DATA_ENCIPHERMENT,
+ IDS_CERT_X509_KEY_USAGE_KEY_AGREEMENT,
+ IDS_CERT_X509_KEY_USAGE_CERT_SIGNER,
+ IDS_CERT_X509_KEY_USAGE_CRL_SIGNER,
+ IDS_CERT_X509_KEY_USAGE_ENCIPHER_ONLY,
+ IDS_CERT_X509_KEY_USAGE_DECIPHER_ONLY,
+ };
+ absl::optional<std::string> rv =
+ ProcessBitStringExtension(extension_data, usage_strings, '\n');
+ if (rv && rv->empty()) {
+ // RFC 5280 4.2.1.3:
+ // When the keyUsage extension appears in a certificate, at least one of
+ // the bits MUST be set to 1.
+ return absl::nullopt;
+ }
+ return rv;
+}
+
+absl::optional<std::string> ProcessBasicConstraints(
+ net::der::Input extension_data) {
+ net::ParsedBasicConstraints basic_constraints;
+ if (!net::ParseBasicConstraints(extension_data, &basic_constraints))
+ return absl::nullopt;
+
+ std::string rv;
+ if (basic_constraints.is_ca)
+ rv = l10n_util::GetStringUTF8(IDS_CERT_X509_BASIC_CONSTRAINT_IS_CA);
+ else
+ rv = l10n_util::GetStringUTF8(IDS_CERT_X509_BASIC_CONSTRAINT_IS_NOT_CA);
+ rv += '\n';
+ if (basic_constraints.is_ca) {
+ std::u16string depth;
+ if (!basic_constraints.has_path_len) {
+ depth = l10n_util::GetStringUTF16(
+ IDS_CERT_X509_BASIC_CONSTRAINT_PATH_LEN_UNLIMITED);
+ } else {
+ depth = base::FormatNumber(basic_constraints.path_len);
+ }
+ rv += l10n_util::GetStringFUTF8(IDS_CERT_X509_BASIC_CONSTRAINT_PATH_LEN,
+ depth);
+ }
+ return rv;
+}
+
+absl::optional<std::string> ProcessExtKeyUsage(net::der::Input extension_data) {
+ std::vector<net::der::Input> extended_key_usage;
+ if (!net::ParseEKUExtension(extension_data, &extended_key_usage))
+ return absl::nullopt;
+
+ std::string rv;
+ for (const auto& oid : extended_key_usage) {
+ std::string numeric_oid = OidToNumericString(oid);
+ absl::optional<std::string> oid_text = GetOidText(oid);
+
+ // If oid is one that is recognized, display the text description along
+ // with the numeric_oid. If we don't recognize the OID just display the
+ // numeric OID alone.
+ if (!oid_text) {
+ rv += numeric_oid;
+ } else {
+ rv += l10n_util::GetStringFUTF8(IDS_CERT_EXT_KEY_USAGE_FORMAT,
+ base::UTF8ToUTF16(*oid_text),
+ base::UTF8ToUTF16(numeric_oid));
+ }
+ rv += '\n';
+ }
+ return rv;
+}
+
+OptionalStringOrError ProcessNameValue(net::der::Input name_value) {
+ net::RDNSequence rdns;
+ if (!net::ParseNameValue(name_value, &rdns))
+ return Error();
+ return RDNSequenceToStringMultiLine(rdns);
+}
+
+std::string FormatGeneralName(std::u16string key, base::StringPiece value) {
+ return l10n_util::GetStringFUTF8(IDS_CERT_UNKNOWN_OID_INFO_FORMAT, key,
+ base::UTF8ToUTF16(value)) +
+ '\n';
+}
+
+std::string FormatGeneralName(int key_string_id, base::StringPiece value) {
+ return FormatGeneralName(l10n_util::GetStringUTF16(key_string_id), value);
+}
+
+bool ParseOtherName(net::der::Input other_name,
+ net::der::Input* type,
+ net::der::Input* value) {
+ // OtherName ::= SEQUENCE {
+ // type-id OBJECT IDENTIFIER,
+ // value [0] EXPLICIT ANY DEFINED BY type-id }
+ net::der::Parser sequence_parser(other_name);
+ return sequence_parser.ReadTag(net::der::kOid, type) &&
+ sequence_parser.ReadTag(net::der::ContextSpecificConstructed(0),
+ value) &&
+ !sequence_parser.HasMore();
+}
+
+absl::optional<std::string> ProcessGeneralNames(
+ const net::GeneralNames& names) {
+ // Note: The old x509_certificate_model_nss impl would process names in the
+ // order they appeared in the certificate, whereas this impl parses names
+ // into different lists by each type and then processes those in order.
+ // Probably doesn't matter.
+ std::string rv;
+ for (const auto& other_name : names.other_names) {
+ net::der::Input type;
+ net::der::Input value;
+ if (!ParseOtherName(other_name, &type, &value)) {
+ return absl::nullopt;
+ }
+ // x509_certificate_model_nss went a bit further in parsing certain
+ // otherName types, but it probably isn't worth bothering.
+ rv += FormatGeneralName(base::UTF8ToUTF16(GetOidTextOrNumeric(type)),
+ ProcessRawBytes(value));
+ }
+ for (const auto& rfc822_name : names.rfc822_names) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_RFC822_NAME, rfc822_name);
+ }
+ for (const auto& dns_name : names.dns_names) {
+ // TODO(mattm): Should probably do ProcessIDN on dnsNames from
+ // subjectAltName like we do on subject commonName?
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_DNS_NAME, dns_name);
+ }
+ for (const auto& x400_address : names.x400_addresses) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_X400_ADDRESS,
+ ProcessRawBytes(x400_address));
+ }
+ for (const auto& directory_name : names.directory_names) {
+ OptionalStringOrError name = ProcessNameValue(directory_name);
+ if (!absl::holds_alternative<std::string>(name))
+ return absl::nullopt;
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_DIRECTORY_NAME,
+ absl::get<std::string>(name));
+ }
+ for (const auto& edi_party_name : names.edi_party_names) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_EDI_PARTY_NAME,
+ ProcessRawBytes(edi_party_name));
+ }
+ for (const auto& uniform_resource_identifier :
+ names.uniform_resource_identifiers) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_URI,
+ uniform_resource_identifier);
+ }
+ for (const auto& ip_address : names.ip_addresses) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_IP_ADDRESS,
+ ip_address.ToString());
+ }
+ for (const auto& ip_address_range : names.ip_address_ranges) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_IP_ADDRESS,
+ ip_address_range.first.ToString() + '/' +
+ base::NumberToString(ip_address_range.second));
+ }
+ for (const auto& registered_id : names.registered_ids) {
+ rv += FormatGeneralName(IDS_CERT_GENERAL_NAME_REGISTERED_ID,
+ GetOidTextOrNumeric(registered_id));
+ }
+
+ return rv;
+}
+
+absl::optional<std::string> ProcessGeneralNamesTlv(
+ net::der::Input extension_data) {
+ net::CertErrors unused_errors;
+ std::unique_ptr<net::GeneralNames> alt_names =
+ net::GeneralNames::Create(extension_data, &unused_errors);
+ if (!alt_names)
+ return absl::nullopt;
+ return ProcessGeneralNames(*alt_names);
+}
+
+absl::optional<std::string> ProcessGeneralNamesValue(
+ net::der::Input general_names_value) {
+ net::CertErrors unused_errors;
+ std::unique_ptr<net::GeneralNames> alt_names =
+ net::GeneralNames::CreateFromValue(general_names_value, &unused_errors);
+ if (!alt_names)
+ return absl::nullopt;
+ return ProcessGeneralNames(*alt_names);
+}
+
+absl::optional<std::string> ProcessSubjectKeyId(
+ net::der::Input extension_data) {
+ net::der::Input subject_key_identifier;
+ if (!net::ParseSubjectKeyIdentifier(extension_data, &subject_key_identifier))
+ return absl::nullopt;
+ return l10n_util::GetStringFUTF8(
+ IDS_CERT_KEYID_FORMAT,
+ base::ASCIIToUTF16(ProcessRawBytes(subject_key_identifier)));
+}
+
+absl::optional<std::string> ProcessAuthorityKeyId(
+ net::der::Input extension_data) {
+ net::ParsedAuthorityKeyIdentifier authority_key_id;
+ if (!net::ParseAuthorityKeyIdentifier(extension_data, &authority_key_id))
+ return absl::nullopt;
+
+ std::string rv;
+ if (authority_key_id.key_identifier) {
+ rv += l10n_util::GetStringFUTF8(
+ IDS_CERT_KEYID_FORMAT,
+ base::ASCIIToUTF16(ProcessRawBytes(*authority_key_id.key_identifier)));
+ rv += '\n';
+ }
+ if (authority_key_id.authority_cert_issuer) {
+ absl::optional<std::string> s =
+ ProcessGeneralNamesValue(*authority_key_id.authority_cert_issuer);
+ if (!s)
+ return absl::nullopt;
+ rv += l10n_util::GetStringFUTF8(IDS_CERT_ISSUER_FORMAT,
+ base::UTF8ToUTF16(*s));
+ rv += '\n';
+ }
+ if (authority_key_id.authority_cert_serial_number) {
+ rv += l10n_util::GetStringFUTF8(
+ IDS_CERT_SERIAL_NUMBER_FORMAT,
+ base::ASCIIToUTF16(
+ ProcessRawBytes(*authority_key_id.authority_cert_serial_number)));
+ rv += '\n';
+ }
+
+ return rv;
+}
+
+} // namespace
+
+X509CertificateModel::X509CertificateModel(
+ bssl::UniquePtr<CRYPTO_BUFFER> cert_data,
+ std::string nickname)
+ : nickname_(std::move(nickname)), cert_data_(std::move(cert_data)) {
+ DCHECK(cert_data_);
+
+ net::ParseCertificateOptions options;
+ options.allow_invalid_serial_numbers = true;
+ net::CertErrors unused_errors;
+ if (!net::ParseCertificate(
+ net::der::Input(CRYPTO_BUFFER_data(cert_data_.get()),
+ CRYPTO_BUFFER_len(cert_data_.get())),
+ &tbs_certificate_tlv_, &signature_algorithm_tlv_, &signature_value_,
+ &unused_errors) ||
+ !ParseTbsCertificate(tbs_certificate_tlv_, options, &tbs_,
+ &unused_errors) ||
+ !net::ParseName(tbs_.subject_tlv, &subject_rdns_) ||
+ !net::ParseName(tbs_.issuer_tlv, &issuer_rdns_)) {
+ return;
+ }
+ if (tbs_.has_extensions && !ParseExtensions(tbs_.extensions_tlv)) {
+ return;
+ }
+ parsed_successfully_ = true;
+}
+
+X509CertificateModel::~X509CertificateModel() = default;
+
+std::string X509CertificateModel::HashCertSHA256() const {
+ auto hash =
+ crypto::SHA256Hash(net::x509_util::CryptoBufferAsSpan(cert_data_.get()));
+ return base::HexEncode(hash.data(), hash.size());
+}
+
+std::string X509CertificateModel::HashCertSHA256WithSeparators() const {
+ auto hash =
+ crypto::SHA256Hash(net::x509_util::CryptoBufferAsSpan(cert_data_.get()));
+ return ProcessRawBytes(hash.data(), hash.size());
+}
+
+std::string X509CertificateModel::HashCertSHA1WithSeparators() const {
+ auto hash =
+ base::SHA1HashSpan(net::x509_util::CryptoBufferAsSpan(cert_data_.get()));
+ return ProcessRawBytes(hash.data(), hash.size());
+}
+
+std::string X509CertificateModel::GetTitle() const {
+ if (!nickname_.empty())
+ return nickname_;
+
+ if (!parsed_successfully_)
+ return HashCertSHA256();
+
+ if (!subject_rdns_.empty()) {
+ OptionalStringOrError common_name = FindLastNameOfType(
+ net::der::Input(net::kTypeCommonNameOid), subject_rdns_);
+ if (auto* str = absl::get_if<std::string>(&common_name); str)
+ return std::move(*str);
+ if (absl::holds_alternative<Error>(common_name))
+ return HashCertSHA256();
+
+ std::string rv;
+ if (!net::ConvertToRFC2253(subject_rdns_, &rv))
+ return HashCertSHA256();
+ return rv;
+ }
+
+ if (subject_alt_names_) {
+ if (!subject_alt_names_->dns_names.empty())
+ return std::string(subject_alt_names_->dns_names[0]);
+ if (!subject_alt_names_->rfc822_names.empty())
+ return std::string(subject_alt_names_->rfc822_names[0]);
+ }
+
+ return HashCertSHA256();
+}
+
+std::string X509CertificateModel::GetVersion() const {
+ DCHECK(parsed_successfully_);
+ switch (tbs_.version) {
+ case net::CertificateVersion::V1:
+ return "1";
+ case net::CertificateVersion::V2:
+ return "2";
+ case net::CertificateVersion::V3:
+ return "3";
+ }
+}
+
+std::string X509CertificateModel::GetSerialNumberHexified() const {
+ DCHECK(parsed_successfully_);
+ return ProcessRawBytesWithSeparators(tbs_.serial_number.UnsafeData(),
+ tbs_.serial_number.Length(), ':', ':');
+}
+
+bool X509CertificateModel::GetTimes(base::Time* not_before,
+ base::Time* not_after) const {
+ DCHECK(parsed_successfully_);
+ return net::der::GeneralizedTimeToTime(tbs_.validity_not_before,
+ not_before) &&
+ net::der::GeneralizedTimeToTime(tbs_.validity_not_after, not_after);
+}
+
+OptionalStringOrError X509CertificateModel::GetIssuerCommonName() const {
+ DCHECK(parsed_successfully_);
+ // Return the last (most specific) commonName. This matches NSS
+ // CERT_GetCommonName.
+ return FindLastNameOfType(net::der::Input(net::kTypeCommonNameOid),
+ issuer_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetIssuerOrgName() const {
+ DCHECK(parsed_successfully_);
+ // Return the first (most general) orgName. This matches NSS CERT_GetOrgName.
+ return FindFirstNameOfType(net::der::Input(net::kTypeOrganizationNameOid),
+ issuer_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetIssuerOrgUnitName() const {
+ DCHECK(parsed_successfully_);
+ // Return the first (most general) orgUnitName. This matches NSS
+ // CERT_GetOrgUnitName.
+ return FindFirstNameOfType(net::der::Input(net::kTypeOrganizationUnitNameOid),
+ issuer_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetSubjectCommonName() const {
+ DCHECK(parsed_successfully_);
+ // Return the last (most specific) commonName. This matches NSS
+ // CERT_GetCommonName.
+ return FindLastNameOfType(net::der::Input(net::kTypeCommonNameOid),
+ subject_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetSubjectOrgName() const {
+ DCHECK(parsed_successfully_);
+ // Return the first (most general) orgName. This matches NSS CERT_GetOrgName.
+ return FindFirstNameOfType(net::der::Input(net::kTypeOrganizationNameOid),
+ subject_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetSubjectOrgUnitName() const {
+ DCHECK(parsed_successfully_);
+ // Return the first (most general) orgUnitName. This matches NSS
+ // CERT_GetOrgUnitName.
+ return FindFirstNameOfType(net::der::Input(net::kTypeOrganizationUnitNameOid),
+ subject_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetIssuerName() const {
+ DCHECK(parsed_successfully_);
+ return RDNSequenceToStringMultiLine(issuer_rdns_);
+}
+
+OptionalStringOrError X509CertificateModel::GetSubjectName() const {
+ DCHECK(parsed_successfully_);
+ return RDNSequenceToStringMultiLine(subject_rdns_);
+}
+
+std::vector<Extension> X509CertificateModel::GetExtensions(
+ base::StringPiece critical_label,
+ base::StringPiece non_critical_label) const {
+ DCHECK(parsed_successfully_);
+ std::vector<Extension> extensions;
+ for (const auto& extension : extensions_) {
+ Extension processed_extension;
+ processed_extension.name = GetOidTextOrNumeric(extension.oid);
+ processed_extension.value =
+ ProcessExtension(critical_label, non_critical_label, extension);
+ extensions.push_back(processed_extension);
+ }
+ return extensions;
+}
+
+bool X509CertificateModel::ParseExtensions(
+ const net::der::Input& extensions_tlv) {
+ net::CertErrors unused_errors;
+ net::der::Parser parser(extensions_tlv);
+
+ // Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
+ net::der::Parser extensions_parser;
+ if (!parser.ReadSequence(&extensions_parser))
+ return false;
+
+ // The Extensions SEQUENCE must contains at least 1 element (otherwise it
+ // should have been omitted).
+ if (!extensions_parser.HasMore())
+ return false;
+
+ while (extensions_parser.HasMore()) {
+ net::ParsedExtension extension;
+
+ net::der::Input extension_tlv;
+ if (!extensions_parser.ReadRawTLV(&extension_tlv))
+ return false;
+
+ if (!ParseExtension(extension_tlv, &extension))
+ return false;
+
+ extensions_.push_back(extension);
+
+ if (extension.oid == net::der::Input(net::kSubjectAltNameOid)) {
+ subject_alt_names_ =
+ net::GeneralNames::Create(extension.value, &unused_errors);
+ if (!subject_alt_names_)
+ return false;
+ }
+ }
+
+ // By definition the input was a single Extensions sequence, so there
+ // shouldn't be unconsumed data.
+ if (parser.HasMore())
+ return false;
+
+ return true;
+}
+
+std::string X509CertificateModel::ProcessExtension(
+ base::StringPiece critical_label,
+ base::StringPiece non_critical_label,
+ const net::ParsedExtension& extension) const {
+ base::StringPiece criticality =
+ extension.critical ? critical_label : non_critical_label;
+ absl::optional<std::string> processed_extension =
+ ProcessExtensionData(extension);
+ return base::StrCat(
+ {criticality, "\n",
+ (processed_extension
+ ? *processed_extension
+ : l10n_util::GetStringUTF8(IDS_CERT_EXTENSION_DUMP_ERROR))});
+}
+
+absl::optional<std::string> X509CertificateModel::ProcessExtensionData(
+ const net::ParsedExtension& extension) const {
+ if (extension.oid == net::der::Input(kNetscapeCertificateTypeOid))
+ return ProcessNSCertTypeExtension(extension.value);
+ if (extension.oid == net::der::Input(net::kKeyUsageOid))
+ return ProcessKeyUsageExtension(extension.value);
+ if (extension.oid == net::der::Input(net::kBasicConstraintsOid))
+ return ProcessBasicConstraints(extension.value);
+ if (extension.oid == net::der::Input(net::kExtKeyUsageOid))
+ return ProcessExtKeyUsage(extension.value);
+ if (extension.oid == net::der::Input(net::kSubjectAltNameOid)) {
+ // The subjectAltName extension was already parsed in the constructor, use
+ // that rather than parse it again.
+ DCHECK(subject_alt_names_);
+ return ProcessGeneralNames(*subject_alt_names_);
+ }
+ if (extension.oid == net::der::Input(kIssuerAltNameOid))
+ return ProcessGeneralNamesTlv(extension.value);
+ if (extension.oid == net::der::Input(net::kSubjectKeyIdentifierOid))
+ return ProcessSubjectKeyId(extension.value);
+ if (extension.oid == net::der::Input(net::kAuthorityKeyIdentifierOid))
+ return ProcessAuthorityKeyId(extension.value);
+ return ProcessRawBytes(extension.value);
+}
+
// TODO(https://crbug.com/953425): move to anonymous namespace once
// x509_certificate_model_nss is removed.
std::string ProcessIDN(const std::string& input) {
+ if (!base::IsStringASCII(input))
+ return input;
+
// Convert the ASCII input to a string16 for ICU.
std::u16string input16;
input16.reserve(input.length());
diff --git a/chromium/chrome/common/net/x509_certificate_model.h b/chromium/chrome/common/net/x509_certificate_model.h
index edcf1e1bfad..3f09e19734f 100644
--- a/chromium/chrome/common/net/x509_certificate_model.h
+++ b/chromium/chrome/common/net/x509_certificate_model.h
@@ -6,11 +6,127 @@
#define CHROME_COMMON_NET_X509_CERTIFICATE_MODEL_H_
#include <string>
+#include <vector>
+
+#include "base/time/time.h"
+#include "net/cert/internal/parse_certificate.h"
+#include "net/cert/internal/parse_name.h"
+#include "third_party/abseil-cpp/absl/types/variant.h"
+#include "third_party/boringssl/src/include/openssl/pool.h"
// This namespace defines a set of functions to be used in UI-related bits of
// X509 certificates.
namespace x509_certificate_model {
+struct Extension {
+ std::string name;
+ std::string value;
+};
+
+struct NotPresent : absl::monostate {};
+struct Error : absl::monostate {};
+using OptionalStringOrError = absl::variant<Error, NotPresent, std::string>;
+
+class X509CertificateModel {
+ public:
+ // Construct an X509CertificateModel from |cert_data|, which must must not be
+ // nullptr. |nickname| may optionally be provided as a platform-specific
+ // nickname for the certificate, if available.
+ X509CertificateModel(bssl::UniquePtr<CRYPTO_BUFFER> cert_data,
+ std::string nickname);
+ ~X509CertificateModel();
+
+ // ---------------------------------------------------------------------------
+ // These methods are always safe to call even if |cert_data| could not be
+ // parsed.
+
+ // Returns hex SHA256 hash of the certificate data.
+ std::string HashCertSHA256() const;
+ // Returns space-separated and line wrapped hex SHA256 hash of the
+ // certificate data.
+ std::string HashCertSHA256WithSeparators() const;
+ // Returns space-separated and line wrapped hex SHA1 hash of the certificate
+ // data.
+ std::string HashCertSHA1WithSeparators() const;
+
+ // Get something that can be used as a title for the certificate, using the
+ // following priority:
+ // |nickname| passed to constructor
+ // subject commonName
+ // full subject
+ // dnsName or email address from subjectAltNames
+ // If none of those are present, or certificate could not be parsed,
+ // the hex SHA256 hash of the certificate data will be returned.
+ std::string GetTitle() const;
+
+ CRYPTO_BUFFER* cert_buffer() const { return cert_data_.get(); }
+ bool is_valid() const { return parsed_successfully_; }
+
+ // ---------------------------------------------------------------------------
+ // The rest of the methods should only be called if |is_valid()| returns true.
+
+ std::string GetVersion() const;
+ std::string GetSerialNumberHexified() const;
+
+ // Get the validity notBefore and notAfter times, returning true on success
+ // or false on error in parsing or converting to a base::Time.
+ bool GetTimes(base::Time* not_before, base::Time* not_after) const;
+
+ // These methods returns the issuer/subject commonName/orgName/orgUnitName
+ // formatted as a string, if present. Returns NotPresent if the attribute
+ // type was not present, or Error if there was a parsing error.
+ // The Get{Issuer,Subject}CommonName methods return the last (most specific)
+ // commonName, while the other methods return the first (most general) value.
+ // This matches the NSS behaviour of CERT_GetCommonName, CERT_GetOrgName,
+ // CERT_GetOrgUnitName.
+ OptionalStringOrError GetIssuerCommonName() const;
+ OptionalStringOrError GetIssuerOrgName() const;
+ OptionalStringOrError GetIssuerOrgUnitName() const;
+ OptionalStringOrError GetSubjectCommonName() const;
+ OptionalStringOrError GetSubjectOrgName() const;
+ OptionalStringOrError GetSubjectOrgUnitName() const;
+
+ // Get the issuer/subject name as a text block with one line per
+ // attribute-value pair. Will process IDN in commonName, showing original and
+ // decoded forms. Returns NotPresent if the Name was an empty sequence.
+ // (Although note that technically an empty issuer name is invalid.)
+ OptionalStringOrError GetIssuerName() const;
+ OptionalStringOrError GetSubjectName() const;
+
+ // Returns textual representations of the certificate's extensions, if any.
+ // |critical_label| and |non_critical_label| will be used in the returned
+ // extension.value fields to describe extensions that are critical or
+ // non-critical.
+ std::vector<Extension> GetExtensions(
+ base::StringPiece critical_label,
+ base::StringPiece non_critical_label) const;
+
+ private:
+ bool ParseExtensions(const net::der::Input& extensions_tlv);
+ std::string ProcessExtension(base::StringPiece critical_label,
+ base::StringPiece non_critical_label,
+ const net::ParsedExtension& extension) const;
+ absl::optional<std::string> ProcessExtensionData(
+ const net::ParsedExtension& extension) const;
+
+ // Externally provided "nickname" for the cert.
+ std::string nickname_;
+
+ bool parsed_successfully_ = false;
+ bssl::UniquePtr<CRYPTO_BUFFER> cert_data_;
+ net::der::Input tbs_certificate_tlv_;
+ net::der::Input signature_algorithm_tlv_;
+ net::der::BitString signature_value_;
+ net::ParsedTbsCertificate tbs_;
+
+ net::RDNSequence subject_rdns_;
+ net::RDNSequence issuer_rdns_;
+ std::vector<net::ParsedExtension> extensions_;
+
+ // Parsed SubjectAltName extension.
+ std::unique_ptr<net::GeneralNames> subject_alt_names_;
+};
+
// For host values, if they contain IDN Punycode-encoded A-labels, this will
// return a string suitable for display that contains both the original and the
// decoded U-label form. Otherwise, the string will be returned as is.
diff --git a/chromium/chrome/common/net/x509_certificate_model_nss.h b/chromium/chrome/common/net/x509_certificate_model_nss.h
index 7913822e379..c1476dd29d1 100644
--- a/chromium/chrome/common/net/x509_certificate_model_nss.h
+++ b/chromium/chrome/common/net/x509_certificate_model_nss.h
@@ -63,11 +63,6 @@ std::string GetTitle(CERTCertificate* cert_handle);
std::string GetIssuerName(CERTCertificate* cert_handle);
std::string GetSubjectName(CERTCertificate* cert_handle);
-struct Extension {
- std::string name;
- std::string value;
-};
-
typedef std::vector<Extension> Extensions;
void GetExtensions(const std::string& critical_label,
diff --git a/chromium/chrome/common/net/x509_certificate_model_unittest.cc b/chromium/chrome/common/net/x509_certificate_model_unittest.cc
new file mode 100644
index 00000000000..d9cbec4b9fb
--- /dev/null
+++ b/chromium/chrome/common/net/x509_certificate_model_unittest.cc
@@ -0,0 +1,371 @@
+// Copyright 2022 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/common/net/x509_certificate_model.h"
+
+#include "net/cert/x509_util.h"
+#include "net/test/cert_builder.h"
+#include "net/test/cert_test_util.h"
+#include "net/test/test_data_directory.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class X509CertificateModel : public testing::TestWithParam<std::string> {};
+
+using x509_certificate_model::Error;
+using x509_certificate_model::NotPresent;
+using x509_certificate_model::OptionalStringOrError;
+
+TEST_P(X509CertificateModel, InvalidCert) {
+ x509_certificate_model::X509CertificateModel model(
+ net::x509_util::CreateCryptoBuffer(
+ base::span<const uint8_t>({'b', 'a', 'd', '\n'})),
+ GetParam());
+
+ EXPECT_EQ(
+ "1D 7A 36 3C E1 24 30 88 1E C5 6C 9C F1 40 9C 49\nC4 91 04 36 18 E5 98 "
+ "C3 56 E2 95 90 40 87 2F 5A",
+ model.HashCertSHA256WithSeparators());
+ EXPECT_EQ("E9 B3 96 D2 DD DF FD B3 73 BF 2C 6A D0 73 69 6A\nA2 5B 4F 68",
+ model.HashCertSHA1WithSeparators());
+ if (GetParam().empty()) {
+ EXPECT_EQ(
+ "1D7A363CE12430881EC56C9CF1409C49C491043618E598C356E2959040872F5A",
+ model.GetTitle());
+ } else {
+ EXPECT_EQ(GetParam(), model.GetTitle());
+ }
+ EXPECT_FALSE(model.is_valid());
+}
+
+TEST_P(X509CertificateModel, GetGoogleCertFields) {
+ auto cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "google.single.pem");
+ ASSERT_TRUE(cert);
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ EXPECT_EQ(
+ "F6 41 C3 6C FE F4 9B C0 71 35 9E CF 88 EE D9 31\n7B 73 8B 59 89 41 6A "
+ "D4 01 72 0C 0A 4E 2E 63 52",
+ model.HashCertSHA256WithSeparators());
+ EXPECT_EQ("40 50 62 E5 BE FD E4 AF 97 E9 38 2A F1 6C C8 7C\n8F B7 C4 E2",
+ model.HashCertSHA1WithSeparators());
+ ASSERT_TRUE(model.is_valid());
+
+ EXPECT_EQ("3", model.GetVersion());
+ EXPECT_EQ("2F:DF:BC:F6:AE:91:52:6D:0F:9A:A3:DF:40:34:3E:9A",
+ model.GetSerialNumberHexified());
+
+ EXPECT_EQ(OptionalStringOrError("Thawte SGC CA"),
+ model.GetIssuerCommonName());
+ EXPECT_EQ(OptionalStringOrError("Thawte Consulting (Pty) Ltd."),
+ model.GetIssuerOrgName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetIssuerOrgUnitName());
+
+ EXPECT_EQ(OptionalStringOrError("www.google.com"),
+ model.GetSubjectCommonName());
+ EXPECT_EQ(OptionalStringOrError("Google Inc"), model.GetSubjectOrgName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetSubjectOrgUnitName());
+
+ if (GetParam().empty())
+ EXPECT_EQ("www.google.com", model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+
+ EXPECT_EQ(
+ OptionalStringOrError(
+ "CN = Thawte SGC CA\nO = Thawte Consulting (Pty) Ltd.\nC = ZA\n"),
+ model.GetIssuerName());
+ EXPECT_EQ(OptionalStringOrError(
+ "CN = www.google.com\nO = Google Inc\nL = Mountain View\nST = "
+ "California\nC = US\n"),
+ model.GetSubjectName());
+
+ base::Time not_before, not_after;
+ EXPECT_TRUE(model.GetTimes(&not_before, &not_after));
+ // Constants copied from x509_certificate_unittest.cc.
+ // Dec 18 00:00:00 2009 GMT
+ const double kGoogleParseValidFrom = 1261094400;
+ EXPECT_EQ(kGoogleParseValidFrom, not_before.ToDoubleT());
+ // Dec 18 23:59:59 2011 GMT
+ const double kGoogleParseValidTo = 1324252799;
+ EXPECT_EQ(kGoogleParseValidTo, not_after.ToDoubleT());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ ASSERT_EQ(4U, extensions.size());
+ EXPECT_EQ("Certificate Basic Constraints", extensions[0].name);
+ EXPECT_EQ("critical\nIs not a Certification Authority\n",
+ extensions[0].value);
+ EXPECT_EQ("Extended Key Usage", extensions[2].name);
+ EXPECT_EQ(
+ "notcrit\nTLS WWW Server Authentication (OID.1.3.6.1.5.5.7.3.1)\nTLS WWW "
+ "Client Authentication (OID.1.3.6.1.5.5.7.3.2)\nNetscape International "
+ "Step-Up (OID.2.16.840.1.113730.4.1)\n",
+ extensions[2].value);
+ EXPECT_EQ("Authority Information Access", extensions[3].name);
+}
+
+TEST_P(X509CertificateModel, GetNDNCertFields) {
+ auto cert =
+ net::ImportCertFromFile(net::GetTestCertsDirectory(), "ndn.ca.crt");
+ ASSERT_TRUE(cert);
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+ EXPECT_EQ("1", model.GetVersion());
+ // The model just returns the hex of the DER bytes, so the leading zeros are
+ // included.
+ EXPECT_EQ("00:DB:B7:C6:06:47:AF:37:A2", model.GetSerialNumberHexified());
+
+ EXPECT_EQ(OptionalStringOrError("New Dream Network Certificate Authority"),
+ model.GetIssuerCommonName());
+ EXPECT_EQ(OptionalStringOrError("New Dream Network, LLC"),
+ model.GetIssuerOrgName());
+ EXPECT_EQ(OptionalStringOrError("Security"), model.GetIssuerOrgUnitName());
+ EXPECT_EQ(OptionalStringOrError("New Dream Network Certificate Authority"),
+ model.GetSubjectCommonName());
+ EXPECT_EQ(OptionalStringOrError("New Dream Network, LLC"),
+ model.GetSubjectOrgName());
+ EXPECT_EQ(OptionalStringOrError("Security"), model.GetSubjectOrgUnitName());
+
+ if (GetParam().empty())
+ EXPECT_EQ("New Dream Network Certificate Authority", model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+
+ EXPECT_EQ(OptionalStringOrError(
+ "emailAddress = support@dreamhost.com\nCN = New Dream Network "
+ "Certificate "
+ "Authority\nOU = Security\nO = New Dream Network, LLC\nL = Los "
+ "Angeles\nST = California\nC = US\n"),
+ model.GetIssuerName());
+ EXPECT_EQ(OptionalStringOrError(
+ "emailAddress = support@dreamhost.com\nCN = New Dream Network "
+ "Certificate "
+ "Authority\nOU = Security\nO = New Dream Network, LLC\nL = Los "
+ "Angeles\nST = California\nC = US\n"),
+ model.GetSubjectName());
+
+ base::Time not_before, not_after;
+ EXPECT_TRUE(model.GetTimes(&not_before, &not_after));
+ EXPECT_EQ(12800754778, not_before.ToDeltaSinceWindowsEpoch().InSeconds());
+ EXPECT_EQ(13116114778, not_after.ToDeltaSinceWindowsEpoch().InSeconds());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ EXPECT_EQ(0U, extensions.size());
+}
+
+TEST_P(X509CertificateModel, PunyCodeCert) {
+ auto cert =
+ net::ImportCertFromFile(net::GetTestCertsDirectory(), "punycodetest.pem");
+ ASSERT_TRUE(cert);
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+ if (GetParam().empty())
+ EXPECT_EQ("xn--wgv71a119e.com", model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+ EXPECT_EQ(OptionalStringOrError("xn--wgv71a119e.com"),
+ model.GetIssuerCommonName());
+ EXPECT_EQ(OptionalStringOrError("xn--wgv71a119e.com"),
+ model.GetSubjectCommonName());
+ EXPECT_EQ(OptionalStringOrError("CN = xn--wgv71a119e.com (日本語.com)\n"),
+ model.GetIssuerName());
+ EXPECT_EQ(OptionalStringOrError("CN = xn--wgv71a119e.com (日本語.com)\n"),
+ model.GetSubjectName());
+}
+
+TEST_P(X509CertificateModel, SubjectAltNameSanityTest) {
+ auto cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "subjectAltName_sanity_check.pem");
+ ASSERT_TRUE(cert);
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ ASSERT_EQ(2U, extensions.size());
+ EXPECT_EQ("Certificate Subject Alternative Name", extensions[1].name);
+ EXPECT_EQ(
+ "notcrit\n"
+ "OID.1.2.3.4: 0C 09 69 67 6E 6F 72 65 20 6D 65\n"
+ "Email Address: test@test.example\n"
+ "DNS Name: test.example\n"
+ "X.500 Name: CN = 127.0.0.3\n"
+ "\n"
+ "IP Address: 127.0.0.2\nIP Address: fe80::1\n",
+ extensions[1].value);
+}
+
+TEST_P(X509CertificateModel, GlobalsignComCert) {
+ auto cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "2029_globalsign_com_cert.pem");
+ ASSERT_TRUE(cert.get());
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ ASSERT_EQ(9U, extensions.size());
+
+ EXPECT_EQ("Certificate Subject Key ID", extensions[0].name);
+ EXPECT_EQ(
+ "notcrit\nKey ID: 59 BC D9 69 F7 B0 65 BB C8 34 C5 D2 C2 EF 17 78\nA6 "
+ "47 1E 8B",
+ extensions[0].value);
+
+ EXPECT_EQ("Certification Authority Key ID", extensions[1].name);
+ EXPECT_EQ(
+ "notcrit\nKey ID: 8A FC 14 1B 3D A3 59 67 A5 3B E1 73 92 A6 62 91\n7F "
+ "E4 78 30\n",
+ extensions[1].value);
+
+ EXPECT_EQ("Certificate Basic Constraints", extensions[4].name);
+ EXPECT_EQ("notcrit\nIs not a Certification Authority\n", extensions[4].value);
+
+ EXPECT_EQ("Certificate Key Usage", extensions[5].name);
+ EXPECT_EQ(
+ "critical\nSigning\nNon-repudiation\nKey Encipherment\n"
+ "Data Encipherment",
+ extensions[5].value);
+
+ EXPECT_EQ("Extended Key Usage", extensions[6].name);
+ EXPECT_EQ(
+ "notcrit\nTLS WWW Server Authentication (OID.1.3.6.1.5.5.7.3.1)\n"
+ "TLS WWW Client Authentication (OID.1.3.6.1.5.5.7.3.2)\n",
+ extensions[6].value);
+
+ EXPECT_EQ("Netscape Certificate Type", extensions[8].name);
+ EXPECT_EQ("notcrit\nSSL Client Certificate\nSSL Server Certificate",
+ extensions[8].value);
+}
+
+TEST_P(X509CertificateModel, DiginotarCert) {
+ auto cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "diginotar_public_ca_2025.pem");
+ ASSERT_TRUE(cert.get());
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ ASSERT_EQ(7U, extensions.size());
+
+ EXPECT_EQ("Certificate Basic Constraints", extensions[2].name);
+ EXPECT_EQ(
+ "critical\nIs a Certification Authority\n"
+ "Maximum number of intermediate CAs: 0",
+ extensions[2].value);
+}
+
+TEST_P(X509CertificateModel, AuthorityKeyIdentifierAllFields) {
+ auto cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "diginotar_cyber_ca.pem");
+ ASSERT_TRUE(cert.get());
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(cert->cert_buffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+
+ auto extensions = model.GetExtensions("critical", "notcrit");
+ ASSERT_EQ(6U, extensions.size());
+ EXPECT_EQ("Certification Authority Key ID", extensions[3].name);
+ EXPECT_EQ(
+ "notcrit\nKey ID: A6 0C 1D 9F 61 FF 07 17 B5 BF 38 46 DB 43 30 D5\n"
+ "8E B0 52 06\nIssuer: X.500 Name: CN = GTE CyberTrust Global Root\n"
+ "OU = GTE CyberTrust Solutions, Inc.\nO = GTE Corporation\nC = US\n\n\n"
+ "Serial Number: 01 A5\n",
+ extensions[3].value);
+}
+
+TEST_P(X509CertificateModel, SubjectIA5StringInvalidCharacters) {
+ base::FilePath certs_dir = net::GetTestCertsDirectory();
+ std::unique_ptr<net::CertBuilder> builder =
+ net::CertBuilder::FromFile(certs_dir.AppendASCII("ok_cert.pem"), nullptr);
+ ASSERT_TRUE(builder);
+
+ // SEQUENCE {
+ // SET {
+ // SEQUENCE {
+ // # commonName
+ // OBJECT_IDENTIFIER { 2.5.4.3 }
+ // # Not a valid IA5String:
+ // IA5String { "a \xf6 b" }
+ // }
+ // }
+ // }
+ const uint8_t kSubject[] = {0x30, 0x10, 0x31, 0x0e, 0x30, 0x0c,
+ 0x06, 0x03, 0x55, 0x04, 0x03, 0x16,
+ 0x05, 0x61, 0x20, 0xf6, 0x20, 0x62};
+ builder->SetSubject(kSubject);
+
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(builder->GetCertBuffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+ if (GetParam().empty())
+ EXPECT_EQ(model.HashCertSHA256(), model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+ EXPECT_EQ(OptionalStringOrError(Error()), model.GetSubjectCommonName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetSubjectOrgName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetSubjectOrgUnitName());
+ EXPECT_EQ(OptionalStringOrError(Error()), model.GetSubjectName());
+}
+
+TEST_P(X509CertificateModel, SubjectInvalid) {
+ base::FilePath certs_dir = net::GetTestCertsDirectory();
+ std::unique_ptr<net::CertBuilder> builder =
+ net::CertBuilder::FromFile(certs_dir.AppendASCII("ok_cert.pem"), nullptr);
+ ASSERT_TRUE(builder);
+
+ // SEQUENCE { SET { } }
+ const uint8_t kSubject[] = {0x30, 0x02, 0x31, 0x00};
+ builder->SetSubject(kSubject);
+
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(builder->GetCertBuffer()), GetParam());
+ EXPECT_FALSE(model.is_valid());
+}
+
+TEST_P(X509CertificateModel, SubjectEmptySequence) {
+ base::FilePath certs_dir = net::GetTestCertsDirectory();
+ std::unique_ptr<net::CertBuilder> builder =
+ net::CertBuilder::FromFile(certs_dir.AppendASCII("ok_cert.pem"), nullptr);
+ ASSERT_TRUE(builder);
+
+ // SEQUENCE { }
+ const uint8_t kSubject[] = {0x30, 0x00};
+ builder->SetSubject(kSubject);
+
+ {
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(builder->GetCertBuffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+ if (GetParam().empty())
+ EXPECT_EQ(model.HashCertSHA256(), model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()),
+ model.GetSubjectCommonName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetSubjectOrgName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()),
+ model.GetSubjectOrgUnitName());
+ EXPECT_EQ(OptionalStringOrError(NotPresent()), model.GetSubjectName());
+ }
+ {
+ // If subject is empty but subjectAltNames is present, GetTitle checks
+ // there.
+ builder->SetSubjectAltNames({"foo.com", "bar.com"}, {});
+ x509_certificate_model::X509CertificateModel model(
+ bssl::UpRef(builder->GetCertBuffer()), GetParam());
+ ASSERT_TRUE(model.is_valid());
+ if (GetParam().empty())
+ EXPECT_EQ("foo.com", model.GetTitle());
+ else
+ EXPECT_EQ(GetParam(), model.GetTitle());
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(All,
+ X509CertificateModel,
+ testing::Values(std::string(),
+ std::string("nickname")));
diff --git a/chromium/chrome/common/notifications/notification_image_retainer.cc b/chromium/chrome/common/notifications/notification_image_retainer.cc
index 6474365e4dc..1b79f2bd462 100644
--- a/chromium/chrome/common/notifications/notification_image_retainer.cc
+++ b/chromium/chrome/common/notifications/notification_image_retainer.cc
@@ -14,7 +14,6 @@
#include "base/memory/ref_counted_memory.h"
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
-#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/time/default_tick_clock.h"
#include "chrome/common/chrome_paths.h"
diff --git a/chromium/chrome/common/ppapi_utils.cc b/chromium/chrome/common/ppapi_utils.cc
index dc26dad3c9c..6685347e727 100644
--- a/chromium/chrome/common/ppapi_utils.cc
+++ b/chromium/chrome/common/ppapi_utils.cc
@@ -73,11 +73,8 @@
#include "ppapi/c/private/ppb_ext_crx_file_system_private.h"
#include "ppapi/c/private/ppb_file_io_private.h"
#include "ppapi/c/private/ppb_file_ref_private.h"
-#include "ppapi/c/private/ppb_find_private.h"
-#include "ppapi/c/private/ppb_flash_font_file.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_isolated_file_system_private.h"
-#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_proxy_private.h"
#include "ppapi/c/private/ppb_tcp_server_socket_private.h"
#include "ppapi/c/private/ppb_tcp_socket_private.h"
@@ -98,9 +95,7 @@ bool IsSupportedPepperInterface(const char* name) {
return true;
#include "ppapi/thunk/interfaces_ppb_private.h"
-#include "ppapi/thunk/interfaces_ppb_private_flash.h"
#include "ppapi/thunk/interfaces_ppb_private_no_permissions.h"
-#include "ppapi/thunk/interfaces_ppb_private_pdf.h"
#include "ppapi/thunk/interfaces_ppb_public_dev.h"
#include "ppapi/thunk/interfaces_ppb_public_dev_channel.h"
#include "ppapi/thunk/interfaces_ppb_public_socket.h"
diff --git a/chromium/chrome/common/pref_font_webkit_names.h b/chromium/chrome/common/pref_font_webkit_names.h
index a9827622caa..2c8fe4b2045 100644
--- a/chromium/chrome/common/pref_font_webkit_names.h
+++ b/chromium/chrome/common/pref_font_webkit_names.h
@@ -11,7 +11,6 @@
#define WEBKIT_WEBPREFS_FONTS_CURSIVE "webkit.webprefs.fonts.cursive"
#define WEBKIT_WEBPREFS_FONTS_FANTASY "webkit.webprefs.fonts.fantasy"
#define WEBKIT_WEBPREFS_FONTS_FIXED "webkit.webprefs.fonts.fixed"
-#define WEBKIT_WEBPREFS_FONTS_PICTOGRAPH "webkit.webprefs.fonts.pictograph"
#define WEBKIT_WEBPREFS_FONTS_SANSERIF "webkit.webprefs.fonts.sansserif"
#define WEBKIT_WEBPREFS_FONTS_SERIF "webkit.webprefs.fonts.serif"
#define WEBKIT_WEBPREFS_FONTS_STANDARD "webkit.webprefs.fonts.standard"
diff --git a/chromium/chrome/common/pref_names.cc b/chromium/chrome/common/pref_names.cc
index 763ef63000f..66794839f4a 100644
--- a/chromium/chrome/common/pref_names.cc
+++ b/chromium/chrome/common/pref_names.cc
@@ -4,7 +4,8 @@
#include "chrome/common/pref_names.h"
-#include "base/cxx17_backports.h"
+#include <iterator>
+
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -48,6 +49,10 @@ const char kDisableScreenshots[] = "disable_screenshots";
// 4 - Block malicious downloads
const char kDownloadRestrictions[] = "download_restrictions";
+// A boolean specifying whether the new download bubble UI is enabled. If it is
+// set to false, the old download shelf UI will be shown instead.
+const char kDownloadBubbleEnabled[] = "download_bubble_enabled";
+
// If set to true profiles are created in ephemeral mode and do not store their
// data in the profile folder on disk but only in memory.
const char kForceEphemeralProfiles[] = "profile.ephemeral_mode";
@@ -262,7 +267,7 @@ const char* const kWebKitScriptsForFontFamilyMaps[] = {
};
const size_t kWebKitScriptsForFontFamilyMapsLength =
- base::size(kWebKitScriptsForFontFamilyMaps);
+ std::size(kWebKitScriptsForFontFamilyMaps);
// Strings for WebKit font family preferences. If these change, the pref prefix
// in pref_names_util.cc and the pref format in font_settings_api.cc must also
@@ -441,13 +446,6 @@ const char kNetworkQualities[] = "net.network_qualities";
// Pref storing the user's network easter egg game high score.
const char kNetworkEasterEggHighScore[] = "net.easter_egg_high_score";
-#if BUILDFLAG(IS_ANDROID)
-// Last time that a check for cloud policy management was done. This time is
-// recorded on Android so that retries aren't attempted on every startup.
-// Instead the cloud policy registration is retried at least 1 or 3 days later.
-const char kLastPolicyCheckTime[] = "policy.last_policy_check_time";
-#endif
-
// A preference of enum chrome_browser_net::NetworkPredictionOptions shows
// if prediction of network actions is allowed, depending on network type.
// Actions include DNS prefetching, TCP and SSL preconnection, prerendering
@@ -478,6 +476,10 @@ const char kAttestationExtensionAllowlist[] = "attestation.extension_allowlist";
// name and the string value.
const char kPrintingAPIExtensionsAllowlist[] =
"printing.printing_api_extensions_whitelist";
+
+// A boolean specifying whether the insights extension is enabled. If set to
+// true, the CCaaS Chrome component extension will be installed.
+const char kInsightsExtensionEnabled[] = "insights_extension_enabled";
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -834,6 +836,37 @@ const char kHatsAudioSurveyCycleEndTs[] = "hats_audio_cycle_end_timestamp";
// A boolean pref. Indicates if the device is selected for the Audio survey
const char kHatsAudioDeviceIsSelected[] = "hats_audio_device_is_selected";
+// An int64 pref. This is the timestamp, microseconds after epoch, that
+// indicates the end of the most recent Personalization Avatar survey cycle.
+const char kHatsPersonalizationAvatarSurveyCycleEndTs[] =
+ "hats_personalization_avatar_cycle_end_timestamp";
+
+// A boolean pref. Indicates if the device is selected for the Personalization
+// Avatar survey.
+const char kHatsPersonalizationAvatarSurveyIsSelected[] =
+ "hats_personalization_avatar_is_selected";
+
+// An int64 pref. This is the timestamp, microseconds after epoch, that
+// indicates the end of the most recent Personalization Screensaver survey
+// cycle.
+const char kHatsPersonalizationScreensaverSurveyCycleEndTs[] =
+ "hats_personalization_screensaver_cycle_end_timestamp";
+
+// A boolean pref. Indicates if the device is selected for the Personalization
+// Screensaver survey.
+const char kHatsPersonalizationScreensaverSurveyIsSelected[] =
+ "hats_personalization_screensaver_is_selected";
+
+// An int64 pref. This is the timestamp, microseconds after epoch, that
+// indicates the end of the most recent Personalization Wallpaper survey cycle.
+const char kHatsPersonalizationWallpaperSurveyCycleEndTs[] =
+ "hats_personalization_wallpaper_cycle_end_timestamp";
+
+// A boolean pref. Indicates if the device is selected for the Personalization
+// Wallpaper survey.
+const char kHatsPersonalizationWallpaperSurveyIsSelected[] =
+ "hats_personalization_wallpaper_is_selected";
+
// A boolean pref. Indicates if we've already shown a notification to inform the
// current user about the quick unlock feature.
const char kPinUnlockFeatureNotificationShown[] =
@@ -1407,8 +1440,10 @@ const char kPrintingBackgroundGraphicsDefault[] =
// A pref holding the default paper size.
const char kPrintingPaperSizeDefault[] = "printing.paper_size_default";
+#if BUILDFLAG(ENABLE_PRINTING)
// Boolean controlling whether printing is enabled.
const char kPrintingEnabled[] = "printing.enabled";
+#endif // BUILDFLAG(ENABLE_PRINTING)
// Boolean controlling whether print preview is disabled.
const char kPrintPreviewDisabled[] = "printing.print_preview_disabled";
@@ -1722,10 +1757,6 @@ const char kProfileAttributes[] = "profile.info_cache";
// not happen if the browser crashes, so we remove the profile on next start.
const char kProfilesDeleted[] = "profiles.profiles_deleted";
-// This is the location of a list of dictionaries of plugin stability stats.
-const char kStabilityPluginStats[] =
- "user_experience_metrics.stability.plugin_stats2";
-
// On Chrome OS, total number of non-Chrome user process crashes
// since the last report.
const char kStabilityOtherUserCrashCount[] =
@@ -1740,11 +1771,6 @@ const char kStabilityKernelCrashCount[] =
const char kStabilitySystemUncleanShutdownCount[] =
"user_experience_metrics.stability.system_unclean_shutdowns";
-// The keys below are used for the dictionaries in the
-// kStabilityPluginStats list.
-const char kStabilityPluginName[] = "name";
-const char kStabilityPluginCrashes[] = "crashes";
-
// String containing the version of Chrome for which Chrome will not prompt the
// user about setting Chrome as the default browser.
const char kBrowserSuppressDefaultBrowserPrompt[] =
@@ -1779,6 +1805,9 @@ const char kDownloadDefaultDirectory[] = "download.default_directory";
// upgrade a unsafe location to a safe location.
const char kDownloadDirUpgraded[] = "download.directory_upgrade";
+// base::Time value indicating the last timestamp when a download is completed.
+const char kDownloadLastCompleteTime[] = "download.last_complete_time";
+
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_MAC)
const char kOpenPdfDownloadInSystemReader[] =
@@ -1929,6 +1958,12 @@ const char kNtpDisabledModules[] = "NewTabPage.DisabledModules";
const char kNtpModulesOrder[] = "NewTabPage.ModulesOrder";
// Whether NTP modules are visible.
const char kNtpModulesVisible[] = "NewTabPage.ModulesVisible";
+// Number of times user has seen an NTP module.
+const char kNtpModulesShownCount[] = "NewTabPage.ModulesShownCount";
+// Time modules were first shown to user.
+const char kNtpModulesFirstShownTime[] = "NewTabPage.ModulesFirstShownTime";
+// Whether Modular NTP Desktop v1 First Run Experience is visible.
+const char kNtpModulesFreVisible[] = "NewTabPage.ModulesFreVisible";
// List of promos that the user has dismissed while on the NTP.
const char kNtpPromoBlocklist[] = "ntp.promo_blocklist";
// Whether the promo is visible.
@@ -2654,6 +2689,14 @@ const char kLastChromadMigrationAttemptTime[] =
"chromad.last_migration_attempt_time";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_WIN)
+// A list of base::Time value indicating the timestamps when hardware secure
+// decryption was disabled due to errors or crashes. The implementation
+// maintains a max size of the list (e.g. 2).
+const char kHardwareSecureDecryptionDisabledTimes[] =
+ "media.hardware_secure_decryption.disabled_times";
+#endif // BUILDFLAG(IS_WIN)
+
// *************** SERVICE PREFS ***************
// These are attached to the service process.
@@ -3130,10 +3173,6 @@ const char kSandboxExternalProtocolBlocked[] =
"profile.sandbox_external_protocol_blocked";
#if BUILDFLAG(IS_LINUX)
-// Boolean that indicates if native notifications are allowed to be used in
-// place of Chrome notifications. Will be replaced by kAllowSystemNotifications.
-const char kAllowNativeNotifications[] = "native_notifications.allowed";
-
// Boolean that indicates if system notifications are allowed to be used in
// place of Chrome notifications.
const char kAllowSystemNotifications[] = "system_notifications.allowed";
diff --git a/chromium/chrome/common/pref_names.h b/chromium/chrome/common/pref_names.h
index ccaa8e1bf35..8cd8b8a4ba1 100644
--- a/chromium/chrome/common/pref_names.h
+++ b/chromium/chrome/common/pref_names.h
@@ -28,6 +28,7 @@ extern const char kPreinstalledApps[];
extern const char kSafeBrowsingForTrustedSourcesEnabled[];
extern const char kDisableScreenshots[];
extern const char kDownloadRestrictions[];
+extern const char kDownloadBubbleEnabled[];
extern const char kForceEphemeralProfiles[];
extern const char kHomePageIsNewTabPage[];
extern const char kHomePage[];
@@ -198,9 +199,6 @@ extern const char kPromptForDownload[];
extern const char kQuicAllowed[];
extern const char kNetworkQualities[];
extern const char kNetworkEasterEggHighScore[];
-#if BUILDFLAG(IS_ANDROID)
-extern const char kLastPolicyCheckTime[];
-#endif
extern const char kNetworkPredictionOptions[];
extern const char kPreinstalledAppsInstallState[];
extern const char kHideWebStoreIcon[];
@@ -292,6 +290,12 @@ extern const char kHatsArcGamesDeviceIsSelected[];
extern const char kHatsArcGamesSurveyCycleEndTs[];
extern const char kHatsAudioDeviceIsSelected[];
extern const char kHatsAudioSurveyCycleEndTs[];
+extern const char kHatsPersonalizationAvatarSurveyCycleEndTs[];
+extern const char kHatsPersonalizationAvatarSurveyIsSelected[];
+extern const char kHatsPersonalizationScreensaverSurveyCycleEndTs[];
+extern const char kHatsPersonalizationScreensaverSurveyIsSelected[];
+extern const char kHatsPersonalizationWallpaperSurveyCycleEndTs[];
+extern const char kHatsPersonalizationWallpaperSurveyIsSelected[];
extern const char kEolStatus[];
extern const char kEndOfLifeDate[];
extern const char kEolNotificationDismissed[];
@@ -358,6 +362,7 @@ extern const char kRestrictedManagedGuestSessionExtensionCleanupExemptList[];
extern const char kExternalStorageDisabled[];
extern const char kExternalStorageReadOnly[];
extern const char kForceMaximizeOnFirstRun[];
+extern const char kInsightsExtensionEnabled[];
extern const char kSettingsShowOSBanner[];
extern const char kUsedPolicyCertificates[];
#endif // BUILDFLAG(IS_CHROMEOS)
@@ -448,7 +453,11 @@ extern const char kPrinterTypeDenyList[];
extern const char kPrintingAllowedBackgroundGraphicsModes[];
extern const char kPrintingBackgroundGraphicsDefault[];
extern const char kPrintingPaperSizeDefault[];
+
+#if BUILDFLAG(ENABLE_PRINTING)
extern const char kPrintingEnabled[];
+#endif // BUILDFLAG(ENABLE_PRINTING)
+
extern const char kPrintHeaderFooter[];
extern const char kPrintPreviewDisabled[];
extern const char kPrintPreviewDefaultDestinationSelectionRules[];
@@ -565,10 +574,6 @@ extern const char kStabilityOtherUserCrashCount[];
extern const char kStabilityKernelCrashCount[];
extern const char kStabilitySystemUncleanShutdownCount[];
-extern const char kStabilityPluginStats[];
-extern const char kStabilityPluginName[];
-extern const char kStabilityPluginCrashes[];
-
extern const char kBrowserSuppressDefaultBrowserPrompt[];
extern const char kBrowserWindowPlacement[];
@@ -583,6 +588,7 @@ extern const char kDownloadExtensionsToOpen[];
extern const char kDownloadExtensionsToOpenByPolicy[];
extern const char kDownloadAllowedURLsForOpenByPolicy[];
extern const char kDownloadDirUpgraded[];
+extern const char kDownloadLastCompleteTime[];
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_MAC)
extern const char kOpenPdfDownloadInSystemReader[];
@@ -643,6 +649,9 @@ extern const char kNtpCustomBackgroundLocalToDevice[];
extern const char kNtpDisabledModules[];
extern const char kNtpModulesOrder[];
extern const char kNtpModulesVisible[];
+extern const char kNtpModulesShownCount[];
+extern const char kNtpModulesFirstShownTime[];
+extern const char kNtpModulesFreVisible[];
extern const char kNtpPromoBlocklist[];
extern const char kNtpPromoVisible[];
extern const char kNtpSearchSuggestionsBlocklist[];
@@ -905,6 +914,10 @@ extern const char kEnrollmentIdUploadedOnChromad[];
extern const char kLastChromadMigrationAttemptTime[];
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_WIN)
+extern const char kHardwareSecureDecryptionDisabledTimes[];
+#endif // BUILDFLAG(IS_WIN)
+
#if !BUILDFLAG(IS_ANDROID)
extern const char kAttemptedToEnableAutoupdate[];
@@ -1069,7 +1082,6 @@ extern const char kBlockAutoplayEnabled[];
extern const char kSandboxExternalProtocolBlocked[];
#if BUILDFLAG(IS_LINUX)
-extern const char kAllowNativeNotifications[];
extern const char kAllowSystemNotifications[];
#endif
diff --git a/chromium/chrome/common/printing/printer_capabilities.h b/chromium/chrome/common/printing/printer_capabilities.h
index 820965a30db..dd22bb26598 100644
--- a/chromium/chrome/common/printing/printer_capabilities.h
+++ b/chromium/chrome/common/printing/printer_capabilities.h
@@ -6,7 +6,6 @@
#define CHROME_COMMON_PRINTING_PRINTER_CAPABILITIES_H_
#include <string>
-#include <utility>
#include "base/memory/scoped_refptr.h"
#include "base/values.h"
@@ -23,11 +22,6 @@ extern const char kPrinter[];
std::string GetUserFriendlyName(const std::string& printer_name);
#endif
-// Extracts the printer display name and description from the
-// appropriate fields in `printer` for the platform.
-std::pair<std::string, std::string> GetPrinterNameAndDescription(
- const PrinterBasicInfo& printer);
-
// Returns a value containing printer capabilities and settings for the device
// registered as `device_name` in the `PrintBackend`. The returned value is
// suitable for passage to the WebUI in JSON.
diff --git a/chromium/chrome/common/printing/printer_capabilities_unittest.cc b/chromium/chrome/common/printing/printer_capabilities_unittest.cc
index 0f87f70c51a..699eedbda68 100644
--- a/chromium/chrome/common/printing/printer_capabilities_unittest.cc
+++ b/chromium/chrome/common/printing/printer_capabilities_unittest.cc
@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/memory/ref_counted.h"
-#include "base/task/post_task.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
diff --git a/chromium/chrome/common/profiler/thread_profiler.cc b/chromium/chrome/common/profiler/thread_profiler.cc
index d9934fc0dc2..d35b5409a22 100644
--- a/chromium/chrome/common/profiler/thread_profiler.cc
+++ b/chromium/chrome/common/profiler/thread_profiler.cc
@@ -8,6 +8,7 @@
#include <utility>
#include <vector>
+#include "base/android/library_loader/anchor_functions.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
@@ -34,7 +35,6 @@
#include "base/android/apk_assets.h"
#include "base/files/memory_mapped_file.h"
#include "base/profiler/arm_cfi_table.h"
-#include "base/profiler/chrome_unwinder_android.h"
#include "chrome/android/modules/stack_unwinder/public/module.h"
extern "C" {
@@ -42,6 +42,13 @@ extern "C" {
// shared library.
extern char __executable_start;
}
+
+#if BUILDFLAG(USE_ANDROID_UNWINDER_V2)
+#include "base/profiler/chrome_unwinder_android_v2.h"
+#else
+#include "base/profiler/chrome_unwinder_android.h"
+#endif
+
#endif // BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE)
using CallStackProfileBuilder = metrics::CallStackProfileBuilder;
@@ -75,6 +82,34 @@ bool IsCurrentProcessBackgrounded() {
}
#if BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE)
+#if BUILDFLAG(USE_ANDROID_UNWINDER_V2)
+class ChromeUnwinderCreator {
+ public:
+ ChromeUnwinderCreator() {
+ constexpr char kCfiFileName[] = "assets/unwind_cfi_32_v2";
+ base::MemoryMappedFile::Region cfi_region;
+ int fd = base::android::OpenApkAsset(kCfiFileName, &cfi_region);
+ DCHECK_GE(fd, 0);
+ bool mapped_file_ok =
+ chrome_cfi_file_.Initialize(base::File(fd), cfi_region);
+ DCHECK(mapped_file_ok);
+ }
+ ChromeUnwinderCreator(const ChromeUnwinderCreator&) = delete;
+ ChromeUnwinderCreator& operator=(const ChromeUnwinderCreator&) = delete;
+
+ std::unique_ptr<base::Unwinder> Create() {
+ return std::make_unique<base::ChromeUnwinderAndroidV2>(
+ base::CreateChromeUnwindInfoAndroid(
+ {chrome_cfi_file_.data(), chrome_cfi_file_.length()}),
+ /* chrome_module_base_address= */
+ reinterpret_cast<uintptr_t>(&__executable_start),
+ /* text_section_start_address= */ base::android::kStartOfText);
+ }
+
+ private:
+ base::MemoryMappedFile chrome_cfi_file_;
+};
+#else
// Encapsulates the setup required to create the Chrome unwinder on Android.
class ChromeUnwinderCreator {
public:
@@ -105,6 +140,7 @@ class ChromeUnwinderCreator {
base::MemoryMappedFile chrome_cfi_file_;
std::unique_ptr<base::ArmCFITable> chrome_cfi_table_;
};
+#endif
// Encapsulates the setup required to create the Android native unwinder.
class NativeUnwinderCreator {
@@ -162,7 +198,8 @@ const base::RepeatingClosure GetApplyPerSampleMetadataCallback(
CallStackProfileParams::Process process) {
if (process != CallStackProfileParams::Process::kRenderer)
return base::RepeatingClosure();
- static const base::SampleMetadata process_backgrounded("ProcessBackgrounded");
+ static const base::SampleMetadata process_backgrounded(
+ "ProcessBackgrounded", base::SampleMetadataScope::kProcess);
return base::BindRepeating(
[](base::SampleMetadata process_backgrounded) {
process_backgrounded.Set(IsCurrentProcessBackgrounded());
diff --git a/chromium/chrome/common/profiler/thread_profiler_browsertest.cc b/chromium/chrome/common/profiler/thread_profiler_browsertest.cc
index 3c421264669..f213be2b772 100644
--- a/chromium/chrome/common/profiler/thread_profiler_browsertest.cc
+++ b/chromium/chrome/common/profiler/thread_profiler_browsertest.cc
@@ -125,20 +125,6 @@ class ThreadProfilerBrowserTest : public PlatformBrowserTest {
}
};
-bool ShouldSkipTestForMacOS11() {
-#if BUILDFLAG(IS_MAC)
- // Sampling profiler does not work and is disabled on macOS 11.
- // See https://crbug.com/1101399 and https://crbug.com/1098119.
- // DCHECK that that remains the case so these tests are re-enabled when the
- // sampling profiler is re-enabled there.
- if (base::mac::IsAtLeastOS11()) {
- DCHECK(!base::StackSamplingProfiler::IsSupportedForCurrentPlatform());
- return true;
- }
-#endif
- return false;
-}
-
// Wait for a profile with the specified properties.
bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event,
metrics::Process process,
@@ -173,58 +159,42 @@ bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event,
// were dropped as a result of bugs introduced by mojo refactorings.
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, BrowserProcessMainThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::BROWSER_PROCESS, metrics::MAIN_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, BrowserProcessIOThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::BROWSER_PROCESS, metrics::IO_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, GpuProcessMainThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::MAIN_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, GpuProcessIOThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::IO_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, GpuProcessCompositorThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::COMPOSITOR_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, RendererProcessMainThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS, metrics::MAIN_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest, RendererProcessIOThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS, metrics::IO_THREAD));
}
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest,
RendererProcessCompositorThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS,
metrics::COMPOSITOR_THREAD));
@@ -239,8 +209,6 @@ IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest,
#endif
IN_PROC_BROWSER_TEST_F(ThreadProfilerBrowserTest,
MAYBE_NetworkServiceProcessIOThread) {
- if (ShouldSkipTestForMacOS11())
- GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::NETWORK_SERVICE_PROCESS,
metrics::IO_THREAD));
diff --git a/chromium/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc b/chromium/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc
index df7abdfd750..1520e8d370e 100644
--- a/chromium/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc
+++ b/chromium/chrome/common/profiler/thread_profiler_platform_configuration_unittest.cc
@@ -12,12 +12,7 @@
#include "components/version_info/version_info.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if BUILDFLAG(IS_MAC)
-#include "base/mac/mac_util.h"
-#endif
-
-#if (BUILDFLAG(IS_WIN) && defined(ARCH_CPU_X86_64)) || \
- (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_X86_64)) || \
+#if (BUILDFLAG(IS_WIN) && defined(ARCH_CPU_X86_64)) || BUILDFLAG(IS_MAC) || \
(BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE))
#define THREAD_PROFILER_SUPPORTED_ON_PLATFORM true
#else
@@ -83,24 +78,13 @@ TEST_F(ThreadProfilerPlatformConfigurationTest, IsSupported) {
EXPECT_FALSE(config()->IsSupported(absl::nullopt));
#else
-#if BUILDFLAG(IS_MAC)
- // Sampling profiler does not work on macOS 11.0 yet:
- // https://crbug.com/1101399
- const bool on_canary = base::mac::IsAtMostOS10_15();
- const bool on_dev = base::mac::IsAtMostOS10_15();
- const bool on_default = base::mac::IsAtMostOS10_15();
-#else
- const bool on_canary = true;
- const bool on_dev = true;
- const bool on_default = true;
-#endif
EXPECT_FALSE(config()->IsSupported(version_info::Channel::UNKNOWN));
- EXPECT_EQ(on_canary, config()->IsSupported(version_info::Channel::CANARY));
- EXPECT_EQ(on_dev, config()->IsSupported(version_info::Channel::DEV));
+ EXPECT_TRUE(config()->IsSupported(version_info::Channel::CANARY));
+ EXPECT_TRUE(config()->IsSupported(version_info::Channel::DEV));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::BETA));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::STABLE));
- EXPECT_EQ(on_default, config()->IsSupported(absl::nullopt));
+ EXPECT_TRUE(config()->IsSupported(absl::nullopt));
#endif
}
diff --git a/chromium/chrome/common/renderer_configuration.mojom b/chromium/chrome/common/renderer_configuration.mojom
index 9b5a9f31ece..2ce815c2849 100644
--- a/chromium/chrome/common/renderer_configuration.mojom
+++ b/chromium/chrome/common/renderer_configuration.mojom
@@ -37,8 +37,4 @@ interface RendererConfiguration {
// Update renderer configuration with settings that can change.
SetConfiguration(DynamicParams params);
-
- // Set the content setting rules stored by the renderer.
- SetContentSettingRules(
- content_settings.mojom.RendererContentSettingRules rules);
};
diff --git a/chromium/chrome/common/safe_browsing/archive_analyzer_results.cc b/chromium/chrome/common/safe_browsing/archive_analyzer_results.cc
index abd2ae9d04b..e32115ab48e 100644
--- a/chromium/chrome/common/safe_browsing/archive_analyzer_results.cc
+++ b/chromium/chrome/common/safe_browsing/archive_analyzer_results.cc
@@ -7,7 +7,6 @@
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "base/cxx17_backports.h"
#include "base/files/file.h"
#include "base/i18n/streaming_utf8_validator.h"
#include "base/logging.h"
@@ -65,8 +64,8 @@ void SetLengthAndDigestForContainedFile(
}
uint8_t digest[crypto::kSHA256Length];
- hasher->Finish(digest, base::size(digest));
- archived_binary->mutable_digests()->set_sha256(digest, base::size(digest));
+ hasher->Finish(digest, std::size(digest));
+ archived_binary->mutable_digests()->set_sha256(digest, std::size(digest));
}
void AnalyzeContainedBinary(
diff --git a/chromium/chrome/common/safe_browsing/zip_analyzer.cc b/chromium/chrome/common/safe_browsing/zip_analyzer.cc
index 7939a3e0286..708e1ba89aa 100644
--- a/chromium/chrome/common/safe_browsing/zip_analyzer.cc
+++ b/chromium/chrome/common/safe_browsing/zip_analyzer.cc
@@ -61,8 +61,15 @@ void AnalyzeZipFile(base::File zip_file,
}
// Clear the |temp_file| between extractions.
- temp_file.Seek(base::File::Whence::FROM_BEGIN, 0);
- temp_file.SetLength(0);
+ if (temp_file.Seek(base::File::Whence::FROM_BEGIN, 0) != 0)
+ PLOG(WARNING) << "Failed seek";
+
+ // Since this code is expected to run within a utility process, this call
+ // will fail on some platforms. We handle this by passing the length
+ // into `UpdateArchiveAnalyzerResultsWithFile`, which will only consider the
+ // appropriate bytes. See crbug.com/1309879 and crbug.com/774762.
+ if (!temp_file.SetLength(0))
+ PLOG(WARNING) << "Failed truncate";
zip::FileWriterDelegate writer(&temp_file);
reader.ExtractCurrentEntry(&writer, std::numeric_limits<uint64_t>::max());
UpdateArchiveAnalyzerResultsWithFile(entry->path, &temp_file,
diff --git a/chromium/chrome/common/url_constants.cc b/chromium/chrome/common/url_constants.cc
index afd3b4190b9..bc31a719bf7 100644
--- a/chromium/chrome/common/url_constants.cc
+++ b/chromium/chrome/common/url_constants.cc
@@ -11,6 +11,9 @@
namespace chrome {
+const char kAccessCodeCastLearnMoreURL[] =
+ "https://support.google.com/chrome/a/?p=cast_to_class_teacher";
+
const char kAccessibilityLabelsLearnMoreURL[] =
"https://support.google.com/chrome/?p=image_descriptions";
@@ -100,19 +103,6 @@ const char kChromeUIUntrustedNewTabPageUrl[] =
const char kChromiumProjectURL[] = "https://www.chromium.org/";
-const char kCloudPrintCertificateErrorLearnMoreURL[] =
-#if BUILDFLAG(IS_CHROMEOS_ASH)
- "https://support.google.com/chromebook?p=cloudprint_error_troubleshoot";
-#elif BUILDFLAG(IS_MAC)
- "https://support.google.com/cloudprint?p=cloudprint_error_offline_mac";
-#elif BUILDFLAG(IS_WIN)
- "https://support.google.com/"
- "cloudprint?p=cloudprint_error_offline_windows";
-#else
- "https://support.google.com/"
- "cloudprint?p=cloudprint_error_offline_linux";
-#endif
-
const char kContentSettingsExceptionsLearnMoreURL[] =
"https://support.google.com/chrome/?p=settings_manage_exceptions";
@@ -281,7 +271,7 @@ const char kSyncErrorsHelpURL[] =
"https://support.google.com/chrome/?p=settings_sync_error";
const char kSyncGoogleDashboardURL[] =
- "https://www.google.com/settings/chrome/sync/";
+ "https://www.google.com/settings/chrome/sync";
const char kSyncLearnMoreURL[] =
"https://support.google.com/chrome/?p=settings_sign_in";
@@ -406,6 +396,9 @@ const char kLinuxAppsLearnMoreURL[] =
const char kNaturalScrollHelpURL[] =
"https://support.google.com/chromebook/?p=simple_scrolling";
+const char kHapticFeedbackHelpURL[] =
+ "https://support.google.com/chromebook?p=haptic_feedback_m100";
+
const char kOemEulaURLPath[] = "oem";
const char kGoogleEulaOnlineURLPath[] =
@@ -456,7 +449,7 @@ extern const char kFingerprintLearnMoreURL[] =
const char kChromeEnterpriseSignInLearnMoreURL[] =
"https://support.google.com/chromebook/answer/1331549";
-const char kMac10_10_ObsoleteURL[] =
+const char kMacOsObsoleteURL[] =
"https://support.google.com/chrome/?p=unsupported_mac";
#endif
@@ -482,4 +475,10 @@ const char kOutdatedPluginLearnMoreURL[] =
const char kPhoneHubPermissionLearnMoreURL[] =
"https://support.google.com/chromebook/?p=multidevice";
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+ BUILDFLAG(IS_FUCHSIA)
+const char kChromeAppsDeprecationLearnMoreURL[] =
+ "https://support.google.com/chrome/?p=chrome_app_deprecation";
+#endif
+
} // namespace chrome
diff --git a/chromium/chrome/common/url_constants.h b/chromium/chrome/common/url_constants.h
index dc71009e96e..fb4eef105be 100644
--- a/chromium/chrome/common/url_constants.h
+++ b/chromium/chrome/common/url_constants.h
@@ -27,6 +27,9 @@
namespace chrome {
+// "Learn more" URL linked in the dialog to cast using a code.
+extern const char kAccessCodeCastLearnMoreURL[];
+
// "Learn more" URL for accessibility image labels, linked from the permissions
// dialog shown when a user enables the feature.
extern const char kAccessibilityLabelsLearnMoreURL[];
@@ -118,12 +121,6 @@ extern const char kChromeUIUntrustedNewTabPageUrl[];
// The URL for the Chromium project used in the About dialog.
extern const char kChromiumProjectURL[];
-// "Learn more" URL for the Cloud Print section under Options.
-extern const char kCloudPrintLearnMoreURL[];
-
-// "Learn more" URL for the Cloud Print Preview certificate error.
-extern const char kCloudPrintCertificateErrorLearnMoreURL[];
-
extern const char kContentSettingsExceptionsLearnMoreURL[];
// "Learn more" URL for cookies.
@@ -361,6 +358,9 @@ extern const char kLinuxAppsLearnMoreURL[];
// The URL for the "Learn more" link for natural scrolling on ChromeOS.
extern const char kNaturalScrollHelpURL[];
+// The URL for the "Learn more" link for touchpad haptic feedback on Chrome OS.
+extern const char kHapticFeedbackHelpURL[];
+
// The URL path to offline OEM EULA.
extern const char kOemEulaURLPath[];
@@ -419,8 +419,8 @@ extern const char kFingerprintLearnMoreURL[];
// "Learn more" URL for the enterprise sign-in confirmation dialog.
extern const char kChromeEnterpriseSignInLearnMoreURL[];
-// The URL for the "learn more" link on the 10.10 obsolescence infobar.
-extern const char kMac10_10_ObsoleteURL[];
+// The URL for the "learn more" link on the macOS version obsolescence infobar.
+extern const char kMacOsObsoleteURL[];
#endif
#if BUILDFLAG(IS_WIN)
@@ -445,6 +445,13 @@ extern const char kOutdatedPluginLearnMoreURL[];
// "Learn more" URL for the phone hub notifications and apps access setup.
extern const char kPhoneHubPermissionLearnMoreURL[];
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+ BUILDFLAG(IS_FUCHSIA)
+
+// "Learn more" URL for the chrome apps deprecation dialog.
+extern const char kChromeAppsDeprecationLearnMoreURL[];
+#endif
+
// Please do not append entries here. See the comments at the top of the file.
} // namespace chrome
diff --git a/chromium/chrome/common/webui_url_constants.cc b/chromium/chrome/common/webui_url_constants.cc
index a8251ad58b1..9c3f18c0bf2 100644
--- a/chromium/chrome/common/webui_url_constants.cc
+++ b/chromium/chrome/common/webui_url_constants.cc
@@ -4,15 +4,20 @@
#include "chrome/common/webui_url_constants.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "components/history_clusters/core/history_clusters_buildflags.h"
#include "components/nacl/common/buildflags.h"
+#include "components/optimization_guide/optimization_guide_internals/webui/url_constants.h"
#include "components/safe_browsing/core/common/web_ui_constants.h"
#include "extensions/buildflags/buildflags.h"
#include "third_party/blink/public/common/chrome_debug_urls.h"
+#if BUILDFLAG(BUILD_WITH_ON_DEVICE_CLUSTERING_BACKEND)
+#include "components/history_clusters/history_clusters_internals/webui/url_constants.h"
+#endif
+
namespace chrome {
// Please keep this file in the same order as the header.
@@ -26,10 +31,15 @@ const char kChromeUIActivateSafetyCheckSettingsURL[] =
"chrome://settings/safetyCheck?activateSafetyCheck";
const char kChromeUIAccessibilityHost[] = "accessibility";
const char kChromeUIAllSitesPath[] = "/content/all";
+const char kChromeUIAPCInternalsHost[] = "apc-internals";
const char kChromeUIAppIconHost[] = "app-icon";
const char kChromeUIAppIconURL[] = "chrome://app-icon/";
const char kChromeUIAppLauncherPageHost[] = "apps";
const char kChromeUIAppsURL[] = "chrome://apps/";
+const char kChromeUIAppsWithDeprecationDialogURL[] =
+ "chrome://apps?showDeletionDialog";
+const char kChromeUIAppsWithForceInstalledDeprecationDialogURL[] =
+ "chrome://apps?showForceInstallDialog=";
const char kChromeUIAutofillInternalsHost[] = "autofill-internals";
const char kChromeUIBluetoothInternalsHost[] = "bluetooth-internals";
const char kChromeUIBookmarksHost[] = "bookmarks";
@@ -102,6 +112,7 @@ const char kChromeUIHistoryClustersURL[] = "chrome://history/journeys";
const char kChromeUIHistoryHost[] = "history";
const char kChromeUIHistorySyncedTabs[] = "/syncedTabs";
const char kChromeUIHistoryURL[] = "chrome://history/";
+const char kChromeUIHpsInternalsHost[] = "hps-internals";
const char kChromeUIIdentityInternalsHost[] = "identity-internals";
const char kChromeUIImageEditorHost[] = "image-editor";
const char kChromeUIImageEditorURL[] = "chrome://image-editor/";
@@ -137,6 +148,7 @@ const char kChromeUINewTabPageThirdPartyHost[] = "new-tab-page-third-party";
const char kChromeUINewTabPageThirdPartyURL[] =
"chrome://new-tab-page-third-party/";
const char kChromeUINewTabURL[] = "chrome://newtab/";
+const char kChromeUIProfileInternalsHost[] = "profile-internals";
const char kChromeUIOmniboxHost[] = "omnibox";
const char kChromeUIOmniboxURL[] = "chrome://omnibox/";
#if BUILDFLAG(IS_CHROMEOS)
@@ -237,13 +249,14 @@ const char kChromeUIBookmarksSidePanelHost[] =
"bookmarks-side-panel.top-chrome";
const char kChromeUIBookmarksSidePanelURL[] =
"chrome://bookmarks-side-panel.top-chrome/";
-const char kChromeUIReaderModeSidePanelHost[] =
- "reader-mode-side-panel.top-chrome";
-const char kChromeUIReaderModeSidePanelURL[] =
- "chrome://reader-mode-side-panel.top-chrome/";
+const char kChromeUIReadAnythingSidePanelHost[] =
+ "read-anything-side-panel.top-chrome";
+const char kChromeUIReadAnythingSidePanelURL[] =
+ "chrome://read-anything-side-panel.top-chrome/";
const char kChromeUIReadLaterHost[] = "read-later.top-chrome";
const char kChromeUIReadLaterURL[] = "chrome://read-later.top-chrome/";
const char kChromeUIWebAppInternalsHost[] = "web-app-internals";
+const char kChromeUIWebUITestHost[] = "webui-test";
#endif
#if BUILDFLAG(PLATFORM_CFM)
@@ -302,6 +315,8 @@ const char kChromeUIIntenetDetailDialogURL[] =
"chrome://internet-detail-dialog/";
const char kChromeUIInternetConfigDialogHost[] = "internet-config-dialog";
const char kChromeUIInternetDetailDialogHost[] = "internet-detail-dialog";
+const char kChromeUIBorealisCreditsHost[] = "borealis-credits";
+const char kChromeUIBorealisCreditsURL[] = "chrome://borealis-credits/";
const char kChromeUICrostiniCreditsHost[] = "crostini-credits";
const char kChromeUICrostiniCreditsURL[] = "chrome://crostini-credits/";
const char kChromeUILockScreenNetworkHost[] = "lock-network";
@@ -361,22 +376,24 @@ const char kOsUIAccountManagerWelcomeURL[] = "os://account-manager-welcome";
const char kOsUIAccountMigrationWelcomeURL[] = "os://account-migration-welcome";
const char kOsUIAddSupervisionURL[] = "os://add-supervision";
const char kOsUIAppDisabledURL[] = "os://app-disabled";
-const char kOsUICrashesUrl[] = "os://crashes";
+const char kOsUICrashesURL[] = "os://crashes";
const char kOsUICreditsURL[] = "os://credits";
-const char kOsUIDeviceLogUrl[] = "os://device-log";
-const char kOsUIDriveInternalsUrl[] = "os://drive-internals";
+const char kOsUIDeviceLogURL[] = "os://device-log";
+const char kOsUIDriveInternalsURL[] = "os://drive-internals";
const char kOsUIEmojiPickerURL[] = "os://emoji-picker";
const char kOsUIGpuURL[] = "os://gpu";
const char kOsUIHistogramsURL[] = "os://histograms";
-const char kOsUIInvalidationsUrl[] = "os://invalidations";
+const char kOsUIInvalidationsURL[] = "os://invalidations";
const char kOsUILockScreenNetworkURL[] = "os://lock-network";
-const char kOsUINetworkUrl[] = "os://network";
+const char kOsUINetworkURL[] = "os://network";
const char kOsUIRestartURL[] = "os://restart";
const char kOsUIScanningAppURL[] = "os://scanning";
const char kOsUISettingsURL[] = "os://settings";
-const char kOsUISignInInternalsUrl[] = "os://signin-internals";
-const char kOsUISyncInternalsUrl[] = "os://sync-internals";
-const char kOsUITerms[] = "os://terms";
+const char kOsUISignInInternalsURL[] = "os://signin-internals";
+const char kOsUISyncInternalsURL[] = "os://sync-internals";
+const char kOsUISysInternalsUrl[] = "os://sys-internals";
+const char kOsUISystemURL[] = "os://system";
+const char kOsUITermsURL[] = "os://terms";
// Keep alphabetized.
@@ -391,6 +408,7 @@ bool IsSystemWebUIHost(base::StringPiece host) {
kChromeUIAddSupervisionHost,
kChromeUIAssistantOptInHost,
kChromeUIBluetoothPairingHost,
+ kChromeUIBorealisCreditsHost,
kChromeUICertificateManagerHost,
kChromeUICrostiniCreditsHost,
kChromeUICrostiniInstallerHost,
@@ -429,8 +447,9 @@ const char kChromeUIAppDisabledHost[] = "app-disabled";
const char kChromeUIOSSettingsHost[] = "os-settings";
const char kChromeUIOSSettingsURL[] = "chrome://os-settings/";
const char kOsUIAboutURL[] = "os://about";
-const char kOsUIComponentsUrl[] = "os://components";
+const char kOsUIComponentsURL[] = "os://components";
const char kOsUIFlagsURL[] = "os://flags";
+const char kOsUIHelpAppURL[] = "os://help-app";
const char kOsUIVersionURL[] = "os://version";
#endif
@@ -440,7 +459,7 @@ const char kChromeUIWebUIJsErrorURL[] = "chrome://webuijserror/";
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
- BUILDFLAG(IS_CHROMEOS)
+ BUILDFLAG(IS_CHROMEOS_ASH)
const char kChromeUIConnectorsInternalsHost[] = "connectors-internals";
#endif
@@ -519,7 +538,6 @@ const char kAddressesSubPage[] = "addresses";
const char kAppearanceSubPage[] = "appearance";
const char kAutofillSubPage[] = "autofill";
const char kClearBrowserDataSubPage[] = "clearBrowserData";
-const char kCloudPrintersSubPage[] = "cloudPrinters";
const char kContentSettingsSubPage[] = "content";
const char kCookieSettingsSubPage[] = "cookies";
const char kDownloadsSubPage[] = "downloads";
@@ -547,6 +565,8 @@ const char kTriggeredResetProfileSettingsSubPage[] =
const char kCreateProfileSubPage[] = "createProfile";
const char kManageProfileSubPage[] = "manageProfile";
const char kPeopleSubPage[] = "people";
+const char kPrivacySandboxAdPersonalizationSubPage[] =
+ "privacySandbox?view=adPersonalizationDialog";
const char kPrivacySandboxSubPage[] = "privacySandbox";
#if !BUILDFLAG(IS_ANDROID)
@@ -595,6 +615,12 @@ const char* const kChromeHostURLs[] = {
kChromeUIFlagsHost,
kChromeUIGCMInternalsHost,
kChromeUIHistoryHost,
+#if BUILDFLAG(BUILD_WITH_ON_DEVICE_CLUSTERING_BACKEND)
+ history_clusters_internals::kChromeUIHistoryClustersInternalsHost,
+#endif
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ kChromeUIHpsInternalsHost,
+#endif
kChromeUIInterstitialHost,
kChromeUIInvalidationsHost,
kChromeUILocalStateHost,
@@ -606,10 +632,12 @@ const char* const kChromeHostURLs[] = {
kChromeUINetInternalsHost,
kChromeUINewTabHost,
kChromeUIOmniboxHost,
+ optimization_guide_internals::kChromeUIOptimizationGuideInternalsHost,
kChromeUIPasswordManagerInternalsHost,
kChromeUIPolicyHost,
kChromeUIPredictorsHost,
kChromeUIPrefsInternalsHost,
+ kChromeUIProfileInternalsHost,
kChromeUIQuotaInternalsHost,
kChromeUISignInInternalsHost,
kChromeUISiteEngagementHost,
@@ -662,6 +690,7 @@ const char* const kChromeHostURLs[] = {
kChromeUIWebApksHost,
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
+ kChromeUIBorealisCreditsHost,
kChromeUICertificateManagerHost,
kChromeUICrostiniCreditsHost,
kChromeUICryptohomeHost,
@@ -678,7 +707,7 @@ const char* const kChromeHostURLs[] = {
kChromeUIAssistantOptInHost,
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
- BUILDFLAG(IS_CHROMEOS)
+ BUILDFLAG(IS_CHROMEOS_ASH)
kChromeUIConnectorsInternalsHost,
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
@@ -703,6 +732,7 @@ const char* const kChromeHostURLs[] = {
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
kChromeUIExtensionsHost,
+ kChromeUIExtensionsInternalsHost,
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
kChromeUIPrintHost,
@@ -712,7 +742,7 @@ const char* const kChromeHostURLs[] = {
kCfmNetworkSettingsHost,
#endif // BUILDFLAG(PLATFORM_CFM)
};
-const size_t kNumberOfChromeHostURLs = base::size(kChromeHostURLs);
+const size_t kNumberOfChromeHostURLs = std::size(kChromeHostURLs);
// Add chrome://internals/* subpages here to be included in chrome://chrome-urls
// (about:about).
@@ -725,7 +755,7 @@ const char* const kChromeInternalsPathURLs[] = {
#endif
};
const size_t kNumberOfChromeInternalsPathURLs =
- base::size(kChromeInternalsPathURLs);
+ std::size(kChromeInternalsPathURLs);
const char* const kChromeDebugURLs[] = {
blink::kChromeUIBadCastCrashURL,
@@ -754,6 +784,6 @@ const char* const kChromeDebugURLs[] = {
#endif
kChromeUIQuitURL,
kChromeUIRestartURL};
-const size_t kNumberOfChromeDebugURLs = base::size(kChromeDebugURLs);
+const size_t kNumberOfChromeDebugURLs = std::size(kChromeDebugURLs);
} // namespace chrome
diff --git a/chromium/chrome/common/webui_url_constants.h b/chromium/chrome/common/webui_url_constants.h
index 2c9bc827183..e1aea1340b7 100644
--- a/chromium/chrome/common/webui_url_constants.h
+++ b/chromium/chrome/common/webui_url_constants.h
@@ -32,10 +32,13 @@ extern const char kChromeUIAboutURL[];
extern const char kChromeUIActivateSafetyCheckSettingsURL[];
extern const char kChromeUIAccessibilityHost[];
extern const char kChromeUIAllSitesPath[];
+extern const char kChromeUIAPCInternalsHost[];
extern const char kChromeUIAppIconHost[];
extern const char kChromeUIAppIconURL[];
extern const char kChromeUIAppLauncherPageHost[];
extern const char kChromeUIAppsURL[];
+extern const char kChromeUIAppsWithDeprecationDialogURL[];
+extern const char kChromeUIAppsWithForceInstalledDeprecationDialogURL[];
extern const char kChromeUIAutofillInternalsHost[];
extern const char kChromeUIBluetoothInternalsHost[];
extern const char kChromeUIBookmarksHost[];
@@ -103,6 +106,7 @@ extern const char kChromeUIHistoryClustersURL[];
extern const char kChromeUIHistoryHost[];
extern const char kChromeUIHistorySyncedTabs[];
extern const char kChromeUIHistoryURL[];
+extern const char kChromeUIHpsInternalsHost[];
extern const char kChromeUIIdentityInternalsHost[];
extern const char kChromeUIImageEditorHost[];
extern const char kChromeUIImageEditorURL[];
@@ -153,6 +157,7 @@ extern const char kChromeUIPrefsInternalsHost[];
extern const char kChromeUIPrintURL[];
extern const char kChromeUIPrivacySandboxDialogHost[];
extern const char kChromeUIPrivacySandboxDialogURL[];
+extern const char kChromeUIProfileInternalsHost[];
extern const char kChromeUIQuitHost[];
extern const char kChromeUIQuitURL[];
extern const char kChromeUIResetPasswordHost[];
@@ -227,11 +232,12 @@ extern const char kChromeUIAppServiceInternalsHost[];
extern const char kChromeUINearbyInternalsHost[];
extern const char kChromeUIBookmarksSidePanelHost[];
extern const char kChromeUIBookmarksSidePanelURL[];
-extern const char kChromeUIReaderModeSidePanelHost[];
-extern const char kChromeUIReaderModeSidePanelURL[];
+extern const char kChromeUIReadAnythingSidePanelHost[];
+extern const char kChromeUIReadAnythingSidePanelURL[];
extern const char kChromeUIReadLaterHost[];
extern const char kChromeUIReadLaterURL[];
extern const char kChromeUIWebAppInternalsHost[];
+extern const char kChromeUIWebUITestHost[];
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
@@ -283,6 +289,8 @@ extern const char kChromeUIIntenetConfigDialogURL[];
extern const char kChromeUIIntenetDetailDialogURL[];
extern const char kChromeUIInternetConfigDialogHost[];
extern const char kChromeUIInternetDetailDialogHost[];
+extern const char kChromeUIBorealisCreditsHost[];
+extern const char kChromeUIBorealisCreditsURL[];
extern const char kChromeUICrostiniCreditsHost[];
extern const char kChromeUICrostiniCreditsURL[];
extern const char kChromeUILockScreenNetworkHost[];
@@ -337,22 +345,24 @@ extern const char kOsUIAccountManagerWelcomeURL[];
extern const char kOsUIAccountMigrationWelcomeURL[];
extern const char kOsUIAddSupervisionURL[];
extern const char kOsUIAppDisabledURL[];
-extern const char kOsUICrashesUrl[];
+extern const char kOsUICrashesURL[];
extern const char kOsUICreditsURL[];
-extern const char kOsUIDeviceLogUrl[];
-extern const char kOsUIDriveInternalsUrl[];
+extern const char kOsUIDeviceLogURL[];
+extern const char kOsUIDriveInternalsURL[];
extern const char kOsUIEmojiPickerURL[];
extern const char kOsUIGpuURL[];
extern const char kOsUIHistogramsURL[];
-extern const char kOsUIInvalidationsUrl[];
+extern const char kOsUIInvalidationsURL[];
extern const char kOsUILockScreenNetworkURL[];
-extern const char kOsUINetworkUrl[];
+extern const char kOsUINetworkURL[];
extern const char kOsUIRestartURL[];
extern const char kOsUIScanningAppURL[];
extern const char kOsUISettingsURL[];
-extern const char kOsUISignInInternalsUrl[];
-extern const char kOsUISyncInternalsUrl[];
-extern const char kOsUITerms[];
+extern const char kOsUISignInInternalsURL[];
+extern const char kOsUISyncInternalsURL[];
+extern const char kOsUISysInternalsUrl[];
+extern const char kOsUISystemURL[];
+extern const char kOsUITermsURL[];
// Returns true if this web UI is part of the "system UI". Generally this is
// UI that opens in a window (not a browser tab) and that on other operating
@@ -366,8 +376,9 @@ extern const char kChromeUIAppDisabledHost[];
extern const char kChromeUIOSSettingsHost[];
extern const char kChromeUIOSSettingsURL[];
extern const char kOsUIAboutURL[];
-extern const char kOsUIComponentsUrl[];
+extern const char kOsUIComponentsURL[];
extern const char kOsUIFlagsURL[];
+extern const char kOsUIHelpAppURL[];
extern const char kOsUIVersionURL[];
#endif
@@ -377,7 +388,7 @@ extern const char kChromeUIWebUIJsErrorURL[];
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
- BUILDFLAG(IS_CHROMEOS)
+ BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kChromeUIConnectorsInternalsHost[];
#endif
@@ -459,7 +470,6 @@ extern const char kAddressesSubPage[];
extern const char kAppearanceSubPage[];
extern const char kAutofillSubPage[];
extern const char kClearBrowserDataSubPage[];
-extern const char kCloudPrintersSubPage[];
extern const char kContentSettingsSubPage[];
extern const char kCookieSettingsSubPage[];
extern const char kCreateProfileSubPage[];
@@ -486,6 +496,7 @@ extern const char kSearchEnginesSubPage[];
extern const char kSignOutSubPage[];
extern const char kSyncSetupSubPage[];
extern const char kTriggeredResetProfileSettingsSubPage[];
+extern const char kPrivacySandboxAdPersonalizationSubPage[];
extern const char kPrivacySandboxSubPage[];
#if !BUILDFLAG(IS_ANDROID)