chore: bump chromium to 107.0.5286.0 (main) (#35590)
* chore: bump chromium in DEPS to 107.0.5286.0 * 3866335: media: Rename KeySystemProperties to KeySystemInfo - file renaming3866335
* 3864686: [PA] Introduce *Scan buildflag3864686
* chore: fixup patch indices * 3849359: Remove unused PrefValueStore::Delegate3849359
* 3873005: [CodeHealth] Modernising extensions Tab utils3873005
* 3846595: Auto-select PipeWire target once selection is made3846595
* 3826169: [json-schema-compiler] Support abs::optional<bool>3826169
* fixup! Remove unused PrefValueStore::Delegate Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
parent
a0dbae72c8
commit
b0036ea43a
62 changed files with 164 additions and 265 deletions
|
@ -58,6 +58,7 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
|
|||
void OnSourceNameChanged(int index) override {}
|
||||
void OnSourceThumbnailChanged(int index) override {}
|
||||
void OnSourcePreviewChanged(size_t index) override {}
|
||||
void OnDelegatedSourceListSelection() override {}
|
||||
|
||||
private:
|
||||
void UpdateSourcesList(DesktopMediaList* list);
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "shell/browser/electron_download_manager_delegate.h"
|
||||
#include "shell/browser/electron_permission_manager.h"
|
||||
#include "shell/browser/net/resolve_proxy_helper.h"
|
||||
#include "shell/browser/pref_store_delegate.h"
|
||||
#include "shell/browser/protocol_registry.h"
|
||||
#include "shell/browser/special_storage_policy.h"
|
||||
#include "shell/browser/ui/inspectable_web_contents.h"
|
||||
|
@ -110,7 +109,8 @@ ElectronBrowserContext::browser_context_map() {
|
|||
ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
|
||||
bool in_memory,
|
||||
base::Value::Dict options)
|
||||
: storage_policy_(base::MakeRefCounted<SpecialStoragePolicy>()),
|
||||
: in_memory_pref_store_(new ValueMapPrefStore),
|
||||
storage_policy_(base::MakeRefCounted<SpecialStoragePolicy>()),
|
||||
protocol_registry_(base::WrapUnique(new ProtocolRegistry)),
|
||||
in_memory_(in_memory),
|
||||
ssl_config_(network::mojom::SSLConfig::New()) {
|
||||
|
@ -170,6 +170,7 @@ void ElectronBrowserContext::InitPrefs() {
|
|||
base::MakeRefCounted<JsonPrefStore>(prefs_path);
|
||||
pref_store->ReadPrefs(); // Synchronous.
|
||||
prefs_factory.set_user_prefs(pref_store);
|
||||
prefs_factory.set_command_line_prefs(in_memory_pref_store());
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
if (!in_memory_) {
|
||||
|
@ -210,10 +211,7 @@ void ElectronBrowserContext::InitPrefs() {
|
|||
language::LanguagePrefs::RegisterProfilePrefs(registry.get());
|
||||
#endif
|
||||
|
||||
prefs_ = prefs_factory.Create(
|
||||
registry.get(),
|
||||
std::make_unique<PrefStoreDelegate>(weak_factory_.GetWeakPtr()));
|
||||
prefs_->UpdateCommandLinePrefStore(new ValueMapPrefStore);
|
||||
prefs_ = prefs_factory.Create(registry.get());
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) || \
|
||||
BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
user_prefs::UserPrefs::Set(this, prefs_.get());
|
||||
|
|
|
@ -140,11 +140,8 @@ class ElectronBrowserContext : public content::BrowserContext {
|
|||
return cookie_change_notifier_.get();
|
||||
}
|
||||
PrefService* prefs() const { return prefs_.get(); }
|
||||
void set_in_memory_pref_store(ValueMapPrefStore* pref_store) {
|
||||
in_memory_pref_store_ = pref_store;
|
||||
}
|
||||
ValueMapPrefStore* in_memory_pref_store() const {
|
||||
return in_memory_pref_store_;
|
||||
return in_memory_pref_store_.get();
|
||||
}
|
||||
base::WeakPtr<ElectronBrowserContext> GetWeakPtr() {
|
||||
return weak_factory_.GetWeakPtr();
|
||||
|
@ -209,8 +206,7 @@ class ElectronBrowserContext : public content::BrowserContext {
|
|||
const base::Value* device_to_compare,
|
||||
blink::PermissionType permission_type);
|
||||
|
||||
ValueMapPrefStore* in_memory_pref_store_ = nullptr;
|
||||
|
||||
scoped_refptr<ValueMapPrefStore> in_memory_pref_store_;
|
||||
std::unique_ptr<content::ResourceContext> resource_context_;
|
||||
std::unique_ptr<CookieChangeNotifier> cookie_change_notifier_;
|
||||
std::unique_ptr<PrefService> prefs_;
|
||||
|
|
|
@ -221,8 +221,7 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() {
|
|||
// TODO(nornagon): in Chrome, the tab URL is only available to extensions
|
||||
// that have the "tabs" (or "activeTab") permission. We should do the same
|
||||
// permission check here.
|
||||
tab.url = std::make_unique<std::string>(
|
||||
contents->web_contents()->GetLastCommittedURL().spec());
|
||||
tab.url = contents->web_contents()->GetLastCommittedURL().spec();
|
||||
|
||||
tab.active = contents->IsFocused();
|
||||
|
||||
|
@ -438,7 +437,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
|
|||
|
||||
// Navigate the tab to a new location if the url is different.
|
||||
std::string error;
|
||||
if (params->update_properties.url.get()) {
|
||||
if (params->update_properties.url) {
|
||||
std::string updated_url = *params->update_properties.url;
|
||||
if (!UpdateURL(updated_url, tab_id, &error))
|
||||
return RespondNow(Error(std::move(error)));
|
||||
|
@ -506,8 +505,7 @@ ExtensionFunction::ResponseValue TabsUpdateFunction::GetResult() {
|
|||
// TODO(nornagon): in Chrome, the tab URL is only available to extensions
|
||||
// that have the "tabs" (or "activeTab") permission. We should do the same
|
||||
// permission check here.
|
||||
tab.url = std::make_unique<std::string>(
|
||||
web_contents_->GetLastCommittedURL().spec());
|
||||
tab.url = web_contents_->GetLastCommittedURL().spec();
|
||||
|
||||
return ArgumentList(tabs::Get::Results::Create(std::move(tab)));
|
||||
}
|
||||
|
|
|
@ -40,21 +40,20 @@ ElectronMessagingDelegate::IsNativeMessagingHostAllowed(
|
|||
return PolicyPermission::DISALLOW;
|
||||
}
|
||||
|
||||
std::unique_ptr<base::DictionaryValue>
|
||||
ElectronMessagingDelegate::MaybeGetTabInfo(content::WebContents* web_contents) {
|
||||
absl::optional<base::Value::Dict> ElectronMessagingDelegate::MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) {
|
||||
if (web_contents) {
|
||||
auto* api_contents = electron::api::WebContents::From(web_contents);
|
||||
if (api_contents) {
|
||||
api::tabs::Tab tab;
|
||||
tab.id = api_contents->ID();
|
||||
tab.url = std::make_unique<std::string>(api_contents->GetURL().spec());
|
||||
tab.title = std::make_unique<std::string>(
|
||||
base::UTF16ToUTF8(api_contents->GetTitle()));
|
||||
tab.url = api_contents->GetURL().spec();
|
||||
tab.title = base::UTF16ToUTF8(api_contents->GetTitle());
|
||||
tab.audible = api_contents->IsCurrentlyAudible();
|
||||
return tab.ToValue();
|
||||
return std::move(tab.ToValue()->GetDict());
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
content::WebContents* ElectronMessagingDelegate::GetWebContentsByTabId(
|
||||
|
|
|
@ -27,7 +27,7 @@ class ElectronMessagingDelegate : public MessagingDelegate {
|
|||
PolicyPermission IsNativeMessagingHostAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
const std::string& native_host_name) override;
|
||||
std::unique_ptr<base::DictionaryValue> MaybeGetTabInfo(
|
||||
absl::optional<base::Value::Dict> MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) override;
|
||||
content::WebContents* GetWebContentsByTabId(
|
||||
content::BrowserContext* browser_context,
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright (c) 2018 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/pref_store_delegate.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "components/prefs/persistent_pref_store.h"
|
||||
#include "components/prefs/pref_store.h"
|
||||
#include "components/prefs/value_map_pref_store.h"
|
||||
#include "shell/browser/electron_browser_context.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
PrefStoreDelegate::PrefStoreDelegate(
|
||||
base::WeakPtr<ElectronBrowserContext> browser_context)
|
||||
: browser_context_(std::move(browser_context)) {}
|
||||
|
||||
PrefStoreDelegate::~PrefStoreDelegate() {
|
||||
if (browser_context_)
|
||||
browser_context_->set_in_memory_pref_store(nullptr);
|
||||
}
|
||||
|
||||
void PrefStoreDelegate::UpdateCommandLinePrefStore(
|
||||
PrefStore* command_line_prefs) {
|
||||
if (browser_context_)
|
||||
browser_context_->set_in_memory_pref_store(
|
||||
static_cast<ValueMapPrefStore*>(command_line_prefs));
|
||||
}
|
||||
|
||||
} // namespace electron
|
|
@ -1,59 +0,0 @@
|
|||
// Copyright (c) 2018 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_
|
||||
#define ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "components/prefs/pref_value_store.h"
|
||||
|
||||
class PersistentPrefStore;
|
||||
class PrefNotifier;
|
||||
class PrefRegistry;
|
||||
class PrefStore;
|
||||
|
||||
namespace electron {
|
||||
|
||||
class ElectronBrowserContext;
|
||||
|
||||
// Retrieves handle to the in memory pref store that gets
|
||||
// initialized with the pref service.
|
||||
class PrefStoreDelegate : public PrefValueStore::Delegate {
|
||||
public:
|
||||
explicit PrefStoreDelegate(
|
||||
base::WeakPtr<ElectronBrowserContext> browser_context);
|
||||
~PrefStoreDelegate() override;
|
||||
|
||||
// disable copy
|
||||
PrefStoreDelegate(const PrefStoreDelegate&) = delete;
|
||||
PrefStoreDelegate& operator=(const PrefStoreDelegate&) = delete;
|
||||
|
||||
void Init(PrefStore* managed_prefs,
|
||||
PrefStore* supervised_user_prefs,
|
||||
PrefStore* extension_prefs,
|
||||
PrefStore* standalone_browser_prefs,
|
||||
PrefStore* command_line_prefs,
|
||||
PrefStore* user_prefs,
|
||||
PrefStore* recommended_prefs,
|
||||
PrefStore* default_prefs,
|
||||
PrefNotifier* pref_notifier) override {}
|
||||
|
||||
void InitIncognitoUserPrefs(
|
||||
scoped_refptr<PersistentPrefStore> incognito_user_prefs_overlay,
|
||||
scoped_refptr<PersistentPrefStore> incognito_user_prefs_underlay,
|
||||
const std::vector<const char*>& overlay_pref_names) override {}
|
||||
|
||||
void InitPrefRegistry(PrefRegistry* pref_registry) override {}
|
||||
|
||||
void UpdateCommandLinePrefStore(PrefStore* command_line_prefs) override;
|
||||
|
||||
private:
|
||||
base::WeakPtr<ElectronBrowserContext> browser_context_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_PREF_STORE_DELEGATE_H_
|
Loading…
Add table
Add a link
Reference in a new issue