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

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