0

Revert "Reland "Load QuickOffice manifest from cros rootfs""

This reverts commit 336415fa90.

Reason for revert: suspect causing browser_tests failure on linux-chromeos-chrome

browser_tests failed because of:
All/FileTasksBrowserTest.FallbackSucceedsWithQuickOffice/Guest
All/FileTasksBrowserTest.FallbackSucceedsWithQuickOffice/Regular
All/FileTasksBrowserTest.QuickOffice/Guest
All/FileTasksBrowserTest.QuickOffice/Incognito
...6 more failure(s) (10 total)...

The first build failure:
https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/37099/overview

Original change's description:
> Reland "Load QuickOffice manifest from cros rootfs"
>
> This reverts commit 05780297d2.
>
> Reason for revert: Fixed compile error
>
> Original change's description:
> > Revert "Load QuickOffice manifest from cros rootfs"
> >
> > This reverts commit a1b9a2a855.
> >
> > Reason for revert: suspect causing compile failure on lacros-arm32-rel-ready bot.
> >
> > First build failure:
> > https://ci.chromium.org/ui/p/chrome/builders/ci/lacros-arm32-rel-ready/17628/overview
> >
> > Sample log:
> > ../../chrome/browser/extensions/component_loader.cc:550:7: error: use of undeclared identifier 'AddComponentFromDirWithManifestFilename'
> > AddComponentFromDirWithManifestFilename(
> > ^
> > 1 error generated.
> >
> > Original change's description:
> > > Load QuickOffice manifest from cros rootfs
> > >
> > > QuickOffice will change in crrev.com/c/5014644 to load all files
> > > including manifest.json into rootfs at
> > > /usr/share/chromeos-assets/quickoffice.
> > >
> > > CrOS will load all files directly from gcs rather than using the
> > > chromium repo submodule. There will be no need to keep
> > > chrome/browser/resources/chromeos/quickoffice.
> > >
> > > Bug: 1491571
> > > Change-Id: I1f1de7cc1c4950b4fd30d1bab8300faf6b7e8494
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5013290
> > > Commit-Queue: Joel Hockey <joelhockey@chromium.org>
> > > Reviewed-by: Dominick Ng <dominickn@chromium.org>
> > > Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#1222566}
> >
> > Bug: 1491571
> > Change-Id: Ifdc07c1b1b21caf0bf5ad35913bb1c2a12dd3f51
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017114
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Owners-Override: Takashi Sakamoto <tasak@google.com>
> > Commit-Queue: Takashi Sakamoto <tasak@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1222647}
>
> Bug: 1491571
> Change-Id: Ifed4ad16a0e646a23a2da62e06483cf47af1ea2b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5018558
> Reviewed-by: Takashi Sakamoto <tasak@google.com>
> Commit-Queue: Joel Hockey <joelhockey@chromium.org>
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Owners-Override: Takashi Sakamoto <tasak@google.com>
> Cr-Commit-Position: refs/heads/main@{#1222715}

Bug: 1491571
Change-Id: I771e0ccc0e1e9e1213c494746345085338e9868d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017601
Owners-Override: Takashi Sakamoto <tasak@google.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1222771}
This commit is contained in:
Takashi Sakamoto
2023-11-10 06:24:29 +00:00
committed by Chromium LUCI CQ
parent ebbb250d0a
commit 9d571b2d79
7 changed files with 90 additions and 88 deletions
.gitmodulesDEPS
chrome/browser
browser_resources.grd
extensions
resources
chromeos

4
.gitmodules vendored

@ -607,6 +607,10 @@
path = chrome/browser/nearby_sharing/internal
url = https://chrome-internal.googlesource.com/chrome/browser/nearby_sharing/internal.git
gclient-condition = checkout_src_internal
[submodule "chrome/browser/resources/chromeos/quickoffice"]
path = chrome/browser/resources/chromeos/quickoffice
url = https://chrome-internal.googlesource.com/quickoffice/crx.git
gclient-condition = (checkout_chromeos or checkout_linux) and checkout_src_internal
[submodule "chrome/browser/resources/settings_internal"]
path = chrome/browser/resources/settings_internal
url = https://chrome-internal.googlesource.com/chrome/browser/resources/settings_internal.git

6
DEPS

@ -3856,6 +3856,12 @@ deps = {
'condition': 'checkout_src_internal',
},
'src/chrome/browser/resources/chromeos/quickoffice': {
'url': Var('chrome_git') + '/quickoffice/crx.git' + '@' +
'23bde3495989fbc0112213613d2498030be51417',
'condition': '(checkout_chromeos or checkout_linux) and checkout_src_internal',
},
'src/chrome/browser/resources/settings_internal': {
'url': Var('chrome_git') + '/chrome/browser/resources/settings_internal.git' + '@' +
'5d6316b2434986e6b073e1d24585578bb27da451', # from svn revision 41419

@ -232,6 +232,9 @@
<include name="IDR_CHROME_URLS_DISABLED_PAGE_HTML" file="resources\chromeos\chrome_urls_disabled_page\app.html" type="BINDATA" />
<include name="IDR_ECHO_MANIFEST" file="resources\chromeos\echo\manifest.json" type="BINDATA" />
<include name="IDR_INCOGNITO_NAVIGATION_BLOCKED_PAGE_HTML" file="resources\chromeos\enterprise\incognito_navigation_blocked_page\incognito_blocked.html" flattenhtml="true" type="BINDATA" />
<if expr="_google_chrome">
<include name="IDR_QUICKOFFICE_MANIFEST" file="resources\chromeos\quickoffice\manifest.json" type="BINDATA" />
</if>
</if>
<if expr="_google_chrome">
<include name="IDR_PREF_HASH_SEED_BIN" file="resources\settings_internal\pref_hash_seed.bin" type="BINDATA" />

@ -52,9 +52,6 @@ bool IsComponentExtensionAllowlisted(const std::string& extension_id) {
#if BUILDFLAG(IS_CHROMEOS)
extension_misc::kContactCenterInsightsExtensionId,
extension_misc::kDeskApiExtensionId,
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
extension_misc::kQuickOfficeComponentExtensionId,
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif
};
@ -106,6 +103,9 @@ bool IsComponentExtensionAllowlisted(int manifest_resource_id) {
case IDR_CONTACT_CENTER_INSIGHTS_MANIFEST:
case IDR_DESK_API_MANIFEST:
case IDR_ECHO_MANIFEST:
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
case IDR_QUICKOFFICE_MANIFEST:
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // BUILDFLAG(IS_CHROMEOS)
return true;
}

@ -108,7 +108,7 @@ std::string GenerateId(const base::Value::Dict& manifest,
return id;
}
#if BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
absl::optional<base::Value::Dict> LoadManifestOnFileThread(
const base::FilePath& root_directory,
const base::FilePath::CharType* manifest_filename,
@ -137,9 +137,7 @@ absl::optional<base::Value::Dict> LoadManifestOnFileThread(
return manifest;
}
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
bool IsNormalSession() {
return !base::CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kGuestSession) &&
@ -549,11 +547,9 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages(
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
if (!base::FeatureList::IsEnabled(
chromeos::features::kDisableOfficeEditingComponentApp)) {
AddComponentFromDirWithManifestFilename(
base::FilePath("/usr/share/chromeos-assets/quickoffice"),
extension_misc::kQuickOfficeComponentExtensionId,
extensions::kManifestFilename, extensions::kManifestFilename,
base::DoNothing());
Add(IDR_QUICKOFFICE_MANIFEST,
base::FilePath(
FILE_PATH_LITERAL("/usr/share/chromeos-assets/quickoffice")));
}
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // BUILDFLAG(IS_CHROMEOS)
@ -613,58 +609,6 @@ void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) {
}
}
#if BUILDFLAG(IS_CHROMEOS)
void ComponentLoader::AddComponentFromDirWithManifestFilename(
const base::FilePath& root_directory,
const char* extension_id,
const base::FilePath::CharType* manifest_file_name,
const base::FilePath::CharType* guest_manifest_file_name,
base::OnceClosure done_cb) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if BUILDFLAG(IS_CHROMEOS_ASH)
const base::FilePath::CharType* manifest_filename =
IsNormalSession() ? manifest_file_name : guest_manifest_file_name;
#else
const base::FilePath::CharType* manifest_filename = manifest_file_name;
#endif
GetExtensionFileTaskRunner()->PostTaskAndReplyWithResult(
FROM_HERE,
base::BindOnce(&LoadManifestOnFileThread, root_directory,
manifest_filename, true),
base::BindOnce(&ComponentLoader::FinishAddComponentFromDir,
weak_factory_.GetWeakPtr(), root_directory, extension_id,
absl::nullopt, absl::nullopt, std::move(done_cb)));
}
void ComponentLoader::FinishAddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const absl::optional<std::string>& name_string,
const absl::optional<std::string>& description_string,
base::OnceClosure done_cb,
absl::optional<base::Value::Dict> manifest) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!manifest) {
return; // Error already logged.
}
if (name_string) {
manifest->Set(manifest_keys::kName, name_string.value());
}
if (description_string) {
manifest->Set(manifest_keys::kDescription, description_string.value());
}
std::string actual_extension_id =
Add(std::move(*manifest), root_directory, false);
CHECK_EQ(extension_id, actual_extension_id);
if (done_cb) {
std::move(done_cb).Run();
}
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void ComponentLoader::AddComponentFromDir(const base::FilePath& root_directory,
const char* extension_id,
@ -674,6 +618,24 @@ void ComponentLoader::AddComponentFromDir(const base::FilePath& root_directory,
extension_misc::kGuestManifestFilename, std::move(done_cb));
}
void ComponentLoader::AddComponentFromDirWithManifestFilename(
const base::FilePath& root_directory,
const char* extension_id,
const base::FilePath::CharType* manifest_file_name,
const base::FilePath::CharType* guest_manifest_file_name,
base::OnceClosure done_cb) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
const base::FilePath::CharType* manifest_filename =
IsNormalSession() ? manifest_file_name : guest_manifest_file_name;
GetExtensionFileTaskRunner()->PostTaskAndReplyWithResult(
FROM_HERE,
base::BindOnce(&LoadManifestOnFileThread, root_directory,
manifest_filename, true),
base::BindOnce(&ComponentLoader::FinishAddComponentFromDir,
weak_factory_.GetWeakPtr(), root_directory, extension_id,
absl::nullopt, absl::nullopt, std::move(done_cb)));
}
void ComponentLoader::AddWithNameAndDescriptionFromDir(
const base::FilePath& root_directory,
const char* extension_id,
@ -711,6 +673,34 @@ void ComponentLoader::AddChromeOsSpeechSynthesisExtensions() {
}
}
void ComponentLoader::FinishAddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const absl::optional<std::string>& name_string,
const absl::optional<std::string>& description_string,
base::OnceClosure done_cb,
absl::optional<base::Value::Dict> manifest) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!manifest) {
return; // Error already logged.
}
if (name_string) {
manifest->Set(manifest_keys::kName, name_string.value());
}
if (description_string) {
manifest->Set(manifest_keys::kDescription, description_string.value());
}
std::string actual_extension_id =
Add(std::move(*manifest), root_directory, false);
CHECK_EQ(extension_id, actual_extension_id);
if (done_cb) {
std::move(done_cb).Run();
}
}
void ComponentLoader::FinishLoadSpeechSynthesisExtension(
const char* extension_id) {
// TODO(https://crbug.com/947305): mitigation for extension not awake after
@ -718,6 +708,6 @@ void ComponentLoader::FinishLoadSpeechSynthesisExtension(
extensions::ProcessManager::Get(profile_)->WakeEventPage(extension_id,
base::DoNothing());
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif
} // namespace extensions

@ -106,17 +106,6 @@ class ComponentLoader {
// Return ids of all registered extensions.
std::vector<std::string> GetRegisteredComponentExtensionsIds() const;
#if BUILDFLAG(IS_CHROMEOS)
// Identical to above except allows for the caller to supply the name of the
// manifest file.
void AddComponentFromDirWithManifestFilename(
const base::FilePath& root_directory,
const char* extension_id,
const base::FilePath::CharType* manifest_file_name,
const base::FilePath::CharType* guest_manifest_file_name,
base::OnceClosure done_cb);
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Add a component extension from a specific directory. Assumes that the
// extension uses a different manifest file when this is a guest session
@ -126,6 +115,15 @@ class ComponentLoader {
const char* extension_id,
base::OnceClosure done_cb);
// Identical to above except allows for the caller to supply the name of the
// manifest file.
void AddComponentFromDirWithManifestFilename(
const base::FilePath& root_directory,
const char* extension_id,
const base::FilePath::CharType* manifest_file_name,
const base::FilePath::CharType* guest_manifest_file_name,
base::OnceClosure done_cb);
// Add a component extension from a specific directory. Assumes that the
// extension's manifest file lives in |root_directory| and its name is
// 'manifest.json'. |name_string| and |description_string| are used to
@ -202,19 +200,6 @@ class ComponentLoader {
const std::string& description_string);
void AddWebStoreApp();
#if BUILDFLAG(IS_CHROMEOS)
// Used as a reply callback by |AddComponentFromDir|.
// Called with a |root_directory| and parsed |manifest| and invokes
// |done_cb| after adding the extension.
void FinishAddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const absl::optional<std::string>& name_string,
const absl::optional<std::string>& description_string,
base::OnceClosure done_cb,
absl::optional<base::Value::Dict> manifest);
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void AddChromeApp();
void AddFileManagerExtension();
@ -230,8 +215,21 @@ class ComponentLoader {
// Unloads |component| from the memory.
void UnloadComponent(ComponentExtensionInfo* component);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Used as a reply callback by |AddComponentFromDir|.
// Called with a |root_directory| and parsed |manifest| and invokes
// |done_cb| after adding the extension.
void FinishAddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const absl::optional<std::string>& name_string,
const absl::optional<std::string>& description_string,
base::OnceClosure done_cb,
absl::optional<base::Value::Dict> manifest);
// Finishes loading an extension tts engine.
void FinishLoadSpeechSynthesisExtension(const char* extension_id);
#endif
raw_ptr<Profile> profile_;