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 entirely

3177328

* Make helper macros behave consistently for //content/public UserData types

3198788

* Enabling sandboxing for the speech recognition service browser tests

 3146090

* [devtools] Add 'RegisterPreference' host binding

  3162281

* [Reland][Extensions]: Add persistAcrossSessions flag (scripting API)

3175161

* [Bluetooth] Add Passkey prompt dialog for bonding.

2841104

* Clipboard: Remove ReadImage path in browser

3194826

* Split printing metafile code into its own target.

3164925

* Cleanup unused DesktopMediaListObserver params

3179203

* Remove base::DictionaryValue::GetBinary

3201974

* Window Placement: change RWHV::GetDisplayList to GetScreenInfos

3138774

* Add a preview to the Tab Capture picker dialog

3045268

* Add service-based usage to update print settings

3155426

* 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/geometry

3200392

* fixup Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry

* ozone: //chrome/browser clean up from USE_X11

3186490

* content: don't load v8 snapshot in browser process

3183394

* [devtools] Add 'RegisterPreference' host binding

  3162281

* 3186491: Add 'devtools.sync_preferences' preference

3186491

* 2951147: DCHECK accessible names for focusable Views

2951147

* 3201014: Use real font size for calculation of SmallTextRatio

3201014

* 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:
electron-roller[bot] 2021-10-21 11:51:36 -07:00 committed by GitHub
parent ed2aaed4bd
commit 87f7625c5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 806 additions and 2905 deletions

View file

@ -6,7 +6,7 @@
#include <memory>
#include "ui/gfx/skia_util.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace electron {

View file

@ -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

View file

@ -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);

View file

@ -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 =

View file

@ -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);