refactor: remove base::Value from WebContentsPreferences (#30193)

This commit is contained in:
Jeremy Rose 2021-07-26 09:04:09 -07:00 committed by GitHub
parent 64ba8feb93
commit 385d0f590f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 433 additions and 415 deletions

View file

@ -7,7 +7,6 @@
#include "shell/browser/web_contents_zoom_controller.h"
#include "shell/browser/web_view_manager.h"
#include "shell/common/gin_converters/content_converter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/node_includes.h"
#include "shell/common/options_switches.h"
@ -19,13 +18,13 @@ namespace {
void AddGuest(int guest_instance_id,
content::WebContents* embedder,
content::WebContents* guest_web_contents,
const base::DictionaryValue& options) {
const gin_helper::Dictionary& options) {
auto* manager = electron::WebViewManager::GetWebViewManager(embedder);
if (manager)
manager->AddGuest(guest_instance_id, embedder, guest_web_contents);
double zoom_factor;
if (options.GetDouble(electron::options::kZoomFactor, &zoom_factor)) {
if (options.Get(electron::options::kZoomFactor, &zoom_factor)) {
electron::WebContentsZoomController::FromWebContents(guest_web_contents)
->SetDefaultZoomFactor(zoom_factor);
}