electron/shell/browser/extensions/electron_extension_system.cc

237 lines
7.7 KiB
C++
Raw Normal View History

// Copyright 2014 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 "shell/browser/extensions/electron_extension_system.h"
#include <memory>
#include <string>
#include <utility>
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
2020-02-13 00:39:12 +00:00
#include "base/json/json_string_value_serializer.h"
#include "base/path_service.h"
#include "base/task/post_task.h"
2020-02-13 00:39:12 +00:00
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "electron/buildflags/buildflags.h"
#include "extensions/browser/api/app_runtime/app_runtime_api.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
chore: bump chromium to 91.0.4448.0 (master) (#28009) * chore: bump chromium in DEPS to 91.0.4435.3 * build: add 'use_rts' definition Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187 * chore: update patches * chore: media_internal_resources becomes resources Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022 * chore: update patches * refactor: extensions::ViewType moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * chore: might_have_observers has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839 * refactor: CertVerifier is not in the network namespace anymore Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805 * refactor: ExtensionUserScriptManager is now UserScriptManager Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617 * refactor: content::SiteInstance::GetSiteForURL was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274 * refactor: MenuItemType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: extensions::ViewType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * refacotr: grit::ResourceMap replaced with webui::ResourcePath Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601 * refactor: blink::MenuItem::Type was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: CreateDataPipe deprecated form was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090 * refactor: DesktopMediaList::Type replaces content::DesktopMediaType_* Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637 * chore: wire up activation_time in OSR Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372 * chore: remove deleted file from chromium_src list * chore: fix lint * update patches * chore: bump chromium in DEPS to 91.0.4438.0 * chore: bump chromium in DEPS to 91.0.4439.0 * chore: bump chromium in DEPS to 91.0.4440.0 * chore: bump chromium in DEPS to 91.0.4441.0 * chore: bump chromium in DEPS to 91.0.4442.0 * chore: bump chromium in DEPS to 91.0.4443.0 * chore: bump chromium in DEPS to 91.0.4445.0 * chore: bump chromium in DEPS to 91.0.4446.0 * chore: update patches * fixup gn check * Merge branch 'master' into roller/chromium/master * update to xcode 12.4.0 Needed because of https://chromium.googlesource.com/chromium/src/+/8008deb41cc7ee54a1ef08e2b8afec8046285468 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id. https://chromium-review.googlesource.com/c/chromium/src/+/2752932 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2734095: Introduce StoragePartitionId type to wrap current string representation. https://chromium-review.googlesource.com/c/chromium/src/+/2734095 * chore: bump chromium in DEPS to 91.0.4448.0 * Update patches * 2743594: Remove WebSize from blink. https://chromium-review.googlesource.com/c/chromium/src/+/2743594 * 2725403: Add URLLoaderClient::OnReceiveEarlyHints() https://chromium-review.googlesource.com/c/chromium/src/+/2725403 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2721718: Move HostID to extensions::mojom::HostID https://chromium-review.googlesource.com/c/chromium/src/+/2721718 * 2733070: Rename observer to URLLoaderNetworkServiceObserver https://chromium-review.googlesource.com/c/chromium/src/+/2733070 * Use nogncheck for content/browser/site_instance_impl.h This is needed because //content/browser:browser is not a visible target * 2648046: Introduce alert notification helper .app https://chromium-review.googlesource.com/c/chromium/src/+/2648046 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * only include mac notifications on mac * add additional skipping of atk toolchain check * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2720306: [api] Remove deprecated [Shared]ArrayBuffer API https://chromium-review.googlesource.com/c/v8/v8/+/2720306 * Fixup 2721718: Move HostID to extensions::mojom::HostID * fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer * Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui * Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints() * update node headers * chore: bump chromium in DEPS to 91.0.4449.0 * Revert "chore: bump chromium in DEPS to 91.0.4449.0" This reverts commit bccafa02896eef24b5561e9581d853057323d548. * 2693008: Fix loading non-system cursors on Windows on browser_tests https://chromium-review.googlesource.com/c/chromium/src/+/2693008 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * undo changes to WebContentsPreferences::GetPreloadPath to fix mac build * fix StrCat issue * incantations for WebContentsPreferences::GetPreloadPath wide strings * bump nan * fix GetAsString maybe? * windows build fixes * more windows build fix * SetAppUserModelID -> wstring * upgrade nan dep in tests * lint * wstrings are cross-platform * linter * only bind setAppUserModelId on windows * fix a messed up merge * well that was an odyssey * backport fcdf35e from v8 to fix nan crash * disable typedarrays-test.js * don't defer in NSWindow creation https://chromium-review.googlesource.com/c/chromium/src/+/2707696 * use PartitionAllocator for ArrayBuffers in the main process * fix patches * chore: omit some unnecessary conversions * refactor: make LoginItemSettings::path a wstring * refactor: make ShowTaskDialog take a wstr * Revert "refactor: make LoginItemSettings::path a wstring" This reverts commit 9127cff58b6740bcf5dffff420ffeb14b24a245f. Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-03-31 02:17:09 +00:00
#include "extensions/browser/user_script_manager.h"
#include "extensions/browser/value_store/value_store_factory_impl.h"
#include "extensions/common/constants.h"
#include "extensions/common/file_util.h"
#include "shell/browser/extensions/electron_extension_loader.h"
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "chrome/browser/pdf/pdf_extension_util.h" // nogncheck
#endif
using content::BrowserContext;
using content::BrowserThread;
namespace extensions {
ElectronExtensionSystem::ElectronExtensionSystem(
BrowserContext* browser_context)
: browser_context_(browser_context),
store_factory_(new ValueStoreFactoryImpl(browser_context->GetPath())) {}
ElectronExtensionSystem::~ElectronExtensionSystem() = default;
void ElectronExtensionSystem::LoadExtension(
const base::FilePath& extension_dir,
int load_flags,
base::OnceCallback<void(const Extension*, const std::string&)> cb) {
extension_loader_->LoadExtension(extension_dir, load_flags, std::move(cb));
}
void ElectronExtensionSystem::FinishInitialization() {
// Inform the rest of the extensions system to start.
ready_.Signal();
}
void ElectronExtensionSystem::ReloadExtension(const ExtensionId& extension_id) {
extension_loader_->ReloadExtension(extension_id);
}
void ElectronExtensionSystem::RemoveExtension(const ExtensionId& extension_id) {
extension_loader_->UnloadExtension(
extension_id, extensions::UnloadedExtensionReason::UNINSTALL);
}
void ElectronExtensionSystem::Shutdown() {
extension_loader_.reset();
}
void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
service_worker_manager_ =
std::make_unique<ServiceWorkerManager>(browser_context_);
runtime_data_ =
std::make_unique<RuntimeData>(ExtensionRegistry::Get(browser_context_));
quota_service_ = std::make_unique<QuotaService>();
chore: bump chromium to 91.0.4448.0 (master) (#28009) * chore: bump chromium in DEPS to 91.0.4435.3 * build: add 'use_rts' definition Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187 * chore: update patches * chore: media_internal_resources becomes resources Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022 * chore: update patches * refactor: extensions::ViewType moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * chore: might_have_observers has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839 * refactor: CertVerifier is not in the network namespace anymore Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805 * refactor: ExtensionUserScriptManager is now UserScriptManager Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617 * refactor: content::SiteInstance::GetSiteForURL was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274 * refactor: MenuItemType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: extensions::ViewType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * refacotr: grit::ResourceMap replaced with webui::ResourcePath Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601 * refactor: blink::MenuItem::Type was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: CreateDataPipe deprecated form was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090 * refactor: DesktopMediaList::Type replaces content::DesktopMediaType_* Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637 * chore: wire up activation_time in OSR Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372 * chore: remove deleted file from chromium_src list * chore: fix lint * update patches * chore: bump chromium in DEPS to 91.0.4438.0 * chore: bump chromium in DEPS to 91.0.4439.0 * chore: bump chromium in DEPS to 91.0.4440.0 * chore: bump chromium in DEPS to 91.0.4441.0 * chore: bump chromium in DEPS to 91.0.4442.0 * chore: bump chromium in DEPS to 91.0.4443.0 * chore: bump chromium in DEPS to 91.0.4445.0 * chore: bump chromium in DEPS to 91.0.4446.0 * chore: update patches * fixup gn check * Merge branch 'master' into roller/chromium/master * update to xcode 12.4.0 Needed because of https://chromium.googlesource.com/chromium/src/+/8008deb41cc7ee54a1ef08e2b8afec8046285468 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id. https://chromium-review.googlesource.com/c/chromium/src/+/2752932 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2734095: Introduce StoragePartitionId type to wrap current string representation. https://chromium-review.googlesource.com/c/chromium/src/+/2734095 * chore: bump chromium in DEPS to 91.0.4448.0 * Update patches * 2743594: Remove WebSize from blink. https://chromium-review.googlesource.com/c/chromium/src/+/2743594 * 2725403: Add URLLoaderClient::OnReceiveEarlyHints() https://chromium-review.googlesource.com/c/chromium/src/+/2725403 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2721718: Move HostID to extensions::mojom::HostID https://chromium-review.googlesource.com/c/chromium/src/+/2721718 * 2733070: Rename observer to URLLoaderNetworkServiceObserver https://chromium-review.googlesource.com/c/chromium/src/+/2733070 * Use nogncheck for content/browser/site_instance_impl.h This is needed because //content/browser:browser is not a visible target * 2648046: Introduce alert notification helper .app https://chromium-review.googlesource.com/c/chromium/src/+/2648046 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * only include mac notifications on mac * add additional skipping of atk toolchain check * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2720306: [api] Remove deprecated [Shared]ArrayBuffer API https://chromium-review.googlesource.com/c/v8/v8/+/2720306 * Fixup 2721718: Move HostID to extensions::mojom::HostID * fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer * Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui * Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints() * update node headers * chore: bump chromium in DEPS to 91.0.4449.0 * Revert "chore: bump chromium in DEPS to 91.0.4449.0" This reverts commit bccafa02896eef24b5561e9581d853057323d548. * 2693008: Fix loading non-system cursors on Windows on browser_tests https://chromium-review.googlesource.com/c/chromium/src/+/2693008 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * undo changes to WebContentsPreferences::GetPreloadPath to fix mac build * fix StrCat issue * incantations for WebContentsPreferences::GetPreloadPath wide strings * bump nan * fix GetAsString maybe? * windows build fixes * more windows build fix * SetAppUserModelID -> wstring * upgrade nan dep in tests * lint * wstrings are cross-platform * linter * only bind setAppUserModelId on windows * fix a messed up merge * well that was an odyssey * backport fcdf35e from v8 to fix nan crash * disable typedarrays-test.js * don't defer in NSWindow creation https://chromium-review.googlesource.com/c/chromium/src/+/2707696 * use PartitionAllocator for ArrayBuffers in the main process * fix patches * chore: omit some unnecessary conversions * refactor: make LoginItemSettings::path a wstring * refactor: make ShowTaskDialog take a wstr * Revert "refactor: make LoginItemSettings::path a wstring" This reverts commit 9127cff58b6740bcf5dffff420ffeb14b24a245f. Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-03-31 02:17:09 +00:00
user_script_manager_ = std::make_unique<UserScriptManager>(browser_context_);
app_sorting_ = std::make_unique<NullAppSorting>();
extension_loader_ =
std::make_unique<ElectronExtensionLoader>(browser_context_);
2020-02-13 00:39:12 +00:00
if (!browser_context_->IsOffTheRecord())
LoadComponentExtensions();
management_policy_.reset(new ManagementPolicy);
2020-02-13 00:39:12 +00:00
}
std::unique_ptr<base::DictionaryValue> ParseManifest(
base::StringPiece manifest_contents) {
JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest = deserializer.Deserialize(NULL, NULL);
if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest.";
return std::unique_ptr<base::DictionaryValue>();
}
return base::DictionaryValue::From(std::move(manifest));
}
void ElectronExtensionSystem::LoadComponentExtensions() {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
2020-02-13 00:39:12 +00:00
std::string utf8_error;
std::string pdf_manifest_string = pdf_extension_util::GetManifest();
std::unique_ptr<base::DictionaryValue> pdf_manifest =
ParseManifest(pdf_manifest_string);
if (pdf_manifest) {
base::FilePath root_directory;
CHECK(base::PathService::Get(chrome::DIR_RESOURCES, &root_directory));
root_directory = root_directory.Append(FILE_PATH_LITERAL("pdf"));
scoped_refptr<const Extension> pdf_extension =
extensions::Extension::Create(
root_directory, extensions::Manifest::COMPONENT, *pdf_manifest,
extensions::Extension::REQUIRE_KEY, &utf8_error);
extension_loader_->registrar()->AddExtension(pdf_extension);
}
#endif
}
ExtensionService* ElectronExtensionSystem::extension_service() {
return nullptr;
}
RuntimeData* ElectronExtensionSystem::runtime_data() {
return runtime_data_.get();
}
ManagementPolicy* ElectronExtensionSystem::management_policy() {
return management_policy_.get();
}
ServiceWorkerManager* ElectronExtensionSystem::service_worker_manager() {
return service_worker_manager_.get();
}
chore: bump chromium to 91.0.4448.0 (master) (#28009) * chore: bump chromium in DEPS to 91.0.4435.3 * build: add 'use_rts' definition Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187 * chore: update patches * chore: media_internal_resources becomes resources Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022 * chore: update patches * refactor: extensions::ViewType moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * chore: might_have_observers has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839 * refactor: CertVerifier is not in the network namespace anymore Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805 * refactor: ExtensionUserScriptManager is now UserScriptManager Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617 * refactor: content::SiteInstance::GetSiteForURL was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274 * refactor: MenuItemType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: extensions::ViewType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * refacotr: grit::ResourceMap replaced with webui::ResourcePath Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601 * refactor: blink::MenuItem::Type was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: CreateDataPipe deprecated form was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090 * refactor: DesktopMediaList::Type replaces content::DesktopMediaType_* Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637 * chore: wire up activation_time in OSR Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372 * chore: remove deleted file from chromium_src list * chore: fix lint * update patches * chore: bump chromium in DEPS to 91.0.4438.0 * chore: bump chromium in DEPS to 91.0.4439.0 * chore: bump chromium in DEPS to 91.0.4440.0 * chore: bump chromium in DEPS to 91.0.4441.0 * chore: bump chromium in DEPS to 91.0.4442.0 * chore: bump chromium in DEPS to 91.0.4443.0 * chore: bump chromium in DEPS to 91.0.4445.0 * chore: bump chromium in DEPS to 91.0.4446.0 * chore: update patches * fixup gn check * Merge branch 'master' into roller/chromium/master * update to xcode 12.4.0 Needed because of https://chromium.googlesource.com/chromium/src/+/8008deb41cc7ee54a1ef08e2b8afec8046285468 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id. https://chromium-review.googlesource.com/c/chromium/src/+/2752932 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2734095: Introduce StoragePartitionId type to wrap current string representation. https://chromium-review.googlesource.com/c/chromium/src/+/2734095 * chore: bump chromium in DEPS to 91.0.4448.0 * Update patches * 2743594: Remove WebSize from blink. https://chromium-review.googlesource.com/c/chromium/src/+/2743594 * 2725403: Add URLLoaderClient::OnReceiveEarlyHints() https://chromium-review.googlesource.com/c/chromium/src/+/2725403 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2721718: Move HostID to extensions::mojom::HostID https://chromium-review.googlesource.com/c/chromium/src/+/2721718 * 2733070: Rename observer to URLLoaderNetworkServiceObserver https://chromium-review.googlesource.com/c/chromium/src/+/2733070 * Use nogncheck for content/browser/site_instance_impl.h This is needed because //content/browser:browser is not a visible target * 2648046: Introduce alert notification helper .app https://chromium-review.googlesource.com/c/chromium/src/+/2648046 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * only include mac notifications on mac * add additional skipping of atk toolchain check * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2720306: [api] Remove deprecated [Shared]ArrayBuffer API https://chromium-review.googlesource.com/c/v8/v8/+/2720306 * Fixup 2721718: Move HostID to extensions::mojom::HostID * fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer * Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui * Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints() * update node headers * chore: bump chromium in DEPS to 91.0.4449.0 * Revert "chore: bump chromium in DEPS to 91.0.4449.0" This reverts commit bccafa02896eef24b5561e9581d853057323d548. * 2693008: Fix loading non-system cursors on Windows on browser_tests https://chromium-review.googlesource.com/c/chromium/src/+/2693008 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * undo changes to WebContentsPreferences::GetPreloadPath to fix mac build * fix StrCat issue * incantations for WebContentsPreferences::GetPreloadPath wide strings * bump nan * fix GetAsString maybe? * windows build fixes * more windows build fix * SetAppUserModelID -> wstring * upgrade nan dep in tests * lint * wstrings are cross-platform * linter * only bind setAppUserModelId on windows * fix a messed up merge * well that was an odyssey * backport fcdf35e from v8 to fix nan crash * disable typedarrays-test.js * don't defer in NSWindow creation https://chromium-review.googlesource.com/c/chromium/src/+/2707696 * use PartitionAllocator for ArrayBuffers in the main process * fix patches * chore: omit some unnecessary conversions * refactor: make LoginItemSettings::path a wstring * refactor: make ShowTaskDialog take a wstr * Revert "refactor: make LoginItemSettings::path a wstring" This reverts commit 9127cff58b6740bcf5dffff420ffeb14b24a245f. Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-03-31 02:17:09 +00:00
UserScriptManager* ElectronExtensionSystem::user_script_manager() {
return new UserScriptManager(browser_context_);
}
StateStore* ElectronExtensionSystem::state_store() {
return nullptr;
}
StateStore* ElectronExtensionSystem::rules_store() {
return nullptr;
}
scoped_refptr<ValueStoreFactory> ElectronExtensionSystem::store_factory() {
return store_factory_;
}
InfoMap* ElectronExtensionSystem::info_map() {
if (!info_map_.get())
info_map_ = new InfoMap;
return info_map_.get();
}
QuotaService* ElectronExtensionSystem::quota_service() {
return quota_service_.get();
}
AppSorting* ElectronExtensionSystem::app_sorting() {
return app_sorting_.get();
}
void ElectronExtensionSystem::RegisterExtensionWithRequestContexts(
const Extension* extension,
base::OnceClosure callback) {
base::PostTaskAndReply(FROM_HERE, {BrowserThread::IO},
base::BindOnce(&InfoMap::AddExtension, info_map(),
base::RetainedRef(extension),
base::Time::Now(), false, false),
std::move(callback));
}
void ElectronExtensionSystem::UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) {}
const base::OneShotEvent& ElectronExtensionSystem::ready() const {
return ready_;
}
chore: bump chromium to a84d34e372b8fb5e9a94b1b4b447e (master) (#23908) * chore: bump chromium in DEPS to a7249f73ae05d456c04487ef1693325f719556dd * chore: bump chromium in DEPS to 202466fa40b58f0bb9c9a76a037d1c50154c099e * chore: bump chromium in DEPS to 2dd1b25c8d794b50fb0dd911e0c4e909ff39f145 * Update patches * update patches * Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" https://chromium-review.googlesource.com/c/chromium/src/+/2226002 * chore: bump chromium in DEPS to 8c1542e7dd36854fdf4abd1a8021eeb65a6a2e2b * chore: bump chromium in DEPS to 078bc6d796334fb403acd8975b99d1c8ecd028e8 * chore: bump chromium in DEPS to d96e9f16ae852ec9dbd15bf17df3d440402413bb * update patches * chore: update patches * Use ExtensionSystem::is_ready() instead of ExtensionService::is_ready() https://chromium-review.googlesource.com/c/chromium/src/+/2207499 * Remove WebImeTextSpan https://chromium-review.googlesource.com/c/chromium/src/+/2225240 * Remove PDFAnnotations flag altogether. https://chromium-review.googlesource.com/c/chromium/src/+/2229317 * Rework find-from-selection so it's synchronous -- fixes flaky tests https://chromium-review.googlesource.com/c/chromium/src/+/2181570 * fixup! Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" * chore: bump chromium in DEPS to a8a280835830c65145ed8573a9a09f36d3920418 * update sysroots * update patches * update patches * Take RFH as a parameter for DidUpdateFavicon/ManifestURL https://chromium-review.googlesource.com/c/chromium/src/+/2224745 * chore: bump chromium in DEPS to b6149cb5a5e32caf8eab67b97ef3072b72521ca8 * Update patches * Rename net::cookie_util::StripStatuses to StripAccessResults https://chromium-review.googlesource.com/c/chromium/src/+/2212697 * use net::CookieAccessResultList instead of net::CookieAccessResultList * fix mas_no_private_api patch https://chromium-review.googlesource.com/c/chromium/src/+/2230281 * chore: bump chromium in DEPS to a27feee1643d952e48f77c92d8c03aedea14b720 * update patches * fix: add new navigation state REUSE_SITE_INSTANCE To fix the new set of state checks added in https://chromium-review.googlesource.com/c/chromium/src/+/2215141 * chore: bump chromium in DEPS to ff4559a4c13d20888202474e4ab9917dbdad8a9a * update patches * Cleanup usages of old mojo types and remove unused code https://chromium-review.googlesource.com/c/chromium/src/+/2235699 * chore: bump chromium in DEPS to 05279845f76eb22900a8b0d1a11d4fd339a8e53b * chore: bump chromium in DEPS to 821558279767cffec90e3b5b947865f90089fed3 * chore: bump chromium in DEPS to 1aef04e6486be337d3dd820b2d64d6320a1b9c13 * chore: bump chromium in DEPS to dc86386e8fdd796a0f7577e91e42a7f8b7e9bc78 * chore: bump chromium in DEPS to 64f2360794f14643764092ba3e58e2ed8f9fee12 * chore: update patches * refactor: MessageLoop, you are terminated \o/ Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2246173 * refactor: plumb DownloadSchedule to DownloadItem Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2242202 * chore: fix variable typo in IPC * chore: s/BindPipeAndPassReceiver/BindNewPipeAndPassReceiver * chore: update patches * chore: XEvent becomes x11::Event Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240355 * fixup! refactor: MessageLoop, you are terminated \o/ * fixup! chore: XEvent becomes x11::Event * build: update v8 headers * chore: fix windows build * chore: disable SameSite-by-default changes https://chromium-review.googlesource.com/c/chromium/src/+/2231445 * update printing.patch * chore: bump chromium DEPS to 9ae03ef8f7d4f6ac663f725bcfe70311987652f3 * Convert WidgetHostMsg_SelectionBoundsChanged/TextInputStateChanged https://chromium-review.googlesource.com/c/chromium/src/+/2243531 * chore: update v8 patches * [XProto] Replace usages of XID and ::Window with x11::Window https://chromium-review.googlesource.com/c/chromium/src/+/2249389 * Update VideoFrameMetadata to use base::Optionals https://chromium-review.googlesource.com/c/chromium/src/+/2231706 https://chromium-review.googlesource.com/c/chromium/src/+/2238361 * --disable-dev-shm-usage for gpu process crash * [v8] Allow for 4GB TypedArrays https://chromium-review.googlesource.com/c/v8/v8/+/2249668 * update lib_src_switch_buffer_kmaxlength_to_size_t.patch * disable app.getGPUInfo spec on linux * update patches Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Electron Bot <anonymous@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-22 17:35:10 +00:00
bool ElectronExtensionSystem::is_ready() const {
return ready_.is_signaled();
}
ContentVerifier* ElectronExtensionSystem::content_verifier() {
return nullptr;
}
std::unique_ptr<ExtensionSet> ElectronExtensionSystem::GetDependentExtensions(
const Extension* extension) {
return std::make_unique<ExtensionSet>();
}
void ElectronExtensionSystem::InstallUpdate(
const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) {
NOTREACHED();
chore: bump chromium to 0e4ca9c0a63d7a39bd910997ad4c6 (master) (#24687) * chore: bump chromium in DEPS to 1f1c4d91f6eaa4a033ec8f499d63a0717f79a42a * viz: Do not apply white level scaling for RGBA fp16 HDR video https://chromium-review.googlesource.com/c/chromium/src/+/2296006 * Move WebPreferences to WebContents https://chromium-review.googlesource.com/c/chromium/src/+/2263635 * Fix missing WeakPtr check in PreconnectManager https://chromium-review.googlesource.com/c/chromium/src/+/2309029 * Fixup swiftshader roll revision * Update patch indices * Move WebDeviceEmulationParams into common. https://chromium-review.googlesource.com/c/chromium/src/+/2303356 * Move EnableDisableDeviceEmulation to blink mojom messages https://chromium-review.googlesource.com/c/chromium/src/+/2303367 * PDF Viewer: Remove flag for two-up view https://chromium-review.googlesource.com/c/chromium/src/+/2311130 * Add mojom definition for DeviceEmulationParams. https://chromium-review.googlesource.com/c/chromium/src/+/2303491 * Remove ServiceWorkerContextWatcher from PaymentAppInstaller https://chromium-review.googlesource.com/c/chromium/src/+/2291186 * Loader: Move transferrable_url_loader.mojom into blink's mojom directory https://chromium-review.googlesource.com/c/chromium/src/+/2306123 * chore: bump chromium in DEPS to 4974f436479739025a90ebc2cc2e36d67ee1ac46 * mac: Work around Xcode 12b3 SDK bug https://chromium-review.googlesource.com/c/chromium/src/+/2315078 * Reland Update core items for macOS Big Sur. https://chromium-review.googlesource.com/c/chromium/src/+/2315162 * Update Swiftshader revision * mac/arm64: When cross-building the snapshot, use page size of the target ISA instead of the host. https://chromium-review.googlesource.com/c/v8/v8/+/2310575 * Update patch indices * Rename {,Non}ClientView::CanClose() to OnWindowCloseRequested() https://chromium-review.googlesource.com/c/chromium/src/+/2247838 * chore: bump chromium in DEPS to e9465d70d1dea539400f0fddad43358ea3c31d71 * chore: bump chromium in DEPS to bd5b71c5f20288eb26068a39ae6e0579566a51c5 * chore: bump chromium in DEPS to 786ee543048bd07d07c5ac50b7dbbdd6bdd8dcce * chore: bump chromium in DEPS to 34eb6ecbf2c5894b648900bf771a2a29de204798 * chore: bump chromium in DEPS to 567ff038d68e3adb8116a01eec863cdf34d775f5 * chore: bump chromium in DEPS to 340b45c8d4ceb2dd61969fc34e1928d3c46db48c * chore: update patches * chore: base::DeleteFile with two params is removed Should use base::DeleteFile and base::DeletePathRecursively when appropriate Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2313376 * chore: add patch for NodePlatform::PostJob impl * chore: update patches * chore: extension file access is now instrumented Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2209995 * chore: implement SetWindowFrameInScreen in OSR RWHV Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2321409 * chore: NotifyUserActivation requires a type now This is just for a histogram thing and therefore it does not matter what we pass in Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2281303 * chore: update patches * chore: bump chromium in DEPS to cd570e6dd3dcb84463ac252b04e92ceb02d8400c * chore: update patches * chore: bump chromium in DEPS to 0187908a31866992b90c59719ac1d016328f6ee0 * chore: bump chromium in DEPS to 3c9df38c508f3dba26a75248beed4882ddfb98e9 * chore: bump chromium in DEPS to 1a47d3b9cee710bd3c958c4f2d8b205710df9d50 * chore: bump chromium in DEPS to baac93040d96abdab72d46dd034c60f86e108702 * chore: bump chromium in DEPS to 13836145f97299e636491de38064b78861c4fb2e * update patches * change OS_MACOSX -> OS_MAC Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1105907 * patch: add header for ToExecutionContext in WebMessagePortConverter * chore: bump chromium in DEPS to 91ab9b6ac5d04dc034a03ad847fbfa8261328c2b * update patches * NeedToFireBeforeUnloadOrUnload -> NeedToFireBeforeUnloadOrUnloadEvents Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2288711 * chore: bump chromium in DEPS to 290deb11f0e30cb1382fd8f8793d340560283c23 * update patches * add dragdrop header for autofill popup * int -> x11::Time * patch out accessibility private API use Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2330812 * remove usage of XEvent Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2317767 * trigger recalculation of WebPreferences before renderer initialization Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2263635 * chore: bump chromium in DEPS to 6bdb484583b99c96ef3388d0c2184326581b2d5a * chore: bump chromium in DEPS to 1eb2a79cde04fd5c8ae51b4d813e6521635269e5 * chore: bump chromium in DEPS to 3dc8e3c0f400e4ca9c0a63d7a39bd910997ad4c6 * chore: update patches * fixup! trigger recalculation of WebPreferences before renderer initialization * views: Make MenuButton and RadioButton default constructible https://chromium-review.googlesource.com/c/chromium/src/+/2339586 * chore: fix code style Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <sattard@slack-corp.com> Co-authored-by: Andy Locascio <andy@slack-corp.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-08-12 18:33:58 +00:00
base::DeletePathRecursively(temp_dir);
}
bool ElectronExtensionSystem::FinishDelayedInstallationIfReady(
const std::string& extension_id,
bool install_immediately) {
NOTREACHED();
return false;
}
void ElectronExtensionSystem::PerformActionBasedOnOmahaAttributes(
const std::string& extension_id,
const base::Value& attributes) {
NOTREACHED();
}
void ElectronExtensionSystem::OnExtensionRegisteredWithRequestContexts(
scoped_refptr<Extension> extension) {
ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_);
registry->AddReady(extension);
registry->TriggerOnReady(extension.get());
}
} // namespace extensions