chore: bump chromium to 96.0.4664.4 (main) (#31317)
* chore: bump chromium in DEPS to 96.0.4662.0 * chore: bump chromium in DEPS to 96.0.4663.0 * chore: update patches * [Extensions] Remove RuntimeData entirely3177328
* Make helper macros behave consistently for //content/public UserData types3198788
* Enabling sandboxing for the speech recognition service browser tests3146090
* [devtools] Add 'RegisterPreference' host binding3162281
* [Reland][Extensions]: Add persistAcrossSessions flag (scripting API)3175161
* [Bluetooth] Add Passkey prompt dialog for bonding.2841104
* Clipboard: Remove ReadImage path in browser3194826
* Split printing metafile code into its own target.3164925
* Cleanup unused DesktopMediaListObserver params3179203
* Remove base::DictionaryValue::GetBinary3201974
* Window Placement: change RWHV::GetDisplayList to GetScreenInfos3138774
* Add a preview to the Tab Capture picker dialog3045268
* Add service-based usage to update print settings3155426
* chore: bump chromium in DEPS to 96.0.4664.2 * chore: update patches * chore: bump chromium in DEPS to 96.0.4664.4 * chore: update patches * chore: bump chromium in DEPS to 97.0.4666.0 * Revert "chore: bump chromium in DEPS to 97.0.4666.0" This reverts commit d73caae8ba4b39efc9b3ea4de52685b9c92ef3d0. * Reland "Block external protocol handler with sandbox."3198263
* fixup for lint * Add CookiePartitionKeychain parameter to CookeManager.GetCookieList.3206016
* Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry3200392
* fixup Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry * ozone: //chrome/browser clean up from USE_X113186490
* content: don't load v8 snapshot in browser process3183394
* [devtools] Add 'RegisterPreference' host binding3162281
* 3186491: Add 'devtools.sync_preferences' preference3186491
* 2951147: DCHECK accessible names for focusable Views2951147
* 3201014: Use real font size for calculation of SmallTextRatio3201014
* fixup Clipboard: Remove ReadImage path in browser * chore: update patches * fix: disable PlzServiceWorker to fix custom protocol SW script loading Ref:3199761
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
ed2aaed4bd
commit
87f7625c5d
122 changed files with 806 additions and 2905 deletions
|
@ -249,6 +249,7 @@ v8::Local<v8::Promise> Cookies::Get(v8::Isolate* isolate,
|
|||
options.set_do_not_update_access_time();
|
||||
|
||||
manager->GetCookieList(GURL(url), options,
|
||||
net::CookiePartitionKeychain::Todo(),
|
||||
base::BindOnce(&FilterCookieWithStatuses,
|
||||
std::move(dict), std::move(promise)));
|
||||
}
|
||||
|
|
|
@ -50,13 +50,12 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
|
|||
~DesktopCapturer() override;
|
||||
|
||||
// DesktopMediaListObserver:
|
||||
void OnSourceAdded(DesktopMediaList* list, int index) override {}
|
||||
void OnSourceRemoved(DesktopMediaList* list, int index) override {}
|
||||
void OnSourceMoved(DesktopMediaList* list,
|
||||
int old_index,
|
||||
int new_index) override {}
|
||||
void OnSourceNameChanged(DesktopMediaList* list, int index) override {}
|
||||
void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override {}
|
||||
void OnSourceAdded(int index) override {}
|
||||
void OnSourceRemoved(int index) override {}
|
||||
void OnSourceMoved(int old_index, int new_index) override {}
|
||||
void OnSourceNameChanged(int index) override {}
|
||||
void OnSourceThumbnailChanged(int index) override {}
|
||||
void OnSourcePreviewChanged(size_t index) override {}
|
||||
|
||||
private:
|
||||
void UpdateSourcesList(DesktopMediaList* list);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "shell/browser/bluetooth/electron_bluetooth_delegate.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
|
@ -46,6 +47,14 @@ ElectronBluetoothDelegate::ShowBluetoothScanningPrompt(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void ElectronBluetoothDelegate::ShowDeviceCredentialsPrompt(
|
||||
content::RenderFrameHost* frame,
|
||||
const std::u16string& device_identifier,
|
||||
CredentialsCallback callback) {
|
||||
// TODO(jkleinsc) implement this
|
||||
std::move(callback).Run(DeviceCredentialsPromptResult::kCancelled, u"");
|
||||
}
|
||||
|
||||
WebBluetoothDeviceId ElectronBluetoothDelegate::GetWebBluetoothDeviceId(
|
||||
RenderFrameHost* frame,
|
||||
const std::string& device_address) {
|
||||
|
|
|
@ -52,6 +52,9 @@ class ElectronBluetoothDelegate : public content::BluetoothDelegate {
|
|||
content::RenderFrameHost* frame,
|
||||
const content::BluetoothScanningPrompt::EventHandler& event_handler)
|
||||
override;
|
||||
void ShowDeviceCredentialsPrompt(content::RenderFrameHost* frame,
|
||||
const std::u16string& device_identifier,
|
||||
CredentialsCallback callback) override;
|
||||
blink::WebBluetoothDeviceId GetWebBluetoothDeviceId(
|
||||
content::RenderFrameHost* frame,
|
||||
const std::string& device_address) override;
|
||||
|
|
|
@ -11,6 +11,6 @@ ChildWebContentsTracker::ChildWebContentsTracker(
|
|||
|
||||
ChildWebContentsTracker::~ChildWebContentsTracker() = default;
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(ChildWebContentsTracker)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(ChildWebContentsTracker);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -106,6 +106,6 @@ void AutofillDriverFactory::CloseAllPopups() {
|
|||
}
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(AutofillDriverFactory)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(AutofillDriverFactory);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -998,6 +998,7 @@ bool ElectronBrowserClient::HandleExternalProtocol(
|
|||
int frame_tree_node_id,
|
||||
content::NavigationUIData* navigation_data,
|
||||
bool is_main_frame,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
|
|
|
@ -243,6 +243,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
int frame_tree_node_id,
|
||||
content::NavigationUIData* navigation_data,
|
||||
bool is_main_frame,
|
||||
network::mojom::WebSandboxFlags sandbox_flags,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#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"
|
||||
#include "extensions/browser/user_script_manager.h"
|
||||
#include "extensions/common/constants.h"
|
||||
|
@ -96,8 +95,6 @@ void ElectronExtensionSystem::Shutdown() {
|
|||
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>();
|
||||
user_script_manager_ = std::make_unique<UserScriptManager>(browser_context_);
|
||||
app_sorting_ = std::make_unique<NullAppSorting>();
|
||||
|
@ -161,10 +158,6 @@ ExtensionService* ElectronExtensionSystem::extension_service() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RuntimeData* ElectronExtensionSystem::runtime_data() {
|
||||
return runtime_data_.get();
|
||||
}
|
||||
|
||||
ManagementPolicy* ElectronExtensionSystem::management_policy() {
|
||||
return management_policy_.get();
|
||||
}
|
||||
|
@ -185,6 +178,10 @@ StateStore* ElectronExtensionSystem::rules_store() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
StateStore* ElectronExtensionSystem::dynamic_user_scripts_store() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
scoped_refptr<value_store::ValueStoreFactory>
|
||||
ElectronExtensionSystem::store_factory() {
|
||||
return store_factory_;
|
||||
|
|
|
@ -59,12 +59,12 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
|||
// ExtensionSystem implementation:
|
||||
void InitForRegularProfile(bool extensions_enabled) override;
|
||||
ExtensionService* extension_service() override;
|
||||
RuntimeData* runtime_data() override;
|
||||
ManagementPolicy* management_policy() override;
|
||||
ServiceWorkerManager* service_worker_manager() override;
|
||||
UserScriptManager* user_script_manager() override;
|
||||
StateStore* state_store() override;
|
||||
StateStore* rules_store() override;
|
||||
StateStore* dynamic_user_scripts_store() override;
|
||||
scoped_refptr<value_store::ValueStoreFactory> store_factory() override;
|
||||
InfoMap* info_map() override;
|
||||
QuotaService* quota_service() override;
|
||||
|
@ -102,7 +102,6 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
|||
scoped_refptr<InfoMap> info_map_;
|
||||
|
||||
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
|
||||
std::unique_ptr<RuntimeData> runtime_data_;
|
||||
std::unique_ptr<QuotaService> quota_service_;
|
||||
std::unique_ptr<UserScriptManager> user_script_manager_;
|
||||
std::unique_ptr<AppSorting> app_sorting_;
|
||||
|
|
|
@ -22,6 +22,6 @@ void ElectronExtensionWebContentsObserver::CreateForWebContents(
|
|||
FromWebContents(web_contents)->Initialize();
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(ElectronExtensionWebContentsObserver)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(ElectronExtensionWebContentsObserver);
|
||||
|
||||
} // namespace extensions
|
||||
|
|
|
@ -32,6 +32,12 @@ void InitializeFeatureList() {
|
|||
disable_features +=
|
||||
std::string(",") + features::kSpareRendererForSitePerProcess.name;
|
||||
|
||||
// PlzServiceWorker breaks fetching service worker scripts for custom
|
||||
// protocols or chrome-extension protocols due to a change in the URL loader
|
||||
// used to fetch the script.
|
||||
// TODO(MarshallOfSound): Re-enable and fix?
|
||||
disable_features += std::string(",") + features::kPlzServiceWorker.name;
|
||||
|
||||
#if !BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
|
||||
disable_features += std::string(",") + media::kPictureInPicture.name;
|
||||
#endif
|
||||
|
|
|
@ -702,6 +702,6 @@ NativeWindowRelay::NativeWindowRelay(base::WeakPtr<NativeWindow> window)
|
|||
|
||||
NativeWindowRelay::~NativeWindowRelay() = default;
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(NativeWindowRelay)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(NativeWindowRelay);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -189,15 +189,11 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
|||
DCHECK(render_widget_host_);
|
||||
DCHECK(!render_widget_host_->GetView());
|
||||
|
||||
// Initialize a display struct as needed, to cache the scale factor.
|
||||
if (display_list_.displays().empty()) {
|
||||
display_list_ = display::DisplayList(
|
||||
{display::Display(display::kDefaultDisplayId)},
|
||||
display::kDefaultDisplayId, display::kDefaultDisplayId);
|
||||
// Initialize a screen_infos_ struct as needed, to cache the scale factor.
|
||||
if (screen_infos_.screen_infos.empty()) {
|
||||
UpdateScreenInfo();
|
||||
}
|
||||
display::Display current_display = display_list_.GetCurrentDisplay();
|
||||
current_display.set_device_scale_factor(kDefaultScaleFactor);
|
||||
display_list_.UpdateDisplay(current_display);
|
||||
screen_infos_.mutable_current().device_scale_factor = kDefaultScaleFactor;
|
||||
|
||||
delegated_frame_host_allocator_.GenerateId();
|
||||
delegated_frame_host_surface_id_ =
|
||||
|
@ -996,15 +992,11 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer(bool force) {
|
|||
float sf = GetCurrentDeviceScaleFactor();
|
||||
const bool scaleFactorDidChange = scaleFactor != sf;
|
||||
|
||||
// Initialize a display struct as needed, to cache the scale factor.
|
||||
if (display_list_.displays().empty()) {
|
||||
display_list_ = display::DisplayList(
|
||||
{display::Display(display::kDefaultDisplayId)},
|
||||
display::kDefaultDisplayId, display::kDefaultDisplayId);
|
||||
// Initialize a screen_infos_ struct as needed, to cache the scale factor.
|
||||
if (screen_infos_.screen_infos.empty()) {
|
||||
UpdateScreenInfo();
|
||||
}
|
||||
display::Display current_display = display_list_.GetCurrentDisplay();
|
||||
current_display.set_device_scale_factor(scaleFactor);
|
||||
display_list_.UpdateDisplay(current_display);
|
||||
screen_infos_.mutable_current().device_scale_factor = scaleFactor;
|
||||
|
||||
gfx::Size size;
|
||||
if (!IsPopupWidget())
|
||||
|
|
|
@ -269,6 +269,6 @@ void PrintPreviewMessageHandler::RejectPromise(int request_id) {
|
|||
promise.RejectWithErrorMessage("Failed to generate PDF");
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintPreviewMessageHandler)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintPreviewMessageHandler);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -45,6 +45,6 @@ void PrintViewManagerElectron::CheckForCancel(int32_t preview_ui_id,
|
|||
CheckForCancelCallback callback) {
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintViewManagerElectron)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintViewManagerElectron);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "ui/gfx/skia_util.h"
|
||||
#include "ui/gfx/geometry/skia_conversions.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
|
|
@ -86,6 +86,13 @@ const char kChromeUIDevToolsRemoteFrontendPath[] = "serve_file";
|
|||
const char kDevToolsBoundsPref[] = "electron.devtools.bounds";
|
||||
const char kDevToolsZoomPref[] = "electron.devtools.zoom";
|
||||
const char kDevToolsPreferences[] = "electron.devtools.preferences";
|
||||
const char kDevToolsSyncPreferences[] = "electron.devtools.sync_preferences";
|
||||
const char kDevToolsSyncedPreferencesSyncEnabled[] =
|
||||
"electron.devtools.synced_preferences_sync_enabled";
|
||||
const char kDevToolsSyncedPreferencesSyncDisabled[] =
|
||||
"electron.devtools.synced_preferences_sync_disabled";
|
||||
const char kSyncDevToolsPreferencesFrontendName[] = "electron.sync_preferences";
|
||||
const bool kSyncDevToolsPreferencesDefault = false;
|
||||
|
||||
const char kFrontendHostId[] = "id";
|
||||
const char kFrontendHostMethod[] = "method";
|
||||
|
@ -336,6 +343,10 @@ void InspectableWebContents::RegisterPrefs(PrefRegistrySimple* registry) {
|
|||
RectToDictionary(gfx::Rect(0, 0, 800, 600)));
|
||||
registry->RegisterDoublePref(kDevToolsZoomPref, 0.);
|
||||
registry->RegisterDictionaryPref(kDevToolsPreferences);
|
||||
registry->RegisterDictionaryPref(kDevToolsSyncedPreferencesSyncEnabled);
|
||||
registry->RegisterDictionaryPref(kDevToolsSyncedPreferencesSyncDisabled);
|
||||
registry->RegisterBooleanPref(kDevToolsSyncPreferences,
|
||||
kSyncDevToolsPreferencesDefault);
|
||||
}
|
||||
|
||||
InspectableWebContents::InspectableWebContents(
|
||||
|
@ -854,26 +865,93 @@ void InspectableWebContents::SendJsonRequest(DispatchCallback callback,
|
|||
std::move(callback).Run(nullptr);
|
||||
}
|
||||
|
||||
void InspectableWebContents::RegisterPreference(
|
||||
const std::string& name,
|
||||
const RegisterOptions& options) {
|
||||
// kSyncDevToolsPreferenceFrontendName is not stored in any of the relevant
|
||||
// dictionaries. Skip registration.
|
||||
if (name == kSyncDevToolsPreferencesFrontendName)
|
||||
return;
|
||||
|
||||
if (options.sync_mode == RegisterOptions::SyncMode::kSync) {
|
||||
synced_setting_names_.insert(name);
|
||||
}
|
||||
|
||||
// Setting might have had a different sync status in the past. Move the
|
||||
// setting to the correct dictionary.
|
||||
const char* dictionary_to_remove_from =
|
||||
options.sync_mode == RegisterOptions::SyncMode::kSync
|
||||
? kDevToolsPreferences
|
||||
: GetDictionaryNameForSyncedPrefs();
|
||||
const std::string* settings_value =
|
||||
pref_service_->GetDictionary(dictionary_to_remove_from)
|
||||
->FindStringKey(name);
|
||||
if (!settings_value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const char* dictionary_to_insert_into =
|
||||
GetDictionaryNameForSettingsName(name);
|
||||
// Settings already moved to the synced dictionary on a different device have
|
||||
// precedence.
|
||||
const std::string* already_synced_value =
|
||||
pref_service_->GetDictionary(dictionary_to_insert_into)
|
||||
->FindStringKey(name);
|
||||
if (dictionary_to_insert_into == kDevToolsPreferences ||
|
||||
!already_synced_value) {
|
||||
DictionaryPrefUpdate insert_update(pref_service_,
|
||||
dictionary_to_insert_into);
|
||||
insert_update.Get()->SetKey(name, base::Value(*settings_value));
|
||||
}
|
||||
|
||||
DictionaryPrefUpdate remove_update(pref_service_, dictionary_to_remove_from);
|
||||
remove_update.Get()->RemoveKey(name);
|
||||
}
|
||||
|
||||
void InspectableWebContents::GetPreferences(DispatchCallback callback) {
|
||||
const base::DictionaryValue* prefs =
|
||||
pref_service_->GetDictionary(kDevToolsPreferences);
|
||||
std::move(callback).Run(prefs);
|
||||
base::Value settings(base::Value::Type::DICTIONARY);
|
||||
settings.SetBoolKey(kSyncDevToolsPreferencesFrontendName,
|
||||
pref_service_->GetBoolean(kDevToolsSyncPreferences));
|
||||
settings.MergeDictionary(pref_service_->GetDictionary(kDevToolsPreferences));
|
||||
settings.MergeDictionary(
|
||||
pref_service_->GetDictionary(GetDictionaryNameForSyncedPrefs()));
|
||||
|
||||
std::move(callback).Run(&settings);
|
||||
}
|
||||
|
||||
void InspectableWebContents::SetPreference(const std::string& name,
|
||||
const std::string& value) {
|
||||
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
||||
if (name == kSyncDevToolsPreferencesFrontendName) {
|
||||
pref_service_->SetBoolean(kDevToolsSyncPreferences, value == "true");
|
||||
return;
|
||||
}
|
||||
DictionaryPrefUpdate update(pref_service_,
|
||||
GetDictionaryNameForSettingsName(name));
|
||||
update.Get()->SetKey(name, base::Value(value));
|
||||
}
|
||||
|
||||
void InspectableWebContents::RemovePreference(const std::string& name) {
|
||||
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
||||
if (name == kSyncDevToolsPreferencesFrontendName) {
|
||||
pref_service_->SetBoolean(kDevToolsSyncPreferences,
|
||||
kSyncDevToolsPreferencesDefault);
|
||||
return;
|
||||
}
|
||||
DictionaryPrefUpdate update(pref_service_,
|
||||
GetDictionaryNameForSettingsName(name));
|
||||
update.Get()->RemoveKey(name);
|
||||
}
|
||||
|
||||
void InspectableWebContents::ClearPreferences() {
|
||||
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
||||
update.Get()->Clear();
|
||||
pref_service_->SetBoolean(kDevToolsSyncPreferences,
|
||||
kSyncDevToolsPreferencesDefault);
|
||||
DictionaryPrefUpdate unsynced_update(pref_service_, kDevToolsPreferences);
|
||||
unsynced_update.Get()->Clear();
|
||||
DictionaryPrefUpdate sync_enabled_update(
|
||||
pref_service_, kDevToolsSyncedPreferencesSyncEnabled);
|
||||
sync_enabled_update.Get()->Clear();
|
||||
DictionaryPrefUpdate sync_disabled_update(
|
||||
pref_service_, kDevToolsSyncedPreferencesSyncDisabled);
|
||||
sync_disabled_update.Get()->Clear();
|
||||
}
|
||||
|
||||
void InspectableWebContents::ConnectionReady() {}
|
||||
|
@ -1055,4 +1133,18 @@ void InspectableWebContents::SendMessageAck(int request_id,
|
|||
CallClientFunction("DevToolsAPI.embedderMessageAck", &id_value, arg, nullptr);
|
||||
}
|
||||
|
||||
const char* InspectableWebContents::GetDictionaryNameForSettingsName(
|
||||
const std::string& name) const {
|
||||
return synced_setting_names_.contains(name)
|
||||
? kDevToolsSyncedPreferencesSyncEnabled
|
||||
: kDevToolsPreferences;
|
||||
}
|
||||
|
||||
const char* InspectableWebContents::GetDictionaryNameForSyncedPrefs() const {
|
||||
const bool isDevToolsSyncEnabled =
|
||||
pref_service_->GetBoolean(kDevToolsSyncPreferences);
|
||||
return isDevToolsSyncEnabled ? kDevToolsSyncedPreferencesSyncEnabled
|
||||
: kDevToolsSyncedPreferencesSyncDisabled;
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "base/memory/weak_ptr.h"
|
||||
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
|
||||
#include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h"
|
||||
#include "chrome/browser/devtools/devtools_settings.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
#include "content/public/browser/devtools_frontend_host.h"
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
|
@ -27,6 +28,7 @@
|
|||
|
||||
class PrefService;
|
||||
class PrefRegistrySimple;
|
||||
struct RegisterOptions;
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -133,6 +135,8 @@ class InspectableWebContents
|
|||
void SendJsonRequest(DispatchCallback callback,
|
||||
const std::string& browser_id,
|
||||
const std::string& url) override;
|
||||
void RegisterPreference(const std::string& name,
|
||||
const RegisterOptions& options) override;
|
||||
void GetPreferences(DispatchCallback callback) override;
|
||||
void SetPreference(const std::string& name,
|
||||
const std::string& value) override;
|
||||
|
@ -187,6 +191,9 @@ class InspectableWebContents
|
|||
|
||||
void SendMessageAck(int request_id, const base::Value* arg1);
|
||||
|
||||
const char* GetDictionaryNameForSettingsName(const std::string& name) const;
|
||||
const char* GetDictionaryNameForSyncedPrefs() const;
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
void AddDevToolsExtensionsToClient();
|
||||
#endif
|
||||
|
@ -225,6 +232,11 @@ class InspectableWebContents
|
|||
using ExtensionsAPIs = std::map<std::string, std::string>;
|
||||
ExtensionsAPIs extensions_api_;
|
||||
|
||||
// Contains the set of synced settings.
|
||||
// The DevTools frontend *must* call `Register` for each setting prior to
|
||||
// use, which guarantees that this set must not be persisted.
|
||||
base::flat_set<std::string> synced_setting_names_;
|
||||
|
||||
base::WeakPtrFactory<InspectableWebContents> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InspectableWebContents);
|
||||
|
|
|
@ -122,6 +122,11 @@ void MenuBar::OnWindowFocus() {
|
|||
SetAcceleratorVisibility(pane_has_focus());
|
||||
}
|
||||
|
||||
void MenuBar::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
node_data->SetNameExplicitlyEmpty();
|
||||
node_data->role = ax::mojom::Role::kMenuBar;
|
||||
}
|
||||
|
||||
bool MenuBar::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
||||
// Treat pressing Alt the same as pressing Esc.
|
||||
const ui::Accelerator& translated =
|
||||
|
|
|
@ -65,6 +65,7 @@ class MenuBar : public views::AccessiblePaneView,
|
|||
|
||||
// views::View:
|
||||
const char* GetClassName() const override;
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
|
||||
void ButtonPressed(int id, const ui::Event& event);
|
||||
|
||||
|
|
|
@ -235,6 +235,6 @@ void WebContentsPermissionHelper::GrantHIDDevicePermission(
|
|||
&device, render_frame_host);
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsPermissionHelper)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsPermissionHelper);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -513,6 +513,6 @@ void WebContentsPreferences::OverrideWebkitPrefs(
|
|||
prefs->v8_cache_options = v8_cache_options_;
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsPreferences)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsPreferences);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -280,6 +280,6 @@ void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded(
|
|||
SetZoomLevel(zoom_level);
|
||||
}
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsZoomController)
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsZoomController);
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "third_party/skia/include/core/SkPixmap.h"
|
||||
#include "ui/base/clipboard/clipboard_format_type.h"
|
||||
#include "ui/base/clipboard/scoped_clipboard_writer.h"
|
||||
#include "ui/gfx/codec/png_codec.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -198,12 +199,15 @@ void Clipboard::WriteBookmark(const std::u16string& title,
|
|||
gfx::Image Clipboard::ReadImage(gin_helper::Arguments* args) {
|
||||
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
||||
absl::optional<gfx::Image> image;
|
||||
clipboard->ReadImage(
|
||||
clipboard->ReadPng(
|
||||
GetClipboardBuffer(args),
|
||||
/* data_dst = */ nullptr,
|
||||
base::BindOnce(
|
||||
[](absl::optional<gfx::Image>* image, const SkBitmap& result) {
|
||||
image->emplace(gfx::Image::CreateFrom1xBitmap(result));
|
||||
[](absl::optional<gfx::Image>* image,
|
||||
const std::vector<uint8_t>& result) {
|
||||
SkBitmap bitmap;
|
||||
gfx::PNGCodec::Decode(result.data(), result.size(), &bitmap);
|
||||
image->emplace(gfx::Image::CreateFrom1xBitmap(bitmap));
|
||||
},
|
||||
&image));
|
||||
DCHECK(image.has_value());
|
||||
|
|
|
@ -324,11 +324,9 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
|||
return false;
|
||||
dict->GetString("type", &type);
|
||||
if (type == "rawData") {
|
||||
base::Value* bytes = nullptr;
|
||||
dict->GetBinary("bytes", &bytes);
|
||||
(*out)->AppendBytes(
|
||||
reinterpret_cast<const char*>(bytes->GetBlob().data()),
|
||||
base::checked_cast<int>(bytes->GetBlob().size()));
|
||||
const base::Value::BlobStorage* bytes = dict->FindBlobKey("bytes");
|
||||
(*out)->AppendBytes(reinterpret_cast<const char*>(bytes->data()),
|
||||
base::checked_cast<int>(bytes->size()));
|
||||
} else if (type == "file") {
|
||||
const std::string* file = dict->FindStringKey("filePath");
|
||||
if (file == nullptr) {
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
#include "components/printing/renderer/print_render_frame_helper.h"
|
||||
#include "printing/print_settings.h" // nogncheck
|
||||
#include "printing/metafile_agent.h" // nogncheck
|
||||
#include "shell/renderer/printing/print_render_frame_helper_delegate.h"
|
||||
#endif // BUILDFLAG(ENABLE_PRINTING)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue