mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove custom chrome scheme handling (see #3685)
- Add CEF info to existing chrome://version WebUI. - Move chrome://license handling to WebUI. - Remove chrome://webui-hosts; use chrome://chrome-urls instead. - Remove chrome://extension-support; navigate to docs directly instead.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
diff --git content/public/browser/web_ui_controller_factory.h content/public/browser/web_ui_controller_factory.h
|
||||
index 9d9c17ffd6474..4eb79c65369af 100644
|
||||
--- content/public/browser/web_ui_controller_factory.h
|
||||
+++ content/public/browser/web_ui_controller_factory.h
|
||||
@@ -47,9 +47,6 @@ class CONTENT_EXPORT WebUIControllerFactory {
|
||||
virtual bool UseWebUIForURL(BrowserContext* browser_context,
|
||||
const GURL& url) = 0;
|
||||
|
||||
- private:
|
||||
- friend class ScopedWebUIControllerFactoryRegistration;
|
||||
-
|
||||
static void UnregisterFactoryForTesting(WebUIControllerFactory* factory);
|
||||
};
|
||||
|
||||
diff --git content/public/browser/webui_config_map.h content/public/browser/webui_config_map.h
|
||||
index e7b6a9b841abb..1c98be86c0db1 100644
|
||||
--- content/public/browser/webui_config_map.h
|
||||
+++ content/public/browser/webui_config_map.h
|
||||
@@ -68,6 +68,10 @@ class CONTENT_EXPORT WebUIConfigMap {
|
||||
std::vector<WebUIConfigInfo> GetWebUIConfigList(
|
||||
BrowserContext* browser_context);
|
||||
|
||||
+ WebUIControllerFactory* controller_factory() const {
|
||||
+ return webui_controller_factory_.get();
|
||||
+ }
|
||||
+
|
||||
private:
|
||||
void AddWebUIConfigImpl(std::unique_ptr<WebUIConfig> config);
|
||||
|
@@ -74,7 +74,7 @@ index 02ff1e580d3a7..7f51115896049 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index 74460ac479210..8cf70c80a87ad 100644
|
||||
index 74460ac479210..c484be466eefb 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni")
|
||||
@@ -104,7 +104,18 @@ index 74460ac479210..8cf70c80a87ad 100644
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
@@ -3040,6 +3046,8 @@ static_library("ui") {
|
||||
@@ -759,6 +765,10 @@ static_library("ui") {
|
||||
deps += [ "//components/plus_addresses/resources:vector_icons" ]
|
||||
}
|
||||
|
||||
+ if (enable_cef) {
|
||||
+ deps += [ "//cef:cef_resources" ]
|
||||
+ }
|
||||
+
|
||||
# TODO(crbug.com/41437292): Remove this circular dependency.
|
||||
allow_circular_includes_from = [
|
||||
# TODO(crbug.com/40161499): Remove this circular dependency.
|
||||
@@ -3040,6 +3050,8 @@ static_library("ui") {
|
||||
"views/apps/app_dialog/app_local_block_dialog_view.h",
|
||||
"views/apps/app_dialog/app_pause_dialog_view.cc",
|
||||
"views/apps/app_dialog/app_pause_dialog_view.h",
|
||||
@@ -113,7 +124,7 @@ index 74460ac479210..8cf70c80a87ad 100644
|
||||
"views/apps/app_info_dialog/arc_app_info_links_panel.cc",
|
||||
"views/apps/app_info_dialog/arc_app_info_links_panel.h",
|
||||
"views/apps/chrome_app_window_client_views_chromeos.cc",
|
||||
@@ -4249,8 +4257,6 @@ static_library("ui") {
|
||||
@@ -4249,8 +4261,6 @@ static_library("ui") {
|
||||
"autofill/payments/webauthn_dialog_model.h",
|
||||
"autofill/payments/webauthn_dialog_model_observer.h",
|
||||
"autofill/payments/webauthn_dialog_state.h",
|
||||
@@ -122,7 +133,7 @@ index 74460ac479210..8cf70c80a87ad 100644
|
||||
"incognito_clear_browsing_data_dialog_interface.h",
|
||||
"signin/signin_modal_dialog.cc",
|
||||
"signin/signin_modal_dialog.h",
|
||||
@@ -5125,8 +5131,6 @@ static_library("ui") {
|
||||
@@ -5125,8 +5135,6 @@ static_library("ui") {
|
||||
"views/accessibility/theme_tracking_non_accessible_image_view.h",
|
||||
"views/apps/app_dialog/app_dialog_view.cc",
|
||||
"views/apps/app_dialog/app_dialog_view.h",
|
||||
@@ -131,7 +142,7 @@ index 74460ac479210..8cf70c80a87ad 100644
|
||||
"views/apps/app_info_dialog/app_info_dialog_container.cc",
|
||||
"views/apps/app_info_dialog/app_info_dialog_container.h",
|
||||
"views/apps/app_info_dialog/app_info_dialog_views.cc",
|
||||
@@ -6908,6 +6912,7 @@ static_library("ui") {
|
||||
@@ -6908,6 +6916,7 @@ static_library("ui") {
|
||||
if (enable_printing) {
|
||||
deps += [
|
||||
"//components/printing/browser",
|
||||
|
120
patch/patches/chrome_browser_webui_license.patch
Normal file
120
patch/patches/chrome_browser_webui_license.patch
Normal file
@@ -0,0 +1,120 @@
|
||||
diff --git chrome/browser/ui/webui/about/about_ui.cc chrome/browser/ui/webui/about/about_ui.cc
|
||||
index 7d04b86885167..b89b060efc9e0 100644
|
||||
--- chrome/browser/ui/webui/about/about_ui.cc
|
||||
+++ chrome/browser/ui/webui/about/about_ui.cc
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/about_flags.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@@ -91,6 +92,10 @@
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/grit/cef_resources.h"
|
||||
+#endif
|
||||
+
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace {
|
||||
@@ -692,6 +697,16 @@ void AboutUIHTMLSource::StartDataRequest(
|
||||
IDS_TERMS_HTML);
|
||||
#endif
|
||||
}
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ else if (source_name_ == chrome::kChromeUILicenseHost) {
|
||||
+ response =
|
||||
+ "<html><head><title>CEF License</title></head>"
|
||||
+ "<body bgcolor=\"white\"><pre>" +
|
||||
+ ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
|
||||
+ IDR_CEF_LICENSE_TXT) +
|
||||
+ "</pre></body></html>";
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
FinishDataRequest(response, std::move(callback));
|
||||
}
|
||||
diff --git chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
||||
index 7b61f43d8c72a..811d075966239 100644
|
||||
--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
||||
+++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/about_flags.h"
|
||||
#include "chrome/browser/buildflags.h"
|
||||
#include "chrome/browser/commerce/shopping_service_factory.h"
|
||||
@@ -391,6 +392,9 @@ bool IsAboutUI(const GURL& url) {
|
||||
|| url.host_piece() == chrome::kChromeUIOSCreditsHost ||
|
||||
url.host_piece() == chrome::kChromeUIBorealisCreditsHost ||
|
||||
url.host_piece() == chrome::kChromeUICrostiniCreditsHost
|
||||
+#endif
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ || url.host_piece() == chrome::kChromeUILicenseHost
|
||||
#endif
|
||||
); // NOLINT
|
||||
}
|
||||
@@ -1019,6 +1023,9 @@ ChromeWebUIControllerFactory::GetListOfAcceptableURLs() {
|
||||
GURL(chrome::kChromeUIGpuURL),
|
||||
GURL(chrome::kChromeUIHistogramsURL),
|
||||
GURL(chrome::kChromeUIInspectURL),
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ GURL(chrome::kChromeUILicenseURL),
|
||||
+#endif
|
||||
GURL(chrome::kChromeUIManagementURL),
|
||||
GURL(chrome::kChromeUINetExportURL),
|
||||
GURL(chrome::kChromeUIPrefsInternalsURL),
|
||||
diff --git chrome/common/webui_url_constants.cc chrome/common/webui_url_constants.cc
|
||||
index 4604facee295e..acd8857875d6e 100644
|
||||
--- chrome/common/webui_url_constants.cc
|
||||
+++ chrome/common/webui_url_constants.cc
|
||||
@@ -131,6 +131,10 @@ const char kChromeUILauncherInternalsHost[] = "launcher-internals";
|
||||
const char kChromeUILauncherInternalsURL[] = "chrome://launcher-internals";
|
||||
const char kChromeUILensSearchBubbleHost[] = "lens-search-bubble";
|
||||
const char kChromeUILensSearchBubbleURL[] = "chrome://lens-search-bubble/";
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+const char kChromeUILicenseHost[] = "license";
|
||||
+const char kChromeUILicenseURL[] = "chrome://license/";
|
||||
+#endif
|
||||
const char kChromeUISensorInfoHost[] = "sensor-info";
|
||||
const char kChromeUISensorInfoURL[] = "chrome://sensor-info/";
|
||||
const char kChromeUILocalStateHost[] = "local-state";
|
||||
@@ -704,6 +708,9 @@ const char* const kChromeHostURLs[] = {
|
||||
kChromeUIHumanPresenceInternalsHost,
|
||||
#endif
|
||||
kChromeUIInterstitialHost,
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ kChromeUILicenseHost,
|
||||
+#endif
|
||||
kChromeUILocalStateHost,
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
kChromeUIManagementHost,
|
||||
diff --git chrome/common/webui_url_constants.h chrome/common/webui_url_constants.h
|
||||
index b1247ef8ad3ff..a4ebfe2d585a0 100644
|
||||
--- chrome/common/webui_url_constants.h
|
||||
+++ chrome/common/webui_url_constants.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/common/buildflags.h"
|
||||
#include "components/lens/buildflags.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
@@ -123,6 +124,10 @@ extern const char kChromeUILauncherInternalsHost[];
|
||||
extern const char kChromeUILauncherInternalsURL[];
|
||||
extern const char kChromeUILensSearchBubbleHost[];
|
||||
extern const char kChromeUILensSearchBubbleURL[];
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+extern const char kChromeUILicenseHost[];
|
||||
+extern const char kChromeUILicenseURL[];
|
||||
+#endif
|
||||
extern const char kChromeUISensorInfoURL[];
|
||||
extern const char kChromeUISensorInfoHost[];
|
||||
extern const char kChromeUILocalStateHost[];
|
381
patch/patches/chrome_browser_webui_version.patch
Normal file
381
patch/patches/chrome_browser_webui_version.patch
Normal file
@@ -0,0 +1,381 @@
|
||||
diff --git chrome/browser/ui/webui/version/version_handler.cc chrome/browser/ui/webui/version/version_handler.cc
|
||||
index 55541159e5fc8..8021d1d963f59 100644
|
||||
--- chrome/browser/ui/webui/version/version_handler.cc
|
||||
+++ chrome/browser/ui/webui/version/version_handler.cc
|
||||
@@ -27,12 +27,23 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "base/base_paths.h"
|
||||
+#include "base/path_service.h"
|
||||
+#include "chrome/common/chrome_paths.h"
|
||||
+#endif
|
||||
+
|
||||
namespace {
|
||||
|
||||
// Retrieves the executable and profile paths on the FILE thread.
|
||||
void GetFilePaths(const base::FilePath& profile_path,
|
||||
std::u16string* exec_path_out,
|
||||
- std::u16string* profile_path_out) {
|
||||
+ std::u16string* profile_path_out
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ , std::u16string* module_path_out,
|
||||
+ std::u16string* user_data_path_out
|
||||
+#endif
|
||||
+ ) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
base::BlockingType::MAY_BLOCK);
|
||||
|
||||
@@ -48,6 +59,19 @@ void GetFilePaths(const base::FilePath& profile_path,
|
||||
*profile_path_out = profile_path.LossyDisplayName();
|
||||
else
|
||||
*profile_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND);
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ base::FilePath module_path;
|
||||
+ if (base::PathService::Get(base::FILE_MODULE, &module_path)) {
|
||||
+ *module_path_out = module_path.LossyDisplayName();
|
||||
+ } else {
|
||||
+ *module_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND);
|
||||
+ }
|
||||
+
|
||||
+ base::FilePath user_data_dir =
|
||||
+ base::PathService::CheckedGet(chrome::DIR_USER_DATA);
|
||||
+ *user_data_path_out = user_data_dir.LossyDisplayName();
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -111,23 +135,46 @@ void VersionHandler::HandleRequestPathInfo(const base::Value::List& args) {
|
||||
// OnGotFilePaths.
|
||||
std::u16string* exec_path_buffer = new std::u16string;
|
||||
std::u16string* profile_path_buffer = new std::u16string;
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ std::u16string* module_path_buffer = new std::u16string;
|
||||
+ std::u16string* user_data_path_buffer = new std::u16string;
|
||||
+#endif
|
||||
base::ThreadPool::PostTaskAndReply(
|
||||
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
|
||||
base::BindOnce(&GetFilePaths, Profile::FromWebUI(web_ui())->GetPath(),
|
||||
base::Unretained(exec_path_buffer),
|
||||
- base::Unretained(profile_path_buffer)),
|
||||
+ base::Unretained(profile_path_buffer)
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ , base::Unretained(module_path_buffer),
|
||||
+ base::Unretained(user_data_path_buffer)
|
||||
+#endif
|
||||
+ ),
|
||||
base::BindOnce(&VersionHandler::OnGotFilePaths,
|
||||
weak_ptr_factory_.GetWeakPtr(), callback_id,
|
||||
base::Owned(exec_path_buffer),
|
||||
- base::Owned(profile_path_buffer)));
|
||||
+ base::Owned(profile_path_buffer)
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ , base::Owned(module_path_buffer),
|
||||
+ base::Owned(user_data_path_buffer)
|
||||
+#endif
|
||||
+ ));
|
||||
}
|
||||
|
||||
void VersionHandler::OnGotFilePaths(std::string callback_id,
|
||||
std::u16string* executable_path_data,
|
||||
- std::u16string* profile_path_data) {
|
||||
+ std::u16string* profile_path_data
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ , std::u16string* module_path_data,
|
||||
+ std::u16string* user_data_path_data
|
||||
+#endif
|
||||
+ ) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
base::Value::Dict response;
|
||||
response.Set(version_ui::kKeyExecPath, *executable_path_data);
|
||||
response.Set(version_ui::kKeyProfilePath, *profile_path_data);
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ response.Set(version_ui::kKeyModulePath, *module_path_data);
|
||||
+ response.Set(version_ui::kKeyUserDataPath, *user_data_path_data);
|
||||
+#endif
|
||||
ResolveJavascriptCallback(base::Value(callback_id), response);
|
||||
}
|
||||
diff --git chrome/browser/ui/webui/version/version_handler.h chrome/browser/ui/webui/version/version_handler.h
|
||||
index 2f8162d7491d1..b00f0d5bf26ae 100644
|
||||
--- chrome/browser/ui/webui/version/version_handler.h
|
||||
+++ chrome/browser/ui/webui/version/version_handler.h
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/values.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "content/public/browser/web_ui_message_handler.h"
|
||||
|
||||
// Handler class for Version page operations.
|
||||
@@ -44,7 +45,12 @@ class VersionHandler : public content::WebUIMessageHandler {
|
||||
// front end.
|
||||
void OnGotFilePaths(std::string callback_id,
|
||||
std::u16string* executable_path_data,
|
||||
- std::u16string* profile_path_data);
|
||||
+ std::u16string* profile_path_data
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ , std::u16string* module_path_data,
|
||||
+ std::u16string* user_data_path_data
|
||||
+#endif
|
||||
+ );
|
||||
|
||||
// Factory for the creating refs in callbacks.
|
||||
base::WeakPtrFactory<VersionHandler> weak_ptr_factory_{this};
|
||||
diff --git chrome/browser/ui/webui/version/version_ui.cc chrome/browser/ui/webui/version/version_ui.cc
|
||||
index 6e205bf700de2..c281769b5cb5c 100644
|
||||
--- chrome/browser/ui/webui/version/version_ui.cc
|
||||
+++ chrome/browser/ui/webui/version/version_ui.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "base/time/time.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/browser_process_impl.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/webui/version/version_handler.h"
|
||||
@@ -64,6 +65,10 @@
|
||||
#include "chrome/browser/ui/webui/version/version_util_win.h"
|
||||
#endif
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/include/cef_version.h"
|
||||
+#endif
|
||||
+
|
||||
using content::WebUIDataSource;
|
||||
|
||||
namespace {
|
||||
@@ -84,6 +89,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) {
|
||||
{version_ui::kCommandLineName, IDS_VERSION_UI_COMMAND_LINE},
|
||||
{version_ui::kExecutablePathName, IDS_VERSION_UI_EXECUTABLE_PATH},
|
||||
{version_ui::kProfilePathName, IDS_VERSION_UI_PROFILE_PATH},
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ {version_ui::kModulePathName, IDS_VERSION_UI_MODULE_PATH},
|
||||
+ {version_ui::kUserDataPathName, IDS_VERSION_UI_USER_DATA_PATH},
|
||||
+#endif
|
||||
{version_ui::kVariationsName, IDS_VERSION_UI_VARIATIONS},
|
||||
{version_ui::kVariationsCmdName, IDS_VERSION_UI_VARIATIONS_CMD},
|
||||
{version_ui::kVariationsSeedName, IDS_VERSION_UI_VARIATIONS_SEED_NAME},
|
||||
@@ -121,6 +130,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) {
|
||||
IDR_PRODUCT_LOGO_WHITE);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
html_source->SetDefaultResource(IDR_VERSION_UI_ABOUT_VERSION_HTML);
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ html_source->AddString(version_ui::kCefVersion, CEF_VERSION);
|
||||
+#endif
|
||||
}
|
||||
|
||||
std::string GetProductModifier() {
|
||||
@@ -241,6 +254,10 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) {
|
||||
// blank.
|
||||
html_source->AddString(version_ui::kExecutablePath, std::string());
|
||||
html_source->AddString(version_ui::kProfilePath, std::string());
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ html_source->AddString(version_ui::kModulePath, std::string());
|
||||
+ html_source->AddString(version_ui::kUserDataPath, std::string());
|
||||
+#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
html_source->AddString(version_ui::kOSType, base::mac::GetOSDisplayName());
|
||||
diff --git components/version_ui/BUILD.gn components/version_ui/BUILD.gn
|
||||
index 913cf913dca7a..d79c330989149 100644
|
||||
--- components/version_ui/BUILD.gn
|
||||
+++ components/version_ui/BUILD.gn
|
||||
@@ -2,6 +2,8 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
+import("//cef/libcef/features/features.gni")
|
||||
+
|
||||
static_library("version_ui") {
|
||||
sources = [
|
||||
"version_handler_helper.cc",
|
||||
@@ -17,4 +19,8 @@ static_library("version_ui") {
|
||||
"//components/variations/net",
|
||||
"//components/variations/service",
|
||||
]
|
||||
+
|
||||
+ if (enable_cef) {
|
||||
+ configs += [ "//cef/libcef/features:config" ]
|
||||
+ }
|
||||
}
|
||||
diff --git components/version_ui/resources/about_version.css components/version_ui/resources/about_version.css
|
||||
index 6b753d716b55d..58d6419be0165 100644
|
||||
--- components/version_ui/resources/about_version.css
|
||||
+++ components/version_ui/resources/about_version.css
|
||||
@@ -135,3 +135,7 @@ body {
|
||||
position: fixed;
|
||||
width: 1px;
|
||||
}
|
||||
+
|
||||
+#footnote {
|
||||
+ font-size: 0.8em;
|
||||
+}
|
||||
diff --git components/version_ui/resources/about_version.html components/version_ui/resources/about_version.html
|
||||
index 508c4ecfd790f..fed6933908951 100644
|
||||
--- components/version_ui/resources/about_version.html
|
||||
+++ components/version_ui/resources/about_version.html
|
||||
@@ -62,9 +62,21 @@ about:version template page
|
||||
</picture>
|
||||
</if>
|
||||
<div id="company">$i18n{company}</div>
|
||||
- <div id="copyright">$i18n{copyright}</div>
|
||||
+ <div id="copyright">$i18n{copyright}
|
||||
+<if expr="enable_cef">
|
||||
+ <br/><a href="chrome://license">license</a> | <a href="chrome://credits">credits</a>
|
||||
+</if>
|
||||
+ </div>
|
||||
</div>
|
||||
<table id="inner" cellpadding="0" cellspacing="0" border="0">
|
||||
+<if expr="enable_cef">
|
||||
+ <tr>
|
||||
+ <td class="label">CEF</td>
|
||||
+ <td class="version">
|
||||
+ <span>$i18n{cef_version}</span>
|
||||
+ </td>
|
||||
+ </tr>
|
||||
+</if>
|
||||
<tr><td class="label">$i18n{application_label}</td>
|
||||
<td class="version" id="version">
|
||||
<span id="copy-content">
|
||||
@@ -171,7 +183,15 @@ about:version template page
|
||||
<tr><td class="label">$i18n{executable_path_name}</td>
|
||||
<td class="version" id="executable_path">$i18n{executable_path}</td>
|
||||
</tr>
|
||||
- <tr><td class="label">$i18n{profile_path_name}</td>
|
||||
+<if expr="enable_cef">
|
||||
+ <tr><td class="label">$i18n{module_path_name}</td>
|
||||
+ <td class="version" id="module_path">$i18n{module_path}</td>
|
||||
+ </tr>
|
||||
+ <tr><td class="label">$i18n{user_data_path_name} <sup><a href="#footnote">[*]</a></sup></td>
|
||||
+ <td class="version" id="user_data_path">$i18n{user_data_path}</td>
|
||||
+ </tr>
|
||||
+</if>
|
||||
+ <tr><td class="label">$i18n{profile_path_name} <sup><a href="#footnote">[*]</a></sup></td>
|
||||
<td class="version" id="profile_path">$i18n{profile_path}</td>
|
||||
</tr>
|
||||
</if>
|
||||
@@ -198,6 +218,17 @@ about:version template page
|
||||
<td class="version" id="sanitizer">$i18n{sanitizer}</td>
|
||||
</tr>
|
||||
</table>
|
||||
+<if expr="enable_cef">
|
||||
+ <div id="footnote">
|
||||
+ <br/><a name="footnote">[*] In <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md" target="_new">Chromium terminology</a>,
|
||||
+ <a href="https://cef-builds.spotifycdn.com/docs/stable.html?structcef__settings__t.html#a2e2be03f34ddd93de90e1cf196757a19" target="_new">CefSettings.root_cache_path</a>
|
||||
+ is the "$i18n{user_data_path_name}" and <a href="https://cef-builds.spotifycdn.com/docs/stable.html?structcef__settings__t.html#ad1644a7eb23cad969181db010f007710" target="_new">CefSettings.cache_path</a>
|
||||
+ is the "$i18n{profile_path_name}". Chromium's <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/process_singleton.h#35" target="_new">process singleton lock</a>
|
||||
+ protects against multiple app instances writing to the same "$i18n{user_data_path_name}" directory.
|
||||
+ Implement <a href="https://cef-builds.spotifycdn.com/docs/stable.html?classCefBrowserProcessHandler.html#a052a91639483467c0b546d57a05c2f06" target="_new">CefBrowserProcessHandler:: OnAlreadyRunningAppRelaunch</a>
|
||||
+ to handle the case of app relaunch with the same directory.
|
||||
+ </div>
|
||||
+</if>
|
||||
</div>
|
||||
|
||||
<div id="messages" role="alert" aria-live="polite" aria-relevant="additions">
|
||||
diff --git components/version_ui/resources/about_version.ts components/version_ui/resources/about_version.ts
|
||||
index fcd11ec05dc17..565657694f768 100644
|
||||
--- components/version_ui/resources/about_version.ts
|
||||
+++ components/version_ui/resources/about_version.ts
|
||||
@@ -50,9 +50,21 @@ function handleVariationInfo(
|
||||
* @param profilePath The profile path to display.
|
||||
*/
|
||||
function handlePathInfo(
|
||||
- {execPath, profilePath}: {execPath: string, profilePath: string}) {
|
||||
+ {execPath, profilePath
|
||||
+// <if expr="enable_cef">
|
||||
+ , modulePath, userDataPath
|
||||
+// </if>
|
||||
+ }: {execPath: string, profilePath: string
|
||||
+// <if expr="enable_cef">
|
||||
+ , modulePath: string, userDataPath: string
|
||||
+// </if>
|
||||
+ }) {
|
||||
getRequiredElement('executable_path').textContent = execPath;
|
||||
getRequiredElement('profile_path').textContent = profilePath;
|
||||
+// <if expr="enable_cef">
|
||||
+ getRequiredElement('module_path').textContent = modulePath;
|
||||
+ getRequiredElement('user_data_path').textContent = userDataPath;
|
||||
+// </if>
|
||||
}
|
||||
|
||||
// <if expr="chromeos_lacros or is_win">
|
||||
diff --git components/version_ui/version_ui_constants.cc components/version_ui/version_ui_constants.cc
|
||||
index f33bd808d6d56..75515ffa256b7 100644
|
||||
--- components/version_ui/version_ui_constants.cc
|
||||
+++ components/version_ui/version_ui_constants.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
|
||||
namespace version_ui {
|
||||
|
||||
@@ -90,4 +91,15 @@ const char kVersion[] = "version";
|
||||
const char kVersionModifier[] = "version_modifier";
|
||||
const char kVersionProcessorVariation[] = "version_processor_variation";
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+const char kKeyModulePath[] = "modulePath";
|
||||
+const char kKeyUserDataPath[] = "userDataPath";
|
||||
+
|
||||
+const char kCefVersion[] = "cef_version";
|
||||
+const char kModulePath[] = "module_path";
|
||||
+const char kModulePathName[] = "module_path_name";
|
||||
+const char kUserDataPath[] = "user_data_path";
|
||||
+const char kUserDataPathName[] = "user_data_path_name";
|
||||
+#endif
|
||||
+
|
||||
} // namespace version_ui
|
||||
diff --git components/version_ui/version_ui_constants.h components/version_ui/version_ui_constants.h
|
||||
index 212f7e2114c75..d35549eb15310 100644
|
||||
--- components/version_ui/version_ui_constants.h
|
||||
+++ components/version_ui/version_ui_constants.h
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
|
||||
namespace version_ui {
|
||||
|
||||
@@ -92,6 +93,17 @@ extern const char kVersion[];
|
||||
extern const char kVersionModifier[];
|
||||
extern const char kVersionProcessorVariation[];
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+extern const char kKeyModulePath[];
|
||||
+extern const char kKeyUserDataPath[];
|
||||
+
|
||||
+extern const char kCefVersion[];
|
||||
+extern const char kModulePath[];
|
||||
+extern const char kModulePathName[];
|
||||
+extern const char kUserDataPath[];
|
||||
+extern const char kUserDataPathName[];
|
||||
+#endif
|
||||
+
|
||||
} // namespace version_ui
|
||||
|
||||
#endif // COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_
|
||||
diff --git components/version_ui_strings.grdp components/version_ui_strings.grdp
|
||||
index 9f236e6217ee9..d2b7964c3a09f 100644
|
||||
--- components/version_ui_strings.grdp
|
||||
+++ components/version_ui_strings.grdp
|
||||
@@ -76,6 +76,14 @@
|
||||
<message name="IDS_VERSION_UI_PROFILE_PATH" desc="label for the profile path on the about:version page">
|
||||
Profile Path
|
||||
</message>
|
||||
+ <if expr="enable_cef">
|
||||
+ <message name="IDS_VERSION_UI_MODULE_PATH" desc="label for the module path on the about:version page">
|
||||
+ Module Path
|
||||
+ </message>
|
||||
+ <message name="IDS_VERSION_UI_USER_DATA_PATH" desc="label for the user data path on the about:version page">
|
||||
+ User Data Path
|
||||
+ </message>
|
||||
+ </if>
|
||||
<message name="IDS_VERSION_UI_PATH_NOTFOUND" desc="label for the non-existent path on the about:version page">
|
||||
No such file or directory
|
||||
</message>
|
@@ -174,7 +174,7 @@ index 3553377e96017..9f6edc70ef1d4 100644
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
std::unique_ptr<chromeos::LacrosService> lacros_service_;
|
||||
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
|
||||
index f90f1b8fa54d9..3dc8a9fe49363 100644
|
||||
index f90f1b8fa54d9..3c1406cc798a7 100644
|
||||
--- chrome/browser/chrome_browser_main.cc
|
||||
+++ chrome/browser/chrome_browser_main.cc
|
||||
@@ -52,6 +52,7 @@
|
||||
@@ -327,22 +327,7 @@ index f90f1b8fa54d9..3dc8a9fe49363 100644
|
||||
|
||||
// Desktop construction occurs here, (required before profile creation).
|
||||
PreProfileInit();
|
||||
@@ -1624,12 +1636,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
browser_process_->local_state());
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
// Needs to be done before PostProfileInit, since login manager on CrOS is
|
||||
// called inside PostProfileInit.
|
||||
content::WebUIControllerFactory::RegisterFactory(
|
||||
ChromeWebUIControllerFactory::GetInstance());
|
||||
RegisterChromeWebUIConfigs();
|
||||
RegisterChromeUntrustedWebUIConfigs();
|
||||
+#endif
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
page_info::SetPageInfoClient(new ChromePageInfoClient());
|
||||
@@ -1656,6 +1670,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
@@ -1656,6 +1668,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
// Call `PostProfileInit()`and set it up for profiles created later.
|
||||
profile_init_manager_ = std::make_unique<ProfileInitManager>(this, profile);
|
||||
|
||||
@@ -350,7 +335,7 @@ index f90f1b8fa54d9..3dc8a9fe49363 100644
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
// Execute first run specific code after the PrefService has been initialized
|
||||
// and preferences have been registered since some of the import code depends
|
||||
@@ -1695,6 +1710,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
@@ -1695,6 +1708,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
*base::CommandLine::ForCurrentProcess());
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
@@ -358,7 +343,7 @@ index f90f1b8fa54d9..3dc8a9fe49363 100644
|
||||
|
||||
// Configure modules that need access to resources.
|
||||
net::NetModule::SetResourceProvider(ChromeNetResourceProvider);
|
||||
@@ -1786,6 +1802,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
@@ -1786,6 +1800,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
g_browser_process->profile_manager()->GetLastOpenedProfiles();
|
||||
}
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
@@ -370,7 +355,7 @@ index f90f1b8fa54d9..3dc8a9fe49363 100644
|
||||
// This step is costly.
|
||||
if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(),
|
||||
base::FilePath(), profile_info,
|
||||
@@ -1818,11 +1839,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
@@ -1818,11 +1837,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
|
||||
// Create the RunLoop for MainMessageLoopRun() to use and transfer
|
||||
// ownership of the browser's lifetime to the BrowserProcess.
|
||||
|
@@ -149,22 +149,25 @@ index 17c3d731e269b..e2caaf2934cdd 100644
|
||||
outputs = [
|
||||
"$root_out_dir/chrome.7z",
|
||||
diff --git tools/grit/grit_args.gni tools/grit/grit_args.gni
|
||||
index 79d613489bac2..86b82e96b7ec0 100644
|
||||
index 79d613489bac2..869b682d453ee 100644
|
||||
--- tools/grit/grit_args.gni
|
||||
+++ tools/grit/grit_args.gni
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -5,7 +5,9 @@
|
||||
import("//build/config/chrome_build.gni")
|
||||
import("//build/config/chromeos/ui_mode.gni")
|
||||
import("//build/config/devtools.gni")
|
||||
+import("//build/config/locales.gni")
|
||||
import("//build/config/ui.gni")
|
||||
+import("//cef/libcef/features/features.gni")
|
||||
|
||||
shared_intermediate_dir = rebase_path(root_gen_dir, root_build_dir)
|
||||
@@ -36,6 +37,8 @@ _grit_defines = [
|
||||
devtools_grd_path = "$shared_intermediate_dir/$devtools_grd_location"
|
||||
@@ -36,6 +38,9 @@ _grit_defines = [
|
||||
|
||||
# Mac and iOS want Title Case strings.
|
||||
"use_titlecase=${is_apple}",
|
||||
+
|
||||
+ "enable_cef=${enable_cef}",
|
||||
+ "enable_pseudolocales=${enable_pseudolocales}",
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user