mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
fix: base::Value::Dict -> base::DictValue
https://chromium-review.googlesource.com/c/chromium/src/+/7513889
This commit is contained in:
@@ -68,7 +68,7 @@ index f91857eb0b6ad385721b8224100de26dfdd7dd8d..45e8766fcb8d46d8edc3bf8d21d3f826
|
||||
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
|
||||
}
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index aa79c324af2cec50019bca3bccff5d420fb30ffd..3bba39372750b3e3efd1c5a4747f41415ae3ede7 100644
|
||||
index aa79c324af2cec50019bca3bccff5d420fb30ffd..eb76ee91743236d05c3a70a54d5345a705b5d994 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -80,6 +80,20 @@ namespace printing {
|
||||
@@ -153,7 +153,7 @@ index aa79c324af2cec50019bca3bccff5d420fb30ffd..3bba39372750b3e3efd1c5a4747f4141
|
||||
|
||||
-bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
+bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh,
|
||||
+ base::Value::Dict settings,
|
||||
+ base::DictValue settings,
|
||||
+ CompletionCallback callback) {
|
||||
if (!StartPrintCommon(rfh)) {
|
||||
return false;
|
||||
@@ -497,7 +497,7 @@ index aa79c324af2cec50019bca3bccff5d420fb30ffd..3bba39372750b3e3efd1c5a4747f4141
|
||||
scoped_refptr<base::RefCountedMemory> print_data,
|
||||
const gfx::Size& page_size,
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index cdd25ff24507cc49684454820c7d385b8c67259e..85b80282902b17aad49d4ffe40fddb1a0125d4ef 100644
|
||||
index cdd25ff24507cc49684454820c7d385b8c67259e..d4dc7e8e0cd604a6418f76e2e387985d847ce0be 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -46,6 +46,8 @@ namespace printing {
|
||||
@@ -515,7 +515,7 @@ index cdd25ff24507cc49684454820c7d385b8c67259e..85b80282902b17aad49d4ffe40fddb1a
|
||||
// this function. Returns false if printing is impossible at the moment.
|
||||
- virtual bool PrintNow(content::RenderFrameHost* rfh);
|
||||
+ virtual bool PrintNow(content::RenderFrameHost* rfh,
|
||||
+ base::Value::Dict settings = {},
|
||||
+ base::DictValue settings = {},
|
||||
+ CompletionCallback callback = {});
|
||||
|
||||
// Like PrintNow(), but for the node under the context menu, instead of the
|
||||
@@ -666,7 +666,7 @@ index ac2f719be566020d9f41364560c12e6d6d0fe3d8..16d758a6936f66148a196761cfb875f6
|
||||
PrintingFailed(int32 cookie, PrintFailureReason reason);
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cbdd9c46ec 100644
|
||||
index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..1320f3b10b07b2cee90f39f406604176c7575796 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -54,6 +54,7 @@
|
||||
@@ -690,7 +690,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
|
||||
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
|
||||
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
|
||||
+ base::Value::Dict());
|
||||
+ base::DictValue());
|
||||
if (!weak_this) {
|
||||
return;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
|
||||
-void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
- PrintRequestedPagesInternal(/*already_notified_frame=*/false);
|
||||
+void PrintRenderFrameHelper::PrintRequestedPages(base::Value::Dict settings) {
|
||||
+void PrintRenderFrameHelper::PrintRequestedPages(base::DictValue settings) {
|
||||
+ PrintRequestedPagesInternal(/*already_notified_frame=*/false,
|
||||
+ std::move(settings));
|
||||
}
|
||||
@@ -708,7 +708,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
void PrintRenderFrameHelper::PrintRequestedPagesInternal(
|
||||
- bool already_notified_frame) {
|
||||
+ bool already_notified_frame,
|
||||
+ base::Value::Dict settings) {
|
||||
+ base::DictValue settings) {
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) {
|
||||
return;
|
||||
@@ -750,7 +750,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type) {
|
||||
+ PrintRequestType print_request_type,
|
||||
+ base::Value::Dict settings) {
|
||||
+ base::DictValue settings) {
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -796,7 +796,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
|
||||
- const blink::WebNode& node) {
|
||||
+ const blink::WebNode& node,
|
||||
+ base::Value::Dict new_settings) {
|
||||
+ base::DictValue new_settings) {
|
||||
// Reset to default values.
|
||||
ignore_css_margins_ = false;
|
||||
|
||||
@@ -844,7 +844,7 @@ index 60b5e83a8bc1ed07970be4cdfdc19962698bd754..23db93ae0528d96b8be14bbbb64483cb
|
||||
}
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..eb7982ac4fcba9b40cbff83ebe71e42493c97fba 100644
|
||||
index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..116939ffd857354ab1bfab472b292cfedd99dcba 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -258,7 +258,7 @@ class PrintRenderFrameHelper
|
||||
@@ -852,7 +852,7 @@ index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..eb7982ac4fcba9b40cbff83ebe71e424
|
||||
|
||||
// printing::mojom::PrintRenderFrame:
|
||||
- void PrintRequestedPages() override;
|
||||
+ void PrintRequestedPages(base::Value::Dict settings) override;
|
||||
+ void PrintRequestedPages(base::DictValue settings) override;
|
||||
void PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -862,7 +862,7 @@ index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..eb7982ac4fcba9b40cbff83ebe71e424
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type);
|
||||
+ PrintRequestType print_request_type,
|
||||
+ base::Value::Dict settings = {});
|
||||
+ base::DictValue settings = {});
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -872,7 +872,7 @@ index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..eb7982ac4fcba9b40cbff83ebe71e424
|
||||
bool InitPrintSettings(blink::WebLocalFrame* frame,
|
||||
- const blink::WebNode& node);
|
||||
+ const blink::WebNode& node,
|
||||
+ base::Value::Dict new_settings);
|
||||
+ base::DictValue new_settings);
|
||||
|
||||
// Calculate number of pages in source document.
|
||||
uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
@@ -882,7 +882,7 @@ index 8b4cea7d43fe16d7414e017b11ee1cda722e1a8d..eb7982ac4fcba9b40cbff83ebe71e424
|
||||
void SetupOnStopLoadingTimeout();
|
||||
- void PrintRequestedPagesInternal(bool already_notified_frame);
|
||||
+ void PrintRequestedPagesInternal(bool already_notified_frame,
|
||||
+ base::Value::Dict settings);
|
||||
+ base::DictValue settings);
|
||||
|
||||
ScriptingThrottler scripting_throttler_;
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) {
|
||||
net::ScopedCERTCertificateList imported_certs;
|
||||
int rv = -1;
|
||||
|
||||
if (const base::Value::Dict* dict = options.GetIfDict(); dict != nullptr) {
|
||||
if (const base::DictValue* dict = options.GetIfDict(); dict != nullptr) {
|
||||
if (const std::string* str = dict->FindString("certificate"); str)
|
||||
cert_path = *str;
|
||||
|
||||
@@ -611,7 +611,7 @@ void App::OnWillFinishLaunching() {
|
||||
Emit("will-finish-launching");
|
||||
}
|
||||
|
||||
void App::OnFinishLaunching(base::Value::Dict launch_info) {
|
||||
void App::OnFinishLaunching(base::DictValue launch_info) {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Set the application name for audio streams shown in external
|
||||
// applications. Only affects pulseaudio currently.
|
||||
@@ -662,8 +662,8 @@ void App::OnDidFailToContinueUserActivity(const std::string& type,
|
||||
|
||||
void App::OnContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) {
|
||||
if (Emit("continue-activity", type, base::Value(std::move(user_info)),
|
||||
base::Value(std::move(details)))) {
|
||||
*prevent_default = true;
|
||||
@@ -671,13 +671,13 @@ void App::OnContinueUserActivity(bool* prevent_default,
|
||||
}
|
||||
|
||||
void App::OnUserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
Emit("activity-was-continued", type, base::Value(std::move(user_info)));
|
||||
}
|
||||
|
||||
void App::OnUpdateUserActivityState(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
if (Emit("update-activity-state", type, base::Value(std::move(user_info)))) {
|
||||
*prevent_default = true;
|
||||
}
|
||||
@@ -1584,7 +1584,7 @@ v8::Local<v8::Promise> App::SetProxy(gin::Arguments* args) {
|
||||
return handle;
|
||||
}
|
||||
|
||||
base::Value::Dict proxy_config;
|
||||
base::DictValue proxy_config;
|
||||
switch (proxy_mode) {
|
||||
case ProxyPrefs::MODE_DIRECT:
|
||||
proxy_config = ProxyConfigDictionary::CreateDirect();
|
||||
|
||||
@@ -106,7 +106,7 @@ class App final : public gin::Wrappable<App>,
|
||||
void OnOpenURL(const std::string& url) override;
|
||||
void OnActivate(bool has_visible_windows) override;
|
||||
void OnWillFinishLaunching() override;
|
||||
void OnFinishLaunching(base::Value::Dict launch_info) override;
|
||||
void OnFinishLaunching(base::DictValue launch_info) override;
|
||||
void OnAccessibilitySupportChanged() override;
|
||||
void OnPreMainMessageLoopRun() override;
|
||||
void OnPreCreateThreads() override;
|
||||
@@ -117,13 +117,13 @@ class App final : public gin::Wrappable<App>,
|
||||
const std::string& error) override;
|
||||
void OnContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) override;
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) override;
|
||||
void OnUserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) override;
|
||||
base::DictValue user_info) override;
|
||||
void OnUpdateUserActivityState(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info) override;
|
||||
base::DictValue user_info) override;
|
||||
void OnNewWindowForTab() override;
|
||||
void OnDidBecomeActive() override;
|
||||
void OnDidResignActive() override;
|
||||
|
||||
@@ -333,7 +333,7 @@ void BaseWindow::OnExecuteAppCommand(const std::string_view command_name) {
|
||||
}
|
||||
|
||||
void BaseWindow::OnTouchBarItemResult(const std::string& item_id,
|
||||
const base::Value::Dict& details) {
|
||||
const base::DictValue& details) {
|
||||
Emit("-touch-bar-interaction", item_id, details);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
void OnWindowAlwaysOnTopChanged() override;
|
||||
void OnExecuteAppCommand(std::string_view command_name) override;
|
||||
void OnTouchBarItemResult(const std::string& item_id,
|
||||
const base::Value::Dict& details) override;
|
||||
const base::DictValue& details) override;
|
||||
void OnNewWindowForTab() override;
|
||||
void OnSystemContextMenu(int x, int y, bool* prevent_default) override;
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
|
||||
@@ -45,7 +45,7 @@ struct Converter<base::trace_event::TraceConfig> {
|
||||
}
|
||||
}
|
||||
|
||||
base::Value::Dict memory_dump_config;
|
||||
base::DictValue memory_dump_config;
|
||||
if (ConvertFromV8(isolate, val, &memory_dump_config)) {
|
||||
*out = base::trace_event::TraceConfig(std::move(memory_dump_config));
|
||||
return true;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace electron::api {
|
||||
namespace {
|
||||
|
||||
// Returns whether |cookie| matches |filter|.
|
||||
bool MatchesCookie(const base::Value::Dict& filter,
|
||||
bool MatchesCookie(const base::DictValue& filter,
|
||||
const net::CanonicalCookie& cookie) {
|
||||
const std::string* str;
|
||||
if ((str = filter.FindString("name")) && *str != cookie.Name())
|
||||
@@ -125,7 +125,7 @@ bool MatchesCookie(const base::Value::Dict& filter,
|
||||
}
|
||||
|
||||
// Remove cookies from |list| not matching |filter|, and pass it to |callback|.
|
||||
void FilterCookies(base::Value::Dict filter,
|
||||
void FilterCookies(base::DictValue filter,
|
||||
gin_helper::Promise<net::CookieList> promise,
|
||||
const net::CookieList& cookies) {
|
||||
net::CookieList result;
|
||||
@@ -137,7 +137,7 @@ void FilterCookies(base::Value::Dict filter,
|
||||
}
|
||||
|
||||
void FilterCookieWithStatuses(
|
||||
base::Value::Dict filter,
|
||||
base::DictValue filter,
|
||||
gin_helper::Promise<net::CookieList> promise,
|
||||
const net::CookieAccessResultList& list,
|
||||
const net::CookieAccessResultList& excluded_list) {
|
||||
@@ -294,7 +294,7 @@ v8::Local<v8::Promise> Cookies::Get(v8::Isolate* isolate,
|
||||
auto* storage_partition = browser_context_->GetDefaultStoragePartition();
|
||||
auto* manager = storage_partition->GetCookieManagerForBrowserProcess();
|
||||
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
gin::ConvertFromV8(isolate, filter.GetHandle(), &dict);
|
||||
|
||||
std::string url;
|
||||
@@ -343,7 +343,7 @@ v8::Local<v8::Promise> Cookies::Remove(v8::Isolate* isolate,
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue details) {
|
||||
gin_helper::Promise<void> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class Cookies final : public gin_helper::DeprecatedWrappable<Cookies>,
|
||||
|
||||
v8::Local<v8::Promise> Get(v8::Isolate*,
|
||||
const gin_helper::Dictionary& filter);
|
||||
v8::Local<v8::Promise> Set(v8::Isolate*, base::Value::Dict details);
|
||||
v8::Local<v8::Promise> Set(v8::Isolate*, base::DictValue details);
|
||||
v8::Local<v8::Promise> Remove(v8::Isolate*,
|
||||
const GURL& url,
|
||||
const std::string& name);
|
||||
|
||||
@@ -53,31 +53,31 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
|
||||
message_str, base::JSON_REPLACE_INVALID_CHARACTERS);
|
||||
if (!parsed_message || !parsed_message->is_dict())
|
||||
return;
|
||||
base::Value::Dict& dict = parsed_message->GetDict();
|
||||
base::DictValue& dict = parsed_message->GetDict();
|
||||
std::optional<int> id = dict.FindInt("id");
|
||||
if (!id) {
|
||||
std::string* method = dict.FindString("method");
|
||||
if (!method)
|
||||
return;
|
||||
std::string* session_id = dict.FindString("sessionId");
|
||||
base::Value::Dict* params = dict.FindDict("params");
|
||||
Emit("message", *method, params ? std::move(*params) : base::Value::Dict(),
|
||||
base::DictValue* params = dict.FindDict("params");
|
||||
Emit("message", *method, params ? std::move(*params) : base::DictValue(),
|
||||
session_id ? *session_id : "");
|
||||
} else {
|
||||
auto it = pending_requests_.find(*id);
|
||||
if (it == pending_requests_.end())
|
||||
return;
|
||||
|
||||
gin_helper::Promise<base::Value::Dict> promise = std::move(it->second);
|
||||
gin_helper::Promise<base::DictValue> promise = std::move(it->second);
|
||||
pending_requests_.erase(it);
|
||||
|
||||
base::Value::Dict* error = dict.FindDict("error");
|
||||
base::DictValue* error = dict.FindDict("error");
|
||||
if (error) {
|
||||
std::string* error_message = error->FindString("message");
|
||||
promise.RejectWithErrorMessage(error_message ? *error_message : "");
|
||||
} else {
|
||||
base::Value::Dict* result = dict.FindDict("result");
|
||||
promise.Resolve(result ? std::move(*result) : base::Value::Dict());
|
||||
base::DictValue* result = dict.FindDict("result");
|
||||
promise.Resolve(result ? std::move(*result) : base::DictValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void Debugger::Detach() {
|
||||
|
||||
v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
|
||||
v8::Isolate* isolate = args->isolate();
|
||||
gin_helper::Promise<base::Value::Dict> promise(isolate);
|
||||
gin_helper::Promise<base::DictValue> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
if (!agent_host_) {
|
||||
@@ -146,7 +146,7 @@ v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
|
||||
return handle;
|
||||
}
|
||||
|
||||
base::Value::Dict command_params;
|
||||
base::DictValue command_params;
|
||||
args->GetNext(&command_params);
|
||||
|
||||
std::string session_id;
|
||||
@@ -155,7 +155,7 @@ v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
|
||||
return handle;
|
||||
}
|
||||
|
||||
base::Value::Dict request;
|
||||
base::DictValue request;
|
||||
int request_id = ++previous_request_id_;
|
||||
pending_requests_.emplace(request_id, std::move(promise));
|
||||
request.Set("id", request_id);
|
||||
|
||||
@@ -68,8 +68,7 @@ class Debugger final : public gin::Wrappable<Debugger>,
|
||||
content::RenderFrameHost* new_rfh) override;
|
||||
|
||||
private:
|
||||
using PendingRequestMap =
|
||||
std::map<int, gin_helper::Promise<base::Value::Dict>>;
|
||||
using PendingRequestMap = std::map<int, gin_helper::Promise<base::DictValue>>;
|
||||
|
||||
void Attach(gin::Arguments* args);
|
||||
bool IsAttached();
|
||||
|
||||
@@ -133,7 +133,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
||||
auto command_line_string =
|
||||
base::CommandLine::ForCurrentProcess()->GetCommandLineString();
|
||||
auto channel_string = std::string("Electron " ELECTRON_VERSION);
|
||||
base::Value::Dict custom_constants = net_log::GetPlatformConstantsForNetLog(
|
||||
base::DictValue custom_constants = net_log::GetPlatformConstantsForNetLog(
|
||||
command_line_string, channel_string);
|
||||
|
||||
auto* network_context =
|
||||
@@ -155,7 +155,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
||||
|
||||
void NetLog::StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
|
||||
uint64_t max_file_size,
|
||||
base::Value::Dict custom_constants,
|
||||
base::DictValue custom_constants,
|
||||
base::File output_file) {
|
||||
if (!net_log_exporter_) {
|
||||
// Theoretically the mojo pipe could have been closed by the time we get
|
||||
@@ -206,7 +206,7 @@ v8::Local<v8::Promise> NetLog::StopLogging(v8::Isolate* const isolate) {
|
||||
// pointer lives long enough to resolve the promise. Moving it into the
|
||||
// callback will cause the instance variable to become empty.
|
||||
net_log_exporter_->Stop(
|
||||
base::Value::Dict(),
|
||||
base::DictValue(),
|
||||
base::BindOnce(
|
||||
[](mojo::Remote<network::mojom::NetLogExporter>,
|
||||
gin_helper::Promise<void> promise, int32_t error) {
|
||||
|
||||
@@ -67,7 +67,7 @@ class NetLog final : public gin::Wrappable<NetLog> {
|
||||
|
||||
void StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
|
||||
uint64_t max_file_size,
|
||||
base::Value::Dict custom_constants,
|
||||
base::DictValue custom_constants,
|
||||
base::File output_file);
|
||||
void NetLogStarted(int32_t error);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class PushNotifications final
|
||||
PushNotifications& operator=(const PushNotifications&) = delete;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void OnDidReceiveAPNSNotification(const base::Value::Dict& user_info);
|
||||
void OnDidReceiveAPNSNotification(const base::DictValue& user_info);
|
||||
void ResolveAPNSPromiseSetWithToken(const std::string& token_string);
|
||||
void RejectAPNSPromiseSetWithError(const std::string& error_message);
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ void PushNotifications::UnregisterForAPNSNotifications() {
|
||||
}
|
||||
|
||||
void PushNotifications::OnDidReceiveAPNSNotification(
|
||||
const base::Value::Dict& user_info) {
|
||||
const base::DictValue& user_info) {
|
||||
Emit("received-apns-notification", user_info);
|
||||
}
|
||||
|
||||
|
||||
@@ -369,10 +369,10 @@ class ClearDataTask : public gin_helper::CleanedUpAtExit {
|
||||
std::vector<std::unique_ptr<ClearDataOperation>> operations_;
|
||||
};
|
||||
|
||||
base::Value::Dict createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
|
||||
std::string const& pac_url,
|
||||
std::string const& proxy_server,
|
||||
std::string const& bypass_list) {
|
||||
base::DictValue createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
|
||||
std::string const& pac_url,
|
||||
std::string const& proxy_server,
|
||||
std::string const& bypass_list) {
|
||||
if (proxy_mode == ProxyPrefs::MODE_DIRECT) {
|
||||
return ProxyConfigDictionary::CreateDirect();
|
||||
}
|
||||
@@ -1579,7 +1579,7 @@ void Session::SetSpellCheckerLanguages(
|
||||
gin_helper::ErrorThrower thrower,
|
||||
const std::vector<std::string>& languages) {
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
base::Value::List language_codes;
|
||||
base::ListValue language_codes;
|
||||
for (const std::string& lang : languages) {
|
||||
std::string code = spellcheck::GetCorrespondingSpellCheckLanguage(lang);
|
||||
if (code.empty()) {
|
||||
@@ -1738,7 +1738,7 @@ Session* Session::FromOrCreate(v8::Isolate* isolate,
|
||||
// static
|
||||
Session* Session::FromPartition(v8::Isolate* isolate,
|
||||
const std::string& partition,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
ElectronBrowserContext* browser_context;
|
||||
if (partition.empty()) {
|
||||
browser_context =
|
||||
@@ -1757,7 +1757,7 @@ Session* Session::FromPartition(v8::Isolate* isolate,
|
||||
// static
|
||||
Session* Session::FromPath(gin::Arguments* args,
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
ElectronBrowserContext* browser_context;
|
||||
|
||||
if (path.empty()) {
|
||||
@@ -1902,7 +1902,7 @@ Session* FromPartition(const std::string& partition, gin::Arguments* args) {
|
||||
args->ThrowTypeError("Session can only be received when app is ready");
|
||||
return {};
|
||||
}
|
||||
base::Value::Dict options;
|
||||
base::DictValue options;
|
||||
args->GetNext(&options);
|
||||
return Session::FromPartition(args->isolate(), partition, std::move(options));
|
||||
}
|
||||
@@ -1912,7 +1912,7 @@ Session* FromPath(const base::FilePath& path, gin::Arguments* args) {
|
||||
args->ThrowTypeError("Session can only be received when app is ready");
|
||||
return {};
|
||||
}
|
||||
base::Value::Dict options;
|
||||
base::DictValue options;
|
||||
args->GetNext(&options);
|
||||
return Session::FromPath(args, path, std::move(options));
|
||||
}
|
||||
|
||||
@@ -90,12 +90,12 @@ class Session final : public gin::Wrappable<Session>,
|
||||
// Gets the Session of |partition|.
|
||||
static Session* FromPartition(v8::Isolate* isolate,
|
||||
const std::string& partition,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
// Gets the Session based on |path|.
|
||||
static Session* FromPath(gin::Arguments* args,
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
static void FillObjectTemplate(v8::Isolate*, v8::Local<v8::ObjectTemplate>);
|
||||
static const char* GetClassName() { return "Session"; }
|
||||
|
||||
@@ -77,25 +77,25 @@ class SystemPreferences final
|
||||
void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
|
||||
|
||||
// BrowserObserver:
|
||||
void OnFinishLaunching(base::Value::Dict launch_info) override;
|
||||
void OnFinishLaunching(base::DictValue launch_info) override;
|
||||
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
using NotificationCallback = base::RepeatingCallback<
|
||||
void(const std::string&, base::Value, const std::string&)>;
|
||||
|
||||
void PostNotification(const std::string& name,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args);
|
||||
int SubscribeNotification(v8::Local<v8::Value> maybe_name,
|
||||
const NotificationCallback& callback);
|
||||
void UnsubscribeNotification(int id);
|
||||
void PostLocalNotification(const std::string& name,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
int SubscribeLocalNotification(v8::Local<v8::Value> maybe_name,
|
||||
const NotificationCallback& callback);
|
||||
void UnsubscribeLocalNotification(int request_id);
|
||||
void PostWorkspaceNotification(const std::string& name,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
int SubscribeWorkspaceNotification(v8::Local<v8::Value> maybe_name,
|
||||
const NotificationCallback& callback);
|
||||
void UnsubscribeWorkspaceNotification(int request_id);
|
||||
|
||||
@@ -129,7 +129,7 @@ NSNotificationCenter* GetNotificationCenter(NotificationCenterKind kind) {
|
||||
} // namespace
|
||||
|
||||
void SystemPreferences::PostNotification(const std::string& name,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args) {
|
||||
bool immediate = false;
|
||||
args->GetNext(&immediate);
|
||||
@@ -157,7 +157,7 @@ void SystemPreferences::UnsubscribeNotification(int request_id) {
|
||||
}
|
||||
|
||||
void SystemPreferences::PostLocalNotification(const std::string& name,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
|
||||
[center
|
||||
postNotificationName:base::SysUTF8ToNSString(name)
|
||||
@@ -178,7 +178,7 @@ void SystemPreferences::UnsubscribeLocalNotification(int request_id) {
|
||||
}
|
||||
|
||||
void SystemPreferences::PostWorkspaceNotification(const std::string& name,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
NSNotificationCenter* center =
|
||||
[[NSWorkspace sharedWorkspace] notificationCenter];
|
||||
[center
|
||||
@@ -236,7 +236,7 @@ int SystemPreferences::DoSubscribeNotification(
|
||||
} else {
|
||||
copied_callback.Run(
|
||||
base::SysNSStringToUTF8(notification.name),
|
||||
base::Value(base::Value::Dict()), object);
|
||||
base::Value(base::DictValue()), object);
|
||||
}
|
||||
}];
|
||||
return request_id;
|
||||
@@ -285,7 +285,7 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
|
||||
}
|
||||
|
||||
void SystemPreferences::RegisterDefaults(gin::Arguments* args) {
|
||||
base::Value::Dict dict_value;
|
||||
base::DictValue dict_value;
|
||||
|
||||
if (!args->GetNext(&dict_value)) {
|
||||
args->ThrowError();
|
||||
|
||||
@@ -221,7 +221,7 @@ void SystemPreferences::OnWndProc(HWND hwnd,
|
||||
Emit("color-changed");
|
||||
}
|
||||
|
||||
void SystemPreferences::OnFinishLaunching(base::Value::Dict launch_info) {
|
||||
void SystemPreferences::OnFinishLaunching(base::DictValue launch_info) {
|
||||
hwnd_subscription_ =
|
||||
gfx::SingletonHwnd::GetInstance()->RegisterCallback(base::BindRepeating(
|
||||
&SystemPreferences::OnWndProc, base::Unretained(this)));
|
||||
|
||||
@@ -667,8 +667,8 @@ FileSystem CreateFileSystemStruct(content::WebContents* web_contents,
|
||||
return FileSystem(type, file_system_name, root_url, file_system_path);
|
||||
}
|
||||
|
||||
base::Value::Dict CreateFileSystemValue(const FileSystem& file_system) {
|
||||
base::Value::Dict value;
|
||||
base::DictValue CreateFileSystemValue(const FileSystem& file_system) {
|
||||
base::DictValue value;
|
||||
value.Set("type", file_system.type);
|
||||
value.Set("fileSystemName", file_system.file_system_name);
|
||||
value.Set("rootURL", file_system.root_url);
|
||||
@@ -711,7 +711,7 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
|
||||
}
|
||||
|
||||
// returns a Dict of filesystem_path -> type
|
||||
[[nodiscard]] const base::Value::Dict& GetAddedFileSystems(
|
||||
[[nodiscard]] const base::DictValue& GetAddedFileSystems(
|
||||
content::WebContents* web_contents) {
|
||||
return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
|
||||
}
|
||||
@@ -3026,7 +3026,7 @@ bool WebContents::IsCurrentlyAudible() {
|
||||
namespace {
|
||||
|
||||
void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents,
|
||||
base::Value::Dict print_settings,
|
||||
base::DictValue print_settings,
|
||||
printing::CompletionCallback print_callback,
|
||||
// <error, device_name>
|
||||
std::pair<std::string, std::u16string> info) {
|
||||
@@ -3105,7 +3105,7 @@ void WebContents::Print(gin::Arguments* const args) {
|
||||
return;
|
||||
}
|
||||
|
||||
base::Value::Dict settings;
|
||||
base::DictValue settings;
|
||||
if (options.IsEmptyObject()) {
|
||||
content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
|
||||
if (!rfh)
|
||||
@@ -3136,7 +3136,7 @@ void WebContents::Print(gin::Arguments* const args) {
|
||||
|
||||
if (margin_type == printing::mojom::MarginType::kCustomMargins) {
|
||||
settings.Set(printing::kSettingMarginsCustom,
|
||||
base::Value::Dict{}
|
||||
base::DictValue{}
|
||||
.Set(printing::kSettingMarginTop,
|
||||
margins.ValueOrDefault("top", 0))
|
||||
.Set(printing::kSettingMarginBottom,
|
||||
@@ -3204,11 +3204,11 @@ void WebContents::Print(gin::Arguments* const args) {
|
||||
// Set custom page ranges to print
|
||||
std::vector<gin_helper::Dictionary> page_ranges;
|
||||
if (options.Get("pageRanges", &page_ranges)) {
|
||||
base::Value::List page_range_list;
|
||||
base::ListValue page_range_list;
|
||||
for (auto& range : page_ranges) {
|
||||
int from, to;
|
||||
if (range.Get("from", &from) && range.Get("to", &to)) {
|
||||
base::Value::Dict range_dict;
|
||||
base::DictValue range_dict;
|
||||
// Chromium uses 1-based page ranges, so increment each by 1.
|
||||
range_dict.Set(printing::kSettingPageRangeFrom, from + 1);
|
||||
range_dict.Set(printing::kSettingPageRangeTo, to + 1);
|
||||
@@ -3226,13 +3226,13 @@ void WebContents::Print(gin::Arguments* const args) {
|
||||
"duplexMode", printing::mojom::DuplexMode::kSimplex);
|
||||
settings.Set(printing::kSettingDuplexMode, static_cast<int>(duplex_mode));
|
||||
|
||||
base::Value::Dict media_size;
|
||||
base::DictValue media_size;
|
||||
if (options.Get("mediaSize", &media_size)) {
|
||||
settings.Set(printing::kSettingMediaSize, std::move(media_size));
|
||||
} else {
|
||||
// Default to A4 paper size (210mm x 297mm)
|
||||
settings.Set(printing::kSettingMediaSize,
|
||||
base::Value::Dict()
|
||||
base::DictValue()
|
||||
.Set(printing::kSettingMediaSizeHeightMicrons, 297000)
|
||||
.Set(printing::kSettingMediaSizeWidthMicrons, 210000)
|
||||
.Set(printing::kSettingsImageableAreaLeftMicrons, 0)
|
||||
@@ -4182,9 +4182,9 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
|
||||
void WebContents::DevToolsRequestFileSystems() {
|
||||
const std::string empty_str;
|
||||
content::WebContents* const dtwc = GetDevToolsWebContents();
|
||||
const base::Value::Dict& added_paths = GetAddedFileSystems(dtwc);
|
||||
const base::DictValue& added_paths = GetAddedFileSystems(dtwc);
|
||||
|
||||
auto filesystems = base::Value::List::with_capacity(added_paths.size());
|
||||
auto filesystems = base::ListValue::with_capacity(added_paths.size());
|
||||
for (const auto path_and_type : added_paths) {
|
||||
const auto& [path, type_val] = path_and_type;
|
||||
const auto& type = type_val.is_string() ? type_val.GetString() : empty_str;
|
||||
@@ -4221,7 +4221,7 @@ void WebContents::DevToolsAddFileSystem(
|
||||
|
||||
FileSystem file_system = CreateFileSystemStruct(
|
||||
GetDevToolsWebContents(), file_system_id, path.AsUTF8Unsafe(), type);
|
||||
base::Value::Dict file_system_value = CreateFileSystemValue(file_system);
|
||||
base::DictValue file_system_value = CreateFileSystemValue(file_system);
|
||||
|
||||
auto* pref_service = GetPrefService(GetDevToolsWebContents());
|
||||
ScopedDictPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
|
||||
@@ -4331,7 +4331,7 @@ void WebContents::DevToolsSetEyeDropperActive(bool active) {
|
||||
}
|
||||
|
||||
void WebContents::ColorPickedInEyeDropper(int r, int g, int b, int a) {
|
||||
base::Value::Dict color;
|
||||
base::DictValue color;
|
||||
color.Set("r", r);
|
||||
color.Set("g", g);
|
||||
color.Set("b", b);
|
||||
@@ -4383,7 +4383,7 @@ void WebContents::OnDevToolsSearchCompleted(
|
||||
int request_id,
|
||||
const std::string& file_system_path,
|
||||
const std::vector<std::string>& file_paths) {
|
||||
base::Value::List file_paths_value;
|
||||
base::ListValue file_paths_value;
|
||||
for (const auto& file_path : file_paths)
|
||||
file_paths_value.Append(file_path);
|
||||
inspectable_web_contents_->CallClientFunction(
|
||||
|
||||
@@ -90,7 +90,7 @@ extensions::WebRequestResourceType ParseResourceType(std::string_view value) {
|
||||
// to pass the original keys.
|
||||
v8::Local<v8::Value> HttpResponseHeadersToV8(
|
||||
net::HttpResponseHeaders* headers) {
|
||||
base::Value::Dict response_headers;
|
||||
base::DictValue response_headers;
|
||||
if (headers) {
|
||||
size_t iter = 0;
|
||||
std::string key;
|
||||
|
||||
@@ -104,7 +104,7 @@ void GPUInfoEnumerator::EndOverlayInfo() {
|
||||
value_stack_.pop();
|
||||
}
|
||||
|
||||
base::Value::Dict GPUInfoEnumerator::GetDictionary() {
|
||||
base::DictValue GPUInfoEnumerator::GetDictionary() {
|
||||
return std::move(current_);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,12 +47,12 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
|
||||
void EndAuxAttributes() override;
|
||||
void BeginOverlayInfo() override;
|
||||
void EndOverlayInfo() override;
|
||||
base::Value::Dict GetDictionary();
|
||||
base::DictValue GetDictionary();
|
||||
|
||||
private:
|
||||
// The stack is used to manage nested values
|
||||
std::stack<base::Value::Dict> value_stack_;
|
||||
base::Value::Dict current_;
|
||||
std::stack<base::DictValue> value_stack_;
|
||||
base::DictValue current_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -33,7 +33,7 @@ GPUInfoManager::~GPUInfoManager() {
|
||||
|
||||
// Should be posted to the task runner
|
||||
void GPUInfoManager::ProcessCompleteInfo() {
|
||||
base::Value::Dict result = EnumerateGPUInfo(gpu_data_manager_->GetGPUInfo());
|
||||
base::DictValue result = EnumerateGPUInfo(gpu_data_manager_->GetGPUInfo());
|
||||
// We have received the complete information, resolve all promises that
|
||||
// were waiting for this info.
|
||||
for (auto& promise : complete_info_promise_set_) {
|
||||
@@ -76,8 +76,7 @@ void GPUInfoManager::FetchBasicInfo(gin_helper::Promise<base::Value> promise) {
|
||||
promise.Resolve(base::Value(EnumerateGPUInfo(gpu_info)));
|
||||
}
|
||||
|
||||
base::Value::Dict GPUInfoManager::EnumerateGPUInfo(
|
||||
gpu::GPUInfo gpu_info) const {
|
||||
base::DictValue GPUInfoManager::EnumerateGPUInfo(gpu::GPUInfo gpu_info) const {
|
||||
GPUInfoEnumerator enumerator;
|
||||
gpu_info.EnumerateFields(&enumerator);
|
||||
return enumerator.GetDictionary();
|
||||
|
||||
@@ -40,7 +40,7 @@ class GPUInfoManager : private content::GpuDataManagerObserver,
|
||||
// content::GpuDataManagerObserver
|
||||
void OnGpuInfoUpdate() override;
|
||||
|
||||
base::Value::Dict EnumerateGPUInfo(gpu::GPUInfo gpu_info) const;
|
||||
base::DictValue EnumerateGPUInfo(gpu::GPUInfo gpu_info) const;
|
||||
|
||||
// These should be posted to the task queue
|
||||
void CompleteInfoFetcher(gin_helper::Promise<base::Value> promise);
|
||||
|
||||
@@ -191,7 +191,7 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
|
||||
|
||||
void ElectronBluetoothDelegate::OnDevicePairPromptResponse(
|
||||
PairPromptCallback callback,
|
||||
base::Value::Dict response) {
|
||||
base::DictValue response) {
|
||||
BluetoothDelegate::PairPromptResult result;
|
||||
if (response.FindBool("confirmed").value_or(false)) {
|
||||
result.result_code = BluetoothDelegate::PairPromptStatus::kSuccess;
|
||||
|
||||
@@ -95,7 +95,7 @@ class ElectronBluetoothDelegate : public content::BluetoothDelegate {
|
||||
|
||||
private:
|
||||
void OnDevicePairPromptResponse(PairPromptCallback callback,
|
||||
base::Value::Dict response);
|
||||
base::DictValue response);
|
||||
|
||||
base::WeakPtrFactory<ElectronBluetoothDelegate> weak_factory_{this};
|
||||
};
|
||||
|
||||
@@ -180,7 +180,7 @@ void Browser::WillFinishLaunching() {
|
||||
observers_.Notify(&BrowserObserver::OnWillFinishLaunching);
|
||||
}
|
||||
|
||||
void Browser::DidFinishLaunching(base::Value::Dict launch_info) {
|
||||
void Browser::DidFinishLaunching(base::DictValue launch_info) {
|
||||
// Make sure the userData directory is created.
|
||||
ScopedAllowBlockingForElectron allow_blocking;
|
||||
base::FilePath user_data;
|
||||
|
||||
@@ -174,7 +174,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Creates an activity and sets it as the one currently in use.
|
||||
void SetUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args);
|
||||
|
||||
// Returns the type name of the current user activity.
|
||||
@@ -189,7 +189,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Updates the current user activity
|
||||
void UpdateCurrentActivity(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
// Indicates that an user activity is about to be resumed.
|
||||
bool WillContinueUserActivity(const std::string& type);
|
||||
@@ -200,16 +200,16 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Resumes an activity via hand-off.
|
||||
bool ContinueUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details);
|
||||
base::DictValue user_info,
|
||||
base::DictValue details);
|
||||
|
||||
// Indicates that an activity was continued on another device.
|
||||
void UserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
// Gives an opportunity to update the Handoff payload.
|
||||
bool UpdateUserActivityState(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
void ApplyForcedRTL();
|
||||
|
||||
@@ -246,7 +246,7 @@ class Browser : private WindowListObserver {
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
void ShowAboutPanel();
|
||||
void SetAboutPanelOptions(base::Value::Dict options);
|
||||
void SetAboutPanelOptions(base::DictValue options);
|
||||
|
||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
|
||||
void ShowEmojiPanel();
|
||||
@@ -306,7 +306,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Tell the application the loading has been done.
|
||||
void WillFinishLaunching();
|
||||
void DidFinishLaunching(base::Value::Dict launch_info);
|
||||
void DidFinishLaunching(base::DictValue launch_info);
|
||||
|
||||
void OnAccessibilitySupportChanged();
|
||||
|
||||
@@ -379,7 +379,7 @@ class Browser : private WindowListObserver {
|
||||
bool was_launched_at_login_;
|
||||
#endif
|
||||
|
||||
base::Value::Dict about_panel_options_;
|
||||
base::DictValue about_panel_options_;
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
void UpdateBadgeContents(HWND hwnd,
|
||||
|
||||
@@ -180,7 +180,7 @@ void Browser::ShowAboutPanel() {
|
||||
GtkAboutDialog* dialog = GTK_ABOUT_DIALOG(dialogWidget);
|
||||
|
||||
const std::string* str;
|
||||
const base::Value::List* list;
|
||||
const base::ListValue* list;
|
||||
|
||||
if ((str = opts.FindString("applicationName"))) {
|
||||
gtk_about_dialog_set_program_name(dialog, str->c_str());
|
||||
@@ -233,7 +233,7 @@ void Browser::ShowAboutPanel() {
|
||||
gtk_widget_show_all(dialogWidget);
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_ = std::move(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ bool Browser::SetBadgeCount(std::optional<int> count) {
|
||||
}
|
||||
|
||||
void Browser::SetUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args) {
|
||||
std::string url_string;
|
||||
args->GetNext(&url_string);
|
||||
@@ -330,7 +330,7 @@ void Browser::ResignCurrentActivity() {
|
||||
}
|
||||
|
||||
void Browser::UpdateCurrentActivity(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
[[AtomApplication sharedApplication]
|
||||
updateCurrentActivity:base::SysUTF8ToNSString(type)
|
||||
withUserInfo:DictionaryValueToNSDictionary(
|
||||
@@ -351,8 +351,8 @@ void Browser::DidFailToContinueUserActivity(const std::string& type,
|
||||
}
|
||||
|
||||
bool Browser::ContinueUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnContinueUserActivity(&prevent_default, type, user_info.Clone(),
|
||||
@@ -361,13 +361,13 @@ bool Browser::ContinueUserActivity(const std::string& type,
|
||||
}
|
||||
|
||||
void Browser::UserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnUserActivityWasContinued(type, user_info.Clone());
|
||||
}
|
||||
|
||||
bool Browser::UpdateUserActivityState(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnUpdateUserActivityState(&prevent_default, type,
|
||||
@@ -621,7 +621,7 @@ void Browser::ShowAboutPanel() {
|
||||
orderFrontStandardAboutPanelWithOptions:options];
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_.clear();
|
||||
|
||||
for (const auto pair : options) {
|
||||
|
||||
@@ -43,7 +43,7 @@ class BrowserObserver : public base::CheckedObserver {
|
||||
|
||||
// The browser has finished loading.
|
||||
virtual void OnWillFinishLaunching() {}
|
||||
virtual void OnFinishLaunching(base::Value::Dict launch_info) {}
|
||||
virtual void OnFinishLaunching(base::DictValue launch_info) {}
|
||||
|
||||
// The browser's accessibility support has changed.
|
||||
virtual void OnAccessibilitySupportChanged() {}
|
||||
@@ -66,15 +66,15 @@ class BrowserObserver : public base::CheckedObserver {
|
||||
// The browser wants to resume a user activity via handoff. (macOS only)
|
||||
virtual void OnContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) {}
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) {}
|
||||
// The browser wants to notify that an user activity was resumed. (macOS only)
|
||||
virtual void OnUserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) {}
|
||||
base::DictValue user_info) {}
|
||||
// The browser wants to update an user activity payload. (macOS only)
|
||||
virtual void OnUpdateUserActivityState(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info) {}
|
||||
base::DictValue user_info) {}
|
||||
// User clicked the native macOS new tab button. (macOS only)
|
||||
virtual void OnNewWindowForTab() {}
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ void Browser::ShowEmojiPanel() {
|
||||
}
|
||||
|
||||
void Browser::ShowAboutPanel() {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
std::string aboutMessage = "";
|
||||
gfx::ImageSkia image;
|
||||
|
||||
@@ -815,7 +815,7 @@ void Browser::ShowAboutPanel() {
|
||||
base::BindOnce([](int, bool) { /* do nothing. */ }));
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_ = std::move(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ void ElectronBrowserContext::DestroyAllContexts() {
|
||||
ElectronBrowserContext::ElectronBrowserContext(
|
||||
const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
base::Value::Dict options)
|
||||
base::DictValue options)
|
||||
: in_memory_pref_store_(new ValueMapPrefStore),
|
||||
storage_policy_(base::MakeRefCounted<SpecialStoragePolicy>()),
|
||||
protocol_registry_(base::WrapUnique(new ProtocolRegistry)),
|
||||
@@ -482,7 +482,7 @@ void ElectronBrowserContext::InitPrefs() {
|
||||
std::string default_code = spellcheck::GetCorrespondingSpellCheckLanguage(
|
||||
base::i18n::GetConfiguredLocale());
|
||||
if (!default_code.empty()) {
|
||||
base::Value::List language_codes;
|
||||
base::ListValue language_codes;
|
||||
language_codes.Append(default_code);
|
||||
prefs()->Set(spellcheck::prefs::kSpellCheckDictionaries,
|
||||
base::Value(std::move(language_codes)));
|
||||
@@ -871,7 +871,7 @@ bool ElectronBrowserContext::CheckDevicePermission(
|
||||
ElectronBrowserContext* ElectronBrowserContext::From(
|
||||
const std::string& partition,
|
||||
bool in_memory,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
auto& context = ContextMap()[PartitionKey(partition, in_memory)];
|
||||
if (!context) {
|
||||
context.reset(new ElectronBrowserContext{std::cref(partition), in_memory,
|
||||
@@ -882,13 +882,13 @@ ElectronBrowserContext* ElectronBrowserContext::From(
|
||||
|
||||
// static
|
||||
ElectronBrowserContext* ElectronBrowserContext::GetDefaultBrowserContext(
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
return ElectronBrowserContext::From("", false, std::move(options));
|
||||
}
|
||||
|
||||
ElectronBrowserContext* ElectronBrowserContext::FromPath(
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
auto& context = ContextMap()[PartitionKey(path)];
|
||||
if (!context) {
|
||||
context.reset(
|
||||
|
||||
@@ -67,20 +67,20 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
|
||||
// Get or create the default BrowserContext.
|
||||
static ElectronBrowserContext* GetDefaultBrowserContext(
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
// Get or create the BrowserContext according to its |partition| and
|
||||
// |in_memory|. The |options| will be passed to constructor when there is no
|
||||
// existing BrowserContext.
|
||||
static ElectronBrowserContext* From(const std::string& partition,
|
||||
bool in_memory,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
// Get or create the BrowserContext using the |path|.
|
||||
// The |options| will be passed to constructor when there is no
|
||||
// existing BrowserContext.
|
||||
static ElectronBrowserContext* FromPath(const base::FilePath& path,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
static void DestroyAllContexts();
|
||||
|
||||
@@ -172,9 +172,9 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
|
||||
ElectronBrowserContext(const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
base::Value::Dict options);
|
||||
base::DictValue options);
|
||||
|
||||
ElectronBrowserContext(base::FilePath partition, base::Value::Dict options);
|
||||
ElectronBrowserContext(base::FilePath partition, base::DictValue options);
|
||||
|
||||
static void DisplayMediaDeviceChosen(
|
||||
const content::MediaStreamRequest& request,
|
||||
|
||||
@@ -472,7 +472,7 @@ int ElectronBrowserMainParts::PreMainMessageLoopRun() {
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
// The corresponding call in macOS is in ElectronApplicationDelegate.
|
||||
Browser::Get()->WillFinishLaunching();
|
||||
Browser::Get()->DidFinishLaunching(base::Value::Dict());
|
||||
Browser::Get()->DidFinishLaunching(base::DictValue());
|
||||
#endif
|
||||
|
||||
// Notify observers that main thread message loop was initialized.
|
||||
|
||||
@@ -174,7 +174,7 @@ void ElectronPermissionManager::RequestPermissionWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusCallback response_callback) {
|
||||
if (render_frame_host->IsNestedWithinFencedFrame()) {
|
||||
std::move(response_callback)
|
||||
@@ -213,7 +213,7 @@ void ElectronPermissionManager::RequestPermissions(
|
||||
void ElectronPermissionManager::RequestPermissionsWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::PermissionRequestDescription& request_description,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusesCallback response_callback) {
|
||||
if (request_description.permissions.empty()) {
|
||||
std::move(response_callback).Run({});
|
||||
@@ -315,7 +315,7 @@ blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus(
|
||||
const GURL& embedding_origin) {
|
||||
const auto permission =
|
||||
blink::PermissionDescriptorToPermissionType(permission_descriptor);
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("embeddingOrigin", embedding_origin.spec());
|
||||
bool granted = CheckPermissionWithDetails(permission, {}, requesting_origin,
|
||||
std::move(details));
|
||||
@@ -338,7 +338,7 @@ void ElectronPermissionManager::CheckBluetoothDevicePair(
|
||||
gin_helper::Dictionary details,
|
||||
PairCallback pair_callback) const {
|
||||
if (bluetooth_pairing_handler_.is_null()) {
|
||||
base::Value::Dict response;
|
||||
base::DictValue response;
|
||||
response.Set("confirmed", false);
|
||||
std::move(pair_callback).Run(std::move(response));
|
||||
} else {
|
||||
@@ -350,7 +350,7 @@ bool ElectronPermissionManager::CheckPermissionWithDetails(
|
||||
blink::PermissionType permission,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::Value::Dict details) const {
|
||||
base::DictValue details) const {
|
||||
if (permission == blink::PermissionType::GEOLOCATION &&
|
||||
IsGeolocationDisabledViaCommandLine())
|
||||
return false;
|
||||
@@ -450,7 +450,7 @@ ElectronPermissionManager::GetPermissionResultForCurrentDocument(
|
||||
|
||||
const auto permission =
|
||||
blink::PermissionDescriptorToPermissionType(permission_descriptor);
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("embeddingOrigin",
|
||||
content::PermissionUtil::GetLastCommittedOriginAsURL(
|
||||
render_frame_host->GetMainFrame())
|
||||
|
||||
@@ -46,7 +46,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
using StatusCallback = base::OnceCallback<void(content::PermissionResult)>;
|
||||
using StatusesCallback =
|
||||
base::OnceCallback<void(const std::vector<content::PermissionResult>&)>;
|
||||
using PairCallback = base::OnceCallback<void(base::Value::Dict)>;
|
||||
using PairCallback = base::OnceCallback<void(base::DictValue)>;
|
||||
using RequestHandler = base::RepeatingCallback<void(content::WebContents*,
|
||||
blink::PermissionType,
|
||||
StatusCallback,
|
||||
@@ -73,7 +73,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusCallback response_callback);
|
||||
|
||||
// Handler to dispatch permission requests in JS.
|
||||
@@ -92,7 +92,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
bool CheckPermissionWithDetails(blink::PermissionType permission,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::Value::Dict details) const;
|
||||
base::DictValue details) const;
|
||||
|
||||
bool CheckDevicePermission(blink::PermissionType permission,
|
||||
const url::Origin& origin,
|
||||
@@ -158,7 +158,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
void RequestPermissionsWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::PermissionRequestDescription& request_description,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusesCallback callback);
|
||||
|
||||
RequestHandler request_handler_;
|
||||
|
||||
@@ -157,7 +157,7 @@ ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() {
|
||||
LOG(INFO)
|
||||
<< "chrome.action.getBadgeBackgroundColor is not supported in Electron";
|
||||
|
||||
base::Value::List list;
|
||||
base::ListValue list;
|
||||
return RespondNow(WithArguments(std::move(list)));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ ExtensionFunction::ResponseAction
|
||||
ActionGetBadgeTextColorFunction::RunExtensionAction() {
|
||||
LOG(INFO) << "chrome.action.getBadgeTextColor is not supported in Electron";
|
||||
|
||||
base::Value::List list;
|
||||
base::ListValue list;
|
||||
return RespondNow(WithArguments(std::move(list)));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ ActionGetUserSettingsFunction::~ActionGetUserSettingsFunction() = default;
|
||||
ExtensionFunction::ResponseAction ActionGetUserSettingsFunction::Run() {
|
||||
LOG(INFO) << "chrome.action.getUserSettings is not supported in Electron";
|
||||
|
||||
base::Value::Dict ui_settings;
|
||||
base::DictValue ui_settings;
|
||||
return RespondNow(WithArguments(std::move(ui_settings)));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ namespace SetPdfPluginAttributes =
|
||||
namespace SetPdfDocumentTitle = api::pdf_viewer_private::SetPdfDocumentTitle;
|
||||
|
||||
// Check if the current URL is allowed based on a list of allowlisted domains.
|
||||
bool IsUrlAllowedToEmbedLocalFiles(
|
||||
const GURL& current_url,
|
||||
const base::Value::List& allowlisted_domains) {
|
||||
bool IsUrlAllowedToEmbedLocalFiles(const GURL& current_url,
|
||||
const base::ListValue& allowlisted_domains) {
|
||||
if (!current_url.is_valid() || !current_url.SchemeIs(url::kHttpsScheme)) {
|
||||
return false;
|
||||
}
|
||||
@@ -138,7 +137,7 @@ PdfViewerPrivateIsAllowedLocalFileAccessFunction::Run() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
return RespondNow(WithArguments(
|
||||
IsUrlAllowedToEmbedLocalFiles(GURL(params->url), base::Value::List())));
|
||||
IsUrlAllowedToEmbedLocalFiles(GURL(params->url), base::ListValue())));
|
||||
}
|
||||
|
||||
PdfViewerPrivateSaveToDriveFunction::PdfViewerPrivateSaveToDriveFunction() =
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// To add a new component to this API, simply:
|
||||
// 1. Add your component to the Component enum in
|
||||
// shell/common/extensions/api/resources_private.idl
|
||||
// 2. Create an AddStringsForMyComponent(base::Value::Dict* dict) method.
|
||||
// 2. Create an AddStringsForMyComponent(base::DictValue* dict) method.
|
||||
// 3. Tie in that method to the switch statement in Run()
|
||||
|
||||
namespace extensions {
|
||||
@@ -40,7 +40,7 @@ ResourcesPrivateGetStringsFunction::~ResourcesPrivateGetStringsFunction() =
|
||||
|
||||
ExtensionFunction::ResponseAction ResourcesPrivateGetStringsFunction::Run() {
|
||||
get_strings::Params params = get_strings::Params::Create(args()).value();
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
switch (params.component) {
|
||||
case api::resources_private::Component::kPdf:
|
||||
|
||||
@@ -266,7 +266,7 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() {
|
||||
std::optional<bool> audible = params->query_info.audible;
|
||||
std::optional<bool> muted = params->query_info.muted;
|
||||
|
||||
base::Value::List result;
|
||||
base::ListValue result;
|
||||
|
||||
// Filter out webContents that don't belong to the current browser context.
|
||||
auto* bc = browser_context();
|
||||
|
||||
@@ -28,7 +28,7 @@ ElectronComponentExtensionResourceManager::
|
||||
AddComponentResourceEntries(kPdfResources);
|
||||
|
||||
// Register strings for the PDF viewer, so that $i18n{} replacements work.
|
||||
base::Value::Dict dict = pdf_extension_util::GetStrings(
|
||||
base::DictValue dict = pdf_extension_util::GetStrings(
|
||||
pdf_extension_util::PdfViewerContext::kPdfViewer);
|
||||
|
||||
ui::TemplateReplacements pdf_viewer_replacements;
|
||||
|
||||
@@ -41,7 +41,7 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
|
||||
void OnExtensionInstalled(const Extension* extension,
|
||||
const syncer::StringOrdinal& page_ordinal,
|
||||
int install_flags,
|
||||
base::Value::Dict ruleset_install_prefs) override {}
|
||||
base::DictValue ruleset_install_prefs) override {}
|
||||
|
||||
// Loads an unpacked extension from a directory synchronously. Returns the
|
||||
// extension on success, or nullptr otherwise.
|
||||
|
||||
@@ -90,7 +90,7 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
namespace {
|
||||
|
||||
std::unique_ptr<base::Value::Dict> ParseManifest(
|
||||
std::unique_ptr<base::DictValue> ParseManifest(
|
||||
const std::string_view manifest_contents) {
|
||||
JSONStringValueDeserializer deserializer(manifest_contents);
|
||||
std::unique_ptr<base::Value> manifest =
|
||||
@@ -100,7 +100,7 @@ std::unique_ptr<base::Value::Dict> ParseManifest(
|
||||
LOG(ERROR) << "Failed to parse extension manifest.";
|
||||
return {};
|
||||
}
|
||||
return std::make_unique<base::Value::Dict>(std::move(*manifest).TakeDict());
|
||||
return std::make_unique<base::DictValue>(std::move(*manifest).TakeDict());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -110,7 +110,7 @@ void ElectronExtensionSystem::LoadComponentExtensions() {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
std::u16string error;
|
||||
std::string pdf_manifest_string = pdf_extension_util::GetManifest();
|
||||
std::unique_ptr<base::Value::Dict> pdf_manifest =
|
||||
std::unique_ptr<base::DictValue> pdf_manifest =
|
||||
ParseManifest(pdf_manifest_string);
|
||||
if (pdf_manifest) {
|
||||
base::FilePath root_directory;
|
||||
@@ -194,7 +194,7 @@ void ElectronExtensionSystem::InstallUpdate(
|
||||
|
||||
void ElectronExtensionSystem::PerformActionBasedOnOmahaAttributes(
|
||||
const std::string& extension_id,
|
||||
const base::Value::Dict& attributes) {
|
||||
const base::DictValue& attributes) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
||||
InstallUpdateCallback install_update_callback) override;
|
||||
void PerformActionBasedOnOmahaAttributes(
|
||||
const std::string& extension_id,
|
||||
const base::Value::Dict& attributes) override;
|
||||
const base::DictValue& attributes) override;
|
||||
|
||||
private:
|
||||
void OnExtensionRegisteredWithRequestContexts(
|
||||
|
||||
@@ -330,7 +330,7 @@ ElectronExtensionsBrowserClient::GetComponentExtensionResourceManager() {
|
||||
void ElectronExtensionsBrowserClient::BroadcastEventToRenderers(
|
||||
extensions::events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
base::Value::List args,
|
||||
base::ListValue args,
|
||||
bool dispatch_to_off_the_record_profiles) {
|
||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||
content::GetUIThreadTaskRunner({})->PostTask(
|
||||
|
||||
@@ -132,7 +132,7 @@ class ElectronExtensionsBrowserClient
|
||||
void BroadcastEventToRenderers(
|
||||
extensions::events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
base::Value::List args,
|
||||
base::ListValue args,
|
||||
bool dispatch_to_off_the_record_profiles) override;
|
||||
extensions::ExtensionCache* GetExtensionCache() override;
|
||||
bool IsBackgroundUpdateAllowed() override;
|
||||
|
||||
@@ -39,7 +39,7 @@ ElectronMessagingDelegate::IsNativeMessagingHostAllowed(
|
||||
return PolicyPermission::DISALLOW;
|
||||
}
|
||||
|
||||
std::optional<base::Value::Dict> ElectronMessagingDelegate::MaybeGetTabInfo(
|
||||
std::optional<base::DictValue> ElectronMessagingDelegate::MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) {
|
||||
if (web_contents) {
|
||||
auto* api_contents = electron::api::WebContents::From(web_contents);
|
||||
|
||||
@@ -27,7 +27,7 @@ class ElectronMessagingDelegate : public MessagingDelegate {
|
||||
PolicyPermission IsNativeMessagingHostAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
const std::string& native_host_name) override;
|
||||
std::optional<base::Value::Dict> MaybeGetTabInfo(
|
||||
std::optional<base::DictValue> MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) override;
|
||||
content::WebContents* GetWebContentsByTabId(
|
||||
content::BrowserContext* browser_context,
|
||||
|
||||
@@ -262,7 +262,7 @@ class FileSystemAccessPermissionContext::PermissionGrantImpl
|
||||
static_cast<electron::ElectronPermissionManager*>(
|
||||
context_->browser_context()->GetPermissionControllerDelegate());
|
||||
if (permission_manager && permission_manager->HasPermissionCheckHandler()) {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("filePath", base::FilePathToValue(path_info_.path));
|
||||
details.Set("isDirectory", handle_type_ == HandleType::kDirectory);
|
||||
details.Set("fileAccessType",
|
||||
@@ -359,7 +359,7 @@ class FileSystemAccessPermissionContext::PermissionGrantImpl
|
||||
return;
|
||||
}
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("filePath", base::FilePathToValue(path_info_.path));
|
||||
details.Set("isDirectory", handle_type_ == HandleType::kDirectory);
|
||||
details.Set("fileAccessType",
|
||||
@@ -779,7 +779,7 @@ void FileSystemAccessPermissionContext::DidCheckPathAgainstBlocklist(
|
||||
}
|
||||
|
||||
void FileSystemAccessPermissionContext::MaybeEvictEntries(
|
||||
base::Value::Dict& dict) {
|
||||
base::DictValue& dict) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
std::vector<std::pair<base::Time, std::string>> entries;
|
||||
@@ -818,7 +818,7 @@ void FileSystemAccessPermissionContext::SetLastPickedDirectory(
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
// Create an entry into the nested dictionary.
|
||||
base::Value::Dict entry;
|
||||
base::DictValue entry;
|
||||
entry.Set(kPathKey, base::FilePathToValue(path_info.path));
|
||||
entry.Set(kPathTypeKey, static_cast<int>(path_info.type));
|
||||
entry.Set(kDisplayNameKey, path_info.display_name);
|
||||
@@ -826,11 +826,11 @@ void FileSystemAccessPermissionContext::SetLastPickedDirectory(
|
||||
|
||||
auto it = id_pathinfo_map_.find(origin);
|
||||
if (it != id_pathinfo_map_.end()) {
|
||||
base::Value::Dict& dict = it->second;
|
||||
base::DictValue& dict = it->second;
|
||||
dict.Set(GenerateLastPickedDirectoryKey(id), std::move(entry));
|
||||
MaybeEvictEntries(dict);
|
||||
} else {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set(GenerateLastPickedDirectoryKey(id), std::move(entry));
|
||||
MaybeEvictEntries(dict);
|
||||
id_pathinfo_map_.try_emplace(origin, std::move(dict));
|
||||
|
||||
@@ -164,7 +164,7 @@ class FileSystemAccessPermissionContext
|
||||
void OnRestrictedPathResult(const base::FilePath& file_path,
|
||||
gin::Arguments* args);
|
||||
|
||||
void MaybeEvictEntries(base::Value::Dict& dict);
|
||||
void MaybeEvictEntries(base::DictValue& dict);
|
||||
|
||||
void CleanupPermissions(const url::Origin& origin);
|
||||
|
||||
@@ -189,7 +189,7 @@ class FileSystemAccessPermissionContext
|
||||
|
||||
const raw_ptr<const base::Clock> clock_;
|
||||
|
||||
std::map<url::Origin, base::Value::Dict> id_pathinfo_map_;
|
||||
std::map<url::Origin, base::DictValue> id_pathinfo_map_;
|
||||
|
||||
std::map<base::FilePath, base::OnceCallback<void(SensitiveEntryResult)>>
|
||||
callback_map_;
|
||||
|
||||
@@ -139,7 +139,7 @@ bool ElectronHidDelegate::CanRequestDevicePermission(
|
||||
if (!browser_context)
|
||||
return false;
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", origin.GetURL().spec());
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
browser_context->GetPermissionControllerDelegate());
|
||||
|
||||
@@ -92,9 +92,8 @@ std::string UnitSystemToString(uint8_t unit) {
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidReportItemToValue(
|
||||
const device::mojom::HidReportItem& item) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue HidReportItemToValue(const device::mojom::HidReportItem& item) {
|
||||
base::DictValue dict;
|
||||
|
||||
dict.Set("hasNull", item.has_null_position);
|
||||
dict.Set("hasPreferredState", !item.no_preferred_state);
|
||||
@@ -131,7 +130,7 @@ base::Value::Dict HidReportItemToValue(
|
||||
dict.Set("usageMinimum", ConvertHidUsageAndPageToInt(*item.usage_minimum));
|
||||
dict.Set("usageMaximum", ConvertHidUsageAndPageToInt(*item.usage_maximum));
|
||||
} else {
|
||||
base::Value::List usages_list;
|
||||
base::ListValue usages_list;
|
||||
for (const auto& usage : item.usages) {
|
||||
usages_list.Append(ConvertHidUsageAndPageToInt(*usage));
|
||||
}
|
||||
@@ -144,12 +143,12 @@ base::Value::Dict HidReportItemToValue(
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidReportDescriptionToValue(
|
||||
base::DictValue HidReportDescriptionToValue(
|
||||
const device::mojom::HidReportDescription& report) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set("reportId", static_cast<int>(report.report_id));
|
||||
|
||||
base::Value::List items_list;
|
||||
base::ListValue items_list;
|
||||
for (const auto& item : report.items) {
|
||||
items_list.Append(base::Value(HidReportItemToValue(*item)));
|
||||
}
|
||||
@@ -159,9 +158,9 @@ base::Value::Dict HidReportDescriptionToValue(
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidCollectionInfoToValue(
|
||||
base::DictValue HidCollectionInfoToValue(
|
||||
const device::mojom::HidCollectionInfo& collection) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
// Usage information
|
||||
dict.Set("usage", collection.usage->usage);
|
||||
@@ -171,7 +170,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("collectionType", static_cast<int>(collection.collection_type));
|
||||
|
||||
// Input reports
|
||||
base::Value::List input_reports_list;
|
||||
base::ListValue input_reports_list;
|
||||
for (const auto& report : collection.input_reports) {
|
||||
input_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -179,7 +178,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("inputReports", std::move(input_reports_list));
|
||||
|
||||
// Output reports
|
||||
base::Value::List output_reports_list;
|
||||
base::ListValue output_reports_list;
|
||||
for (const auto& report : collection.output_reports) {
|
||||
output_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -187,7 +186,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("outputReports", std::move(output_reports_list));
|
||||
|
||||
// Feature reports
|
||||
base::Value::List feature_reports_list;
|
||||
base::ListValue feature_reports_list;
|
||||
for (const auto& report : collection.feature_reports) {
|
||||
feature_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -195,7 +194,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("featureReports", std::move(feature_reports_list));
|
||||
|
||||
// Child collections (recursive)
|
||||
base::Value::List children_list;
|
||||
base::ListValue children_list;
|
||||
for (const auto& child : collection.children) {
|
||||
children_list.Append(base::Value(HidCollectionInfoToValue(*child)));
|
||||
}
|
||||
@@ -240,7 +239,7 @@ bool HidChooserContext::CanStorePersistentEntry(
|
||||
// static
|
||||
base::Value HidChooserContext::DeviceInfoToValue(
|
||||
const device::mojom::HidDeviceInfo& device) {
|
||||
base::Value::Dict value;
|
||||
base::DictValue value;
|
||||
value.Set(
|
||||
kHidDeviceNameKey,
|
||||
base::UTF16ToUTF8(HidChooserContext::DisplayNameFromDeviceInfo(device)));
|
||||
@@ -259,7 +258,7 @@ base::Value HidChooserContext::DeviceInfoToValue(
|
||||
}
|
||||
|
||||
// Convert collections array
|
||||
base::Value::List collections_list;
|
||||
base::ListValue collections_list;
|
||||
for (const auto& collection : device.collections) {
|
||||
collections_list.Append(base::Value(HidCollectionInfoToValue(*collection)));
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
NSArray* ListValueToNSArray(const base::Value::List& value);
|
||||
base::Value::List NSArrayToValue(NSArray* arr);
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value);
|
||||
base::Value::Dict NSDictionaryToValue(NSDictionary* dict);
|
||||
NSArray* ListValueToNSArray(const base::ListValue& value);
|
||||
base::ListValue NSArrayToValue(NSArray* arr);
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::DictValue& value);
|
||||
base::DictValue NSDictionaryToValue(NSDictionary* dict);
|
||||
|
||||
} // namespace electron
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
NSArray* ListValueToNSArray(const base::Value::List& value) {
|
||||
NSArray* ListValueToNSArray(const base::ListValue& value) {
|
||||
const auto json = base::WriteJson(value);
|
||||
if (!json.has_value())
|
||||
return nil;
|
||||
@@ -26,8 +26,8 @@ NSArray* ListValueToNSArray(const base::Value::List& value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
base::Value::List NSArrayToValue(NSArray* arr) {
|
||||
base::Value::List result;
|
||||
base::ListValue NSArrayToValue(NSArray* arr) {
|
||||
base::ListValue result;
|
||||
if (!arr)
|
||||
return result;
|
||||
|
||||
@@ -54,7 +54,7 @@ base::Value::List NSArrayToValue(NSArray* arr) {
|
||||
return result;
|
||||
}
|
||||
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value) {
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::DictValue& value) {
|
||||
const auto json = base::WriteJson(value);
|
||||
if (!json.has_value())
|
||||
return nil;
|
||||
@@ -67,8 +67,8 @@ NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
base::Value::Dict NSDictionaryToValue(NSDictionary* dict) {
|
||||
base::Value::Dict result;
|
||||
base::DictValue NSDictionaryToValue(NSDictionary* dict) {
|
||||
base::DictValue result;
|
||||
if (!dict)
|
||||
return result;
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
dispatch_sync_main(^{
|
||||
std::string activity_type(
|
||||
base::SysNSStringToUTF8(userActivity.activityType));
|
||||
base::Value::Dict user_info =
|
||||
base::DictValue user_info =
|
||||
electron::NSDictionaryToValue(userActivity.userInfo);
|
||||
|
||||
electron::Browser* browser = electron::Browser::Get();
|
||||
@@ -192,7 +192,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
std::string activity_type(
|
||||
base::SysNSStringToUTF8(userActivity.activityType));
|
||||
base::Value::Dict user_info =
|
||||
base::DictValue user_info =
|
||||
electron::NSDictionaryToValue(userActivity.userInfo);
|
||||
|
||||
electron::Browser* browser = electron::Browser::Get();
|
||||
|
||||
@@ -637,7 +637,7 @@ void NativeWindow::NotifyWindowExecuteAppCommand(
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue details) {
|
||||
observers_.Notify(&NativeWindowObserver::OnTouchBarItemResult, item_id,
|
||||
details);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ class NativeWindow : public views::WidgetDelegate {
|
||||
void NotifyWindowAlwaysOnTopChanged();
|
||||
void NotifyWindowExecuteAppCommand(std::string_view command_name);
|
||||
void NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
base::Value::Dict details);
|
||||
base::DictValue details);
|
||||
void NotifyNewWindowForTab();
|
||||
void NotifyWindowSystemContextMenu(int x, int y, bool* prevent_default);
|
||||
void NotifyLayoutWindowControlsOverlay();
|
||||
|
||||
@@ -96,7 +96,7 @@ class NativeWindowObserver : public base::CheckedObserver {
|
||||
virtual void OnWindowLeaveHtmlFullScreen() {}
|
||||
virtual void OnWindowAlwaysOnTopChanged() {}
|
||||
virtual void OnTouchBarItemResult(const std::string& item_id,
|
||||
const base::Value::Dict& details) {}
|
||||
const base::DictValue& details) {}
|
||||
virtual void OnNewWindowForTab() {}
|
||||
virtual void OnSystemContextMenu(int x, int y, bool* prevent_default) {}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
|
||||
bool has_mime_type = dict.Get("mimeType", &head->mime_type);
|
||||
bool has_content_type = false;
|
||||
|
||||
base::Value::Dict headers;
|
||||
base::DictValue headers;
|
||||
if (dict.Get("headers", &headers)) {
|
||||
for (const auto iter : headers) {
|
||||
if (iter.second.is_string()) {
|
||||
@@ -204,7 +204,7 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
||||
mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
const net::NetworkTrafficAnnotationTag& annotation,
|
||||
base::Value::Dict upload_data)
|
||||
base::DictValue upload_data)
|
||||
: url_loader_(this, std::move(loader)), client_(std::move(client)) {
|
||||
url_loader_.set_disconnect_handler(
|
||||
base::BindOnce(&URLPipeLoader::NotifyComplete, base::Unretained(this),
|
||||
@@ -228,7 +228,7 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
||||
void Start(scoped_refptr<network::SharedURLLoaderFactory> factory,
|
||||
std::unique_ptr<network::ResourceRequest> request,
|
||||
const net::NetworkTrafficAnnotationTag& annotation,
|
||||
base::Value::Dict upload_data) {
|
||||
base::DictValue upload_data) {
|
||||
loader_ = network::SimpleURLLoader::Create(std::move(request), annotation);
|
||||
loader_->SetOnResponseStartedCallback(base::BindOnce(
|
||||
&URLPipeLoader::OnResponseStarted, weak_factory_.GetWeakPtr()));
|
||||
@@ -665,7 +665,7 @@ void ElectronURLLoaderFactory::StartLoadingHttp(
|
||||
if (!dict.Get("method", &request->method))
|
||||
request->method = original_request.method;
|
||||
|
||||
base::Value::Dict upload_data;
|
||||
base::DictValue upload_data;
|
||||
if (request->method != net::HttpRequestHeaders::kGetMethod &&
|
||||
request->method != net::HttpRequestHeaders::kHeadMethod)
|
||||
dict.Get("uploadData", &upload_data);
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string EncodeToken(const base::UnguessableToken& token) {
|
||||
}
|
||||
|
||||
base::Value PortInfoToValue(const device::mojom::SerialPortInfo& port) {
|
||||
base::Value::Dict value;
|
||||
base::DictValue value;
|
||||
if (port.display_name && !port.display_name->empty()) {
|
||||
value.Set(kPortNameKey, *port.display_name);
|
||||
} else {
|
||||
|
||||
@@ -254,7 +254,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
NSColor* color = ((NSColorPickerTouchBarItem*)sender).color;
|
||||
std::string hex_color =
|
||||
electron::ToRGBHex(skia::NSDeviceColorToSkColor(color));
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("color", hex_color);
|
||||
window_->NotifyTouchBarItemInteraction([item_id UTF8String],
|
||||
std::move(details));
|
||||
@@ -264,7 +264,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
NSString* identifier = ((NSSliderTouchBarItem*)sender).identifier;
|
||||
NSString* item_id = [self idFromIdentifier:identifier
|
||||
withPrefix:SliderIdentifier];
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("value", [((NSSliderTouchBarItem*)sender).slider intValue]);
|
||||
window_->NotifyTouchBarItemInteraction([item_id UTF8String],
|
||||
std::move(details));
|
||||
@@ -278,7 +278,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
- (void)segmentedControlAction:(id)sender {
|
||||
NSString* item_id =
|
||||
[NSString stringWithFormat:@"%ld", ((NSSegmentedControl*)sender).tag];
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("selectedIndex",
|
||||
static_cast<int>(((NSSegmentedControl*)sender).selectedSegment));
|
||||
details.Set(
|
||||
@@ -291,7 +291,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didSelectItemAtIndex:(NSInteger)selectedIndex {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("selectedIndex", static_cast<int>(selectedIndex));
|
||||
details.Set("type", "select");
|
||||
window_->NotifyTouchBarItemInteraction([scrubber.identifier UTF8String],
|
||||
@@ -300,7 +300,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didHighlightItemAtIndex:(NSInteger)highlightedIndex {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("highlightedIndex", static_cast<int>(highlightedIndex));
|
||||
details.Set("type", "highlight");
|
||||
window_->NotifyTouchBarItemInteraction([scrubber.identifier UTF8String],
|
||||
|
||||
@@ -96,15 +96,15 @@ constexpr std::string_view kTitleFormat = "Developer Tools - %s";
|
||||
|
||||
const size_t kMaxMessageChunkSize = IPC::mojom::kChannelMaximumMessageSize / 4;
|
||||
|
||||
base::Value::Dict RectToDictionary(const gfx::Rect& bounds) {
|
||||
return base::Value::Dict{}
|
||||
base::DictValue RectToDictionary(const gfx::Rect& bounds) {
|
||||
return base::DictValue{}
|
||||
.Set("x", bounds.x())
|
||||
.Set("y", bounds.y())
|
||||
.Set("width", bounds.width())
|
||||
.Set("height", bounds.height());
|
||||
}
|
||||
|
||||
gfx::Rect DictionaryToRect(const base::Value::Dict& dict) {
|
||||
gfx::Rect DictionaryToRect(const base::DictValue& dict) {
|
||||
return gfx::Rect{dict.FindInt("x").value_or(0), dict.FindInt("y").value_or(0),
|
||||
dict.FindInt("width").value_or(800),
|
||||
dict.FindInt("height").value_or(600)};
|
||||
@@ -269,7 +269,7 @@ class InspectableWebContents::NetworkResourceLoader
|
||||
"statusCode", response_headers_ ? response_headers_->response_code()
|
||||
: net::HTTP_OK);
|
||||
|
||||
base::Value::Dict headers;
|
||||
base::DictValue headers;
|
||||
size_t iterator = 0;
|
||||
std::string name;
|
||||
std::string value;
|
||||
@@ -490,7 +490,7 @@ void InspectableWebContents::CallClientFunction(
|
||||
if (!GetDevToolsWebContents())
|
||||
return;
|
||||
|
||||
base::Value::List arguments;
|
||||
base::ListValue arguments;
|
||||
if (!arg1.is_none()) {
|
||||
arguments.Append(std::move(arg1));
|
||||
if (!arg2.is_none()) {
|
||||
@@ -550,7 +550,7 @@ void InspectableWebContents::LoadCompleted() {
|
||||
}
|
||||
} else {
|
||||
if (dock_state_.empty()) {
|
||||
const base::Value::Dict& prefs =
|
||||
const base::DictValue& prefs =
|
||||
pref_service_->GetDict(kDevToolsPreferences);
|
||||
const std::string* current_dock_state =
|
||||
prefs.FindString("currentDockState");
|
||||
@@ -597,7 +597,7 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
|
||||
if (!registry)
|
||||
return;
|
||||
|
||||
base::Value::List results;
|
||||
base::ListValue results;
|
||||
for (auto& extension : registry->enabled_extensions()) {
|
||||
auto devtools_page_url =
|
||||
extensions::chrome_manifest_urls::GetDevToolsPage(extension.get());
|
||||
@@ -611,7 +611,7 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
|
||||
web_contents_->GetPrimaryMainFrame()->GetProcess()->GetDeprecatedID(),
|
||||
url::Origin::Create(extension->url()));
|
||||
|
||||
base::Value::Dict extension_info;
|
||||
base::DictValue extension_info;
|
||||
extension_info.Set("startPage", devtools_page_url.spec());
|
||||
extension_info.Set("name", extension->name());
|
||||
extension_info.Set("exposeExperimentalAPIs",
|
||||
@@ -864,7 +864,7 @@ void InspectableWebContents::GetSyncInformation(DispatchCallback callback) {
|
||||
}
|
||||
|
||||
void InspectableWebContents::GetHostConfig(DispatchCallback callback) {
|
||||
base::Value::Dict response_dict;
|
||||
base::DictValue response_dict;
|
||||
base::Value response = base::Value(std::move(response_dict));
|
||||
std::move(callback).Run(&response);
|
||||
}
|
||||
@@ -875,7 +875,7 @@ void InspectableWebContents::RegisterExtensionsAPI(const std::string& origin,
|
||||
}
|
||||
|
||||
void InspectableWebContents::HandleMessageFromDevToolsFrontend(
|
||||
base::Value::Dict message) {
|
||||
base::DictValue message) {
|
||||
// TODO(alexeykuzmin): Should we expect it to exist?
|
||||
if (!embedder_message_dispatcher_) {
|
||||
return;
|
||||
@@ -889,8 +889,8 @@ void InspectableWebContents::HandleMessageFromDevToolsFrontend(
|
||||
return;
|
||||
}
|
||||
|
||||
const base::Value::List no_params;
|
||||
const base::Value::List& params_list =
|
||||
const base::ListValue no_params;
|
||||
const base::ListValue& params_list =
|
||||
params != nullptr && params->is_list() ? params->GetList() : no_params;
|
||||
|
||||
const int id = message.FindInt(kFrontendHostId).value_or(0);
|
||||
|
||||
@@ -201,7 +201,7 @@ class InspectableWebContents
|
||||
const DevToolsDispatchHttpRequestParams& params) override {}
|
||||
|
||||
// content::DevToolsFrontendHostDelegate:
|
||||
void HandleMessageFromDevToolsFrontend(base::Value::Dict message);
|
||||
void HandleMessageFromDevToolsFrontend(base::DictValue message);
|
||||
|
||||
// content::DevToolsAgentHostClient:
|
||||
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
|
||||
|
||||
@@ -90,7 +90,7 @@ constexpr std::string_view kWeb = "web";
|
||||
static const char kDetectedATName[] = "detectedATName";
|
||||
static const char kIsScreenReaderActive[] = "isScreenReaderActive";
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(
|
||||
base::DictValue BuildTargetDescriptor(
|
||||
const GURL& url,
|
||||
const std::string& name,
|
||||
const GURL& favicon_url,
|
||||
@@ -98,7 +98,7 @@ base::Value::Dict BuildTargetDescriptor(
|
||||
int routing_id,
|
||||
ui::AXMode accessibility_mode,
|
||||
base::ProcessHandle handle = base::kNullProcessHandle) {
|
||||
base::Value::Dict target_data;
|
||||
base::DictValue target_data;
|
||||
target_data.Set(kProcessIdField, process_id);
|
||||
target_data.Set(kRoutingIdField, routing_id);
|
||||
target_data.Set(kUrlField, url.spec());
|
||||
@@ -111,7 +111,7 @@ base::Value::Dict BuildTargetDescriptor(
|
||||
return target_data;
|
||||
}
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
base::DictValue BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderViewHost(rvh);
|
||||
ui::AXMode accessibility_mode;
|
||||
@@ -139,8 +139,8 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
rvh->GetRoutingID(), accessibility_mode);
|
||||
}
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(electron::NativeWindow* window) {
|
||||
base::Value::Dict target_data;
|
||||
base::DictValue BuildTargetDescriptor(electron::NativeWindow* window) {
|
||||
base::DictValue target_data;
|
||||
target_data.Set(kSessionIdField, window->window_id());
|
||||
target_data.Set(kNameField, window->GetTitle());
|
||||
target_data.Set(kTypeField, kBrowser);
|
||||
@@ -160,7 +160,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
auto& browser_accessibility_state =
|
||||
*content::BrowserAccessibilityState::GetInstance();
|
||||
base::Value::Dict data;
|
||||
base::DictValue data;
|
||||
PrefService* pref =
|
||||
static_cast<electron::ElectronBrowserContext*>(current_context)->prefs();
|
||||
ui::AXMode mode =
|
||||
@@ -200,7 +200,7 @@ void HandleAccessibilityRequestCallback(
|
||||
// is checked.
|
||||
data.Set(
|
||||
kLockedPlatformModes,
|
||||
base::Value::Dict()
|
||||
base::DictValue()
|
||||
.Set(kNative,
|
||||
allow_platform_activation && native &&
|
||||
initial_process_mode.has_mode(ui::AXMode::kNativeAPIs))
|
||||
@@ -226,7 +226,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
std::vector<ui::AXApiType::Type> supported_api_types =
|
||||
content::AXInspectFactory::SupportedApis();
|
||||
base::Value::List supported_api_list;
|
||||
base::ListValue supported_api_list;
|
||||
supported_api_list.reserve(supported_api_types.size());
|
||||
for (ui::AXApiType::Type type : supported_api_types) {
|
||||
supported_api_list.Append(std::string_view(type));
|
||||
@@ -248,7 +248,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
data.Set(kLocked, !browser_accessibility_state.IsAXModeChangeAllowed());
|
||||
|
||||
base::Value::List page_list;
|
||||
base::ListValue page_list;
|
||||
std::unique_ptr<content::RenderWidgetHostIterator> widget_iter(
|
||||
content::RenderWidgetHost::GetRenderWidgetHosts());
|
||||
|
||||
@@ -279,7 +279,7 @@ void HandleAccessibilityRequestCallback(
|
||||
continue;
|
||||
}
|
||||
|
||||
base::Value::Dict descriptor = BuildTargetDescriptor(rvh);
|
||||
base::DictValue descriptor = BuildTargetDescriptor(rvh);
|
||||
descriptor.Set(kNative, native);
|
||||
descriptor.Set(kExtendedProperties, extended_properties);
|
||||
descriptor.Set(kScreenReader, screen_reader);
|
||||
@@ -288,7 +288,7 @@ void HandleAccessibilityRequestCallback(
|
||||
}
|
||||
data.Set(kPagesField, std::move(page_list));
|
||||
|
||||
base::Value::List window_list;
|
||||
base::ListValue window_list;
|
||||
for (auto* window : electron::WindowList::GetWindows()) {
|
||||
window_list.Append(BuildTargetDescriptor(window));
|
||||
}
|
||||
@@ -385,7 +385,7 @@ ElectronAccessibilityUIMessageHandler::ElectronAccessibilityUIMessageHandler() =
|
||||
default;
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::GetRequestTypeAndFilters(
|
||||
const base::Value::Dict& data,
|
||||
const base::DictValue& data,
|
||||
std::string& request_type,
|
||||
std::string& allow,
|
||||
std::string& allow_empty,
|
||||
@@ -398,8 +398,8 @@ void ElectronAccessibilityUIMessageHandler::GetRequestTypeAndFilters(
|
||||
}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
const base::Value::List& args) {
|
||||
const base::Value::Dict& data = args.front().GetDict();
|
||||
const base::ListValue& args) {
|
||||
const base::DictValue& data = args.front().GetDict();
|
||||
|
||||
std::string request_type, allow, allow_empty, deny;
|
||||
GetRequestTypeAndFilters(data, request_type, allow, allow_empty, deny);
|
||||
@@ -416,7 +416,7 @@ void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
|
||||
for (auto* window : electron::WindowList::GetWindows()) {
|
||||
if (window->window_id() == window_id) {
|
||||
base::Value::Dict result = BuildTargetDescriptor(window);
|
||||
base::DictValue result = BuildTargetDescriptor(window);
|
||||
gfx::NativeWindow native_window = window->GetNativeWindow();
|
||||
ui::AXPlatformNode* node =
|
||||
ui::AXPlatformNode::FromNativeWindow(native_window);
|
||||
@@ -428,7 +428,7 @@ void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
}
|
||||
|
||||
// No browser with the specified |id| was found.
|
||||
base::Value::Dict result;
|
||||
base::DictValue result;
|
||||
result.Set(kSessionIdField, window_id);
|
||||
result.Set(kTypeField, kBrowser);
|
||||
result.Set(kErrorField, "Window no longer exists.");
|
||||
|
||||
@@ -34,12 +34,12 @@ class ElectronAccessibilityUIMessageHandler
|
||||
static void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry);
|
||||
|
||||
private:
|
||||
void GetRequestTypeAndFilters(const base::Value::Dict& data,
|
||||
void GetRequestTypeAndFilters(const base::DictValue& data,
|
||||
std::string& request_type,
|
||||
std::string& allow,
|
||||
std::string& allow_empty,
|
||||
std::string& deny);
|
||||
void RequestNativeUITree(const base::Value::List& args);
|
||||
void RequestNativeUITree(const base::ListValue& args);
|
||||
};
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_UI_WEBUI_ACCESSIBILITY_UI_H_
|
||||
|
||||
@@ -178,7 +178,7 @@ bool ElectronUsbDelegate::CanRequestDevicePermission(
|
||||
if (!browser_context)
|
||||
return false;
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", origin.GetURL().spec());
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
browser_context->GetPermissionControllerDelegate());
|
||||
|
||||
@@ -70,7 +70,7 @@ UsbChooserContext::UsbChooserContext(ElectronBrowserContext* context)
|
||||
// static
|
||||
base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
const device::mojom::UsbDeviceInfo& device_info) {
|
||||
base::Value::Dict device_value;
|
||||
base::DictValue device_value;
|
||||
device_value.Set(kDeviceNameKey, device_info.product_name
|
||||
? *device_info.product_name
|
||||
: std::u16string_view());
|
||||
@@ -100,9 +100,9 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
device_info.device_version_subminor);
|
||||
|
||||
bool has_active_configuration = false;
|
||||
base::Value::List configuration_list;
|
||||
base::ListValue configuration_list;
|
||||
for (const auto& configuration : device_info.configurations) {
|
||||
base::Value::Dict configuration_value;
|
||||
base::DictValue configuration_value;
|
||||
configuration_value.Set("configurationValue",
|
||||
configuration->configuration_value);
|
||||
configuration_value.Set("configurationName",
|
||||
@@ -111,12 +111,12 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
: std::u16string_view());
|
||||
|
||||
for (const auto& interface : configuration->interfaces) {
|
||||
base::Value::Dict interface_value;
|
||||
base::DictValue interface_value;
|
||||
interface_value.Set("interfaceNumber", interface->interface_number);
|
||||
|
||||
base::Value::List alternate_list;
|
||||
base::ListValue alternate_list;
|
||||
for (const auto& alternate : interface->alternates) {
|
||||
base::Value::Dict alternate_value;
|
||||
base::DictValue alternate_value;
|
||||
alternate_value.Set("alternateSetting", alternate->alternate_setting);
|
||||
alternate_value.Set("interfaceClass", alternate->class_code);
|
||||
alternate_value.Set("interfaceSubclass", alternate->subclass_code);
|
||||
@@ -125,9 +125,9 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
? *alternate->interface_name
|
||||
: std::u16string_view());
|
||||
|
||||
base::Value::List endpoint_list;
|
||||
base::ListValue endpoint_list;
|
||||
for (const auto& endpoint : alternate->endpoints) {
|
||||
base::Value::Dict endpoint_value;
|
||||
base::DictValue endpoint_value;
|
||||
endpoint_value.Set("endpointNumber", endpoint->endpoint_number);
|
||||
|
||||
bool inbound = endpoint->direction ==
|
||||
@@ -258,7 +258,7 @@ void UsbChooserContext::RevokeObjectPermissionInternal(
|
||||
const url::Origin& origin,
|
||||
const base::Value& object,
|
||||
bool revoked_by_website = false) {
|
||||
const base::Value::Dict* object_dict = object.GetIfDict();
|
||||
const base::DictValue* object_dict = object.GetIfDict();
|
||||
DCHECK(object_dict != nullptr);
|
||||
|
||||
if (object_dict->FindString(kDeviceSerialNumberKey) != nullptr) {
|
||||
|
||||
@@ -216,7 +216,7 @@ void WebContentsPermissionHelper::RequestPermission(
|
||||
blink::PermissionType permission,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue details) {
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
web_contents_->GetBrowserContext()->GetPermissionControllerDelegate());
|
||||
auto origin = web_contents_->GetLastCommittedURL();
|
||||
@@ -229,7 +229,7 @@ void WebContentsPermissionHelper::RequestPermission(
|
||||
|
||||
bool WebContentsPermissionHelper::CheckPermission(
|
||||
blink::PermissionType permission,
|
||||
base::Value::Dict details) const {
|
||||
base::DictValue details) const {
|
||||
auto* rfh = web_contents_->GetPrimaryMainFrame();
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
web_contents_->GetBrowserContext()->GetPermissionControllerDelegate());
|
||||
@@ -252,8 +252,8 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission(
|
||||
auto callback = base::BindOnce(&MediaAccessAllowed, request,
|
||||
std::move(response_callback));
|
||||
|
||||
base::Value::Dict details;
|
||||
base::Value::List media_types;
|
||||
base::DictValue details;
|
||||
base::ListValue media_types;
|
||||
if (request.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) {
|
||||
media_types.Append("audio");
|
||||
@@ -306,7 +306,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture,
|
||||
const GURL& url) {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("externalURL", url.spec());
|
||||
RequestPermission(requesting_frame, blink::PermissionType::OPEN_EXTERNAL,
|
||||
std::move(callback), user_gesture, std::move(details));
|
||||
@@ -315,7 +315,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||
bool WebContentsPermissionHelper::CheckMediaAccessPermission(
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) const {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", security_origin.GetURL().spec());
|
||||
details.Set("mediaType", MediaStreamTypeToString(type));
|
||||
auto blink_type = type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE
|
||||
@@ -326,7 +326,7 @@ bool WebContentsPermissionHelper::CheckMediaAccessPermission(
|
||||
|
||||
bool WebContentsPermissionHelper::CheckSerialAccessPermission(
|
||||
const url::Origin& embedding_origin) const {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", embedding_origin.GetURL().spec());
|
||||
return CheckPermission(blink::PermissionType::SERIAL, std::move(details));
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ class WebContentsPermissionHelper
|
||||
blink::PermissionType permission,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture = false,
|
||||
base::Value::Dict details = {});
|
||||
base::DictValue details = {});
|
||||
|
||||
bool CheckPermission(blink::PermissionType permission,
|
||||
base::Value::Dict details) const;
|
||||
base::DictValue details) const;
|
||||
|
||||
// TODO(clavin): refactor to use the WebContents provided by the
|
||||
// WebContentsUserData base class instead of storing a duplicate ref
|
||||
|
||||
@@ -361,7 +361,7 @@ void WebContentsPreferences::AppendCommandLineSwitches(
|
||||
}
|
||||
|
||||
void WebContentsPreferences::SaveLastPreferences() {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set(options::kNodeIntegration, node_integration_);
|
||||
dict.Set(options::kNodeIntegrationInSubFrames,
|
||||
node_integration_in_sub_frames_);
|
||||
|
||||
@@ -63,7 +63,7 @@ void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
|
||||
}
|
||||
|
||||
double ZoomLevelDelegate::GetDefaultZoomLevelPref() const {
|
||||
const base::Value::Dict& default_zoom_level_dictionary =
|
||||
const base::DictValue& default_zoom_level_dictionary =
|
||||
pref_service_->GetDict(kPartitionDefaultZoomLevel);
|
||||
// If no default has been previously set, the default returned is the
|
||||
// value used to initialize default_zoom_level in this function.
|
||||
@@ -77,15 +77,15 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
||||
|
||||
double level = change.zoom_level;
|
||||
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
|
||||
base::Value::Dict& host_zoom_dictionaries = update.Get();
|
||||
base::DictValue& host_zoom_dictionaries = update.Get();
|
||||
|
||||
bool modification_is_removal =
|
||||
blink::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
|
||||
|
||||
base::Value::Dict* host_zoom_dictionary =
|
||||
base::DictValue* host_zoom_dictionary =
|
||||
host_zoom_dictionaries.FindDict(partition_key_);
|
||||
if (!host_zoom_dictionary) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
host_zoom_dictionaries.Set(partition_key_, std::move(dict));
|
||||
host_zoom_dictionary = host_zoom_dictionaries.FindDict(partition_key_);
|
||||
}
|
||||
@@ -97,9 +97,9 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
||||
}
|
||||
|
||||
void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||
const base::Value::Dict& host_zoom_dictionary) {
|
||||
const base::DictValue& host_zoom_dictionary) {
|
||||
std::vector<std::string> keys_to_remove;
|
||||
base::Value::Dict host_zoom_dictionary_copy = host_zoom_dictionary.Clone();
|
||||
base::DictValue host_zoom_dictionary_copy = host_zoom_dictionary.Clone();
|
||||
for (auto [host, value] : host_zoom_dictionary_copy) {
|
||||
const std::optional<double> zoom_level = value.GetIfDouble();
|
||||
|
||||
@@ -123,7 +123,7 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||
// have an empty host.
|
||||
{
|
||||
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
|
||||
base::Value::Dict* sanitized_host_zoom_dictionary =
|
||||
base::DictValue* sanitized_host_zoom_dictionary =
|
||||
update->FindDict(partition_key_);
|
||||
if (sanitized_host_zoom_dictionary) {
|
||||
for (const std::string& key : keys_to_remove)
|
||||
@@ -143,9 +143,9 @@ void ZoomLevelDelegate::InitHostZoomMap(content::HostZoomMap* host_zoom_map) {
|
||||
|
||||
// Initialize the HostZoomMap with per-host zoom levels from the persisted
|
||||
// zoom-level preference values.
|
||||
const base::Value::Dict& host_zoom_dictionaries =
|
||||
const base::DictValue& host_zoom_dictionaries =
|
||||
pref_service_->GetDict(kPartitionPerHostZoomLevels);
|
||||
const base::Value::Dict* host_zoom_dictionary =
|
||||
const base::DictValue* host_zoom_dictionary =
|
||||
host_zoom_dictionaries.FindDict(partition_key_);
|
||||
if (host_zoom_dictionary) {
|
||||
// Since we're calling this before setting up zoom_subscription_ below we
|
||||
|
||||
@@ -47,7 +47,7 @@ class ZoomLevelDelegate : public content::ZoomLevelDelegate {
|
||||
void InitHostZoomMap(content::HostZoomMap* host_zoom_map) override;
|
||||
|
||||
private:
|
||||
void ExtractPerHostZoomLevels(const base::Value::Dict& host_zoom_dictionary);
|
||||
void ExtractPerHostZoomLevels(const base::DictValue& host_zoom_dictionary);
|
||||
|
||||
// This is a callback function that receives notifications from HostZoomMap
|
||||
// when per-host zoom levels change. It is used to update the per-host
|
||||
|
||||
@@ -339,7 +339,7 @@ float NativeImage::GetAspectRatio(const std::optional<float> scale_factor) {
|
||||
}
|
||||
|
||||
gin_helper::Handle<NativeImage> NativeImage::Resize(gin::Arguments* args,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
float scale_factor = GetScaleFactorFromOptions(args);
|
||||
|
||||
gfx::Size size = GetSize(scale_factor);
|
||||
|
||||
@@ -117,7 +117,7 @@ class NativeImage final : public gin_helper::DeprecatedWrappable<NativeImage> {
|
||||
v8::Local<v8::Value> GetBitmap(gin::Arguments* args);
|
||||
v8::Local<v8::Value> GetNativeHandle(gin_helper::ErrorThrower thrower);
|
||||
gin_helper::Handle<NativeImage> Resize(gin::Arguments* args,
|
||||
base::Value::Dict options);
|
||||
base::DictValue options);
|
||||
gin_helper::Handle<NativeImage> Crop(v8::Isolate* isolate,
|
||||
const gfx::Rect& rect);
|
||||
std::string ToDataURL(gin::Arguments* args);
|
||||
|
||||
@@ -37,16 +37,16 @@ const char kSeparators[] = "\\/";
|
||||
const char kSeparators[] = "/";
|
||||
#endif
|
||||
|
||||
const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
const base::Value::Dict& root);
|
||||
const base::DictValue* GetNodeFromPath(std::string path,
|
||||
const base::DictValue& root);
|
||||
|
||||
// Gets the "files" from "dir".
|
||||
const base::Value::Dict* GetFilesNode(const base::Value::Dict& root,
|
||||
const base::Value::Dict& dir) {
|
||||
const base::DictValue* GetFilesNode(const base::DictValue& root,
|
||||
const base::DictValue& dir) {
|
||||
// Test for symbol linked directory.
|
||||
const std::string* link = dir.FindString("link");
|
||||
if (link != nullptr) {
|
||||
const base::Value::Dict* linked_node = GetNodeFromPath(*link, root);
|
||||
const base::DictValue* linked_node = GetNodeFromPath(*link, root);
|
||||
if (!linked_node)
|
||||
return nullptr;
|
||||
return linked_node->FindDict("files");
|
||||
@@ -56,27 +56,27 @@ const base::Value::Dict* GetFilesNode(const base::Value::Dict& root,
|
||||
}
|
||||
|
||||
// Gets sub-file "name" from "dir".
|
||||
const base::Value::Dict* GetChildNode(const base::Value::Dict& root,
|
||||
const std::string& name,
|
||||
const base::Value::Dict& dir) {
|
||||
const base::DictValue* GetChildNode(const base::DictValue& root,
|
||||
const std::string& name,
|
||||
const base::DictValue& dir) {
|
||||
if (name.empty())
|
||||
return &root;
|
||||
|
||||
const base::Value::Dict* files = GetFilesNode(root, dir);
|
||||
const base::DictValue* files = GetFilesNode(root, dir);
|
||||
return files ? files->FindDict(name) : nullptr;
|
||||
}
|
||||
|
||||
// Gets the node of "path" from "root".
|
||||
const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
const base::Value::Dict& root) {
|
||||
const base::DictValue* GetNodeFromPath(std::string path,
|
||||
const base::DictValue& root) {
|
||||
if (path.empty())
|
||||
return &root;
|
||||
|
||||
const base::Value::Dict* dir = &root;
|
||||
const base::DictValue* dir = &root;
|
||||
for (size_t delimiter_position = path.find_first_of(kSeparators);
|
||||
delimiter_position != std::string::npos;
|
||||
delimiter_position = path.find_first_of(kSeparators)) {
|
||||
const base::Value::Dict* child =
|
||||
const base::DictValue* child =
|
||||
GetChildNode(root, path.substr(0, delimiter_position), *dir);
|
||||
if (!child)
|
||||
return nullptr;
|
||||
@@ -91,7 +91,7 @@ const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
bool FillFileInfoWithNode(Archive::FileInfo* info,
|
||||
uint32_t header_size,
|
||||
bool load_integrity,
|
||||
const base::Value::Dict* node) {
|
||||
const base::DictValue* node) {
|
||||
if (std::optional<int> size = node->FindInt("size")) {
|
||||
info->size = static_cast<uint32_t>(*size);
|
||||
} else {
|
||||
@@ -120,11 +120,11 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
|
||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
|
||||
if (load_integrity &&
|
||||
electron::fuses::IsEmbeddedAsarIntegrityValidationEnabled()) {
|
||||
if (const base::Value::Dict* integrity = node->FindDict("integrity")) {
|
||||
if (const base::DictValue* integrity = node->FindDict("integrity")) {
|
||||
const std::string* algorithm = integrity->FindString("algorithm");
|
||||
const std::string* hash = integrity->FindString("hash");
|
||||
std::optional<int> block_size = integrity->FindInt("blockSize");
|
||||
const base::Value::List* blocks = integrity->FindList("blocks");
|
||||
const base::ListValue* blocks = integrity->FindList("blocks");
|
||||
|
||||
if (algorithm && hash && block_size && block_size > 0 && blocks) {
|
||||
IntegrityPayload integrity_payload;
|
||||
@@ -281,8 +281,7 @@ bool Archive::GetFileInfo(const base::FilePath& path, FileInfo* info) const {
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
@@ -297,8 +296,7 @@ bool Archive::Stat(const base::FilePath& path, Stats* stats) const {
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
@@ -320,12 +318,11 @@ bool Archive::Readdir(const base::FilePath& path,
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* files_node = GetFilesNode(*header_, *node);
|
||||
const base::DictValue* files_node = GetFilesNode(*header_, *node);
|
||||
if (!files_node)
|
||||
return false;
|
||||
|
||||
@@ -339,8 +336,7 @@ bool Archive::Realpath(const base::FilePath& path,
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class Archive {
|
||||
base::File file_{base::File::FILE_OK};
|
||||
int fd_ = -1;
|
||||
uint32_t header_size_ = 0;
|
||||
std::optional<base::Value::Dict> header_;
|
||||
std::optional<base::DictValue> header_;
|
||||
|
||||
// Cached external temporary files.
|
||||
base::Lock external_files_lock_;
|
||||
|
||||
@@ -78,7 +78,7 @@ auto LoadIntegrityConfig() {
|
||||
LOG(FATAL) << "Invalid integrity config: NOT a valid JSON.";
|
||||
}
|
||||
|
||||
const base::Value::List* file_configs = root.value().GetIfList();
|
||||
const base::ListValue* file_configs = root.value().GetIfList();
|
||||
if (!file_configs) {
|
||||
LOG(FATAL) << "Invalid integrity config: NOT a list.";
|
||||
}
|
||||
@@ -87,7 +87,7 @@ auto LoadIntegrityConfig() {
|
||||
cache.reserve(file_configs->size());
|
||||
for (size_t i = 0; i < file_configs->size(); i++) {
|
||||
// Skip invalid file configs
|
||||
const base::Value::Dict* ele_dict = (*file_configs)[i].GetIfDict();
|
||||
const base::DictValue* ele_dict = (*file_configs)[i].GetIfDict();
|
||||
if (!ele_dict) {
|
||||
LOG(WARNING) << "Skip config " << i << ": NOT a valid dict";
|
||||
continue;
|
||||
|
||||
@@ -19,11 +19,11 @@ struct Converter<device::mojom::HidDeviceInfoPtr> {
|
||||
v8::Isolate* isolate,
|
||||
const device::mojom::HidDeviceInfoPtr& device) {
|
||||
base::Value value = electron::HidChooserContext::DeviceInfoToValue(*device);
|
||||
base::Value::Dict& dict = value.GetDict();
|
||||
base::DictValue& dict = value.GetDict();
|
||||
dict.Set("deviceId",
|
||||
electron::HidChooserController::PhysicalDeviceIdFromDeviceInfo(
|
||||
*device));
|
||||
return gin::Converter<base::Value::Dict>::ToV8(isolate, dict);
|
||||
return gin::Converter<base::DictValue>::ToV8(isolate, dict);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -164,16 +164,16 @@ v8::Local<v8::Value> Converter<net::CertPrincipal>::ToV8(
|
||||
v8::Local<v8::Value> Converter<net::HttpResponseHeaders*>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
net::HttpResponseHeaders* headers) {
|
||||
base::Value::Dict response_headers;
|
||||
base::DictValue response_headers;
|
||||
if (headers) {
|
||||
size_t iter = 0;
|
||||
std::string key;
|
||||
std::string value;
|
||||
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
||||
key = base::ToLowerASCII(key);
|
||||
base::Value::List* values = response_headers.FindList(key);
|
||||
base::ListValue* values = response_headers.FindList(key);
|
||||
if (!values)
|
||||
values = &response_headers.Set(key, base::Value::List())->GetList();
|
||||
values = &response_headers.Set(key, base::ListValue())->GetList();
|
||||
values->Append(value);
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ v8::Local<v8::Value> Converter<net::HttpRequestHeaders>::ToV8(
|
||||
bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
net::HttpRequestHeaders* out) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
if (!ConvertFromV8(isolate, val, &dict))
|
||||
return false;
|
||||
for (const auto it : dict) {
|
||||
@@ -588,12 +588,12 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
||||
base::Value list_value;
|
||||
if (!ConvertFromV8(isolate, val, &list_value) || !list_value.is_list())
|
||||
return false;
|
||||
base::Value::List& list = list_value.GetList();
|
||||
base::ListValue& list = list_value.GetList();
|
||||
*out = base::MakeRefCounted<network::ResourceRequestBody>();
|
||||
for (base::Value& dict_value : list) {
|
||||
if (!dict_value.is_dict())
|
||||
return false;
|
||||
base::Value::Dict& dict = dict_value.GetDict();
|
||||
base::DictValue& dict = dict_value.GetDict();
|
||||
std::string* type = dict.FindString("type");
|
||||
if (!type)
|
||||
return false;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
namespace gin {
|
||||
|
||||
bool Converter<base::Value::Dict>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::Dict* out) {
|
||||
bool Converter<base::DictValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::DictValue* out) {
|
||||
std::unique_ptr<base::Value> value =
|
||||
content::V8ValueConverter::Create()->FromV8Value(
|
||||
val, isolate->GetCurrentContext());
|
||||
@@ -46,9 +46,9 @@ v8::Local<v8::Value> Converter<base::ValueView>::ToV8(
|
||||
val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::Value::List>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::List* out) {
|
||||
bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::ListValue* out) {
|
||||
std::unique_ptr<base::Value> value =
|
||||
content::V8ValueConverter::Create()->FromV8Value(
|
||||
val, isolate->GetCurrentContext());
|
||||
|
||||
@@ -17,12 +17,12 @@ struct Converter<base::ValueView> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::Value::Dict> {
|
||||
struct Converter<base::DictValue> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::Dict* out);
|
||||
base::DictValue* out);
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::Value::Dict& val) {
|
||||
const base::DictValue& val) {
|
||||
return gin::ConvertToV8(isolate, base::ValueView{val});
|
||||
}
|
||||
};
|
||||
@@ -39,12 +39,12 @@ struct Converter<base::Value> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::Value::List> {
|
||||
struct Converter<base::ListValue> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::List* out);
|
||||
base::ListValue* out);
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::Value::List& val) {
|
||||
const base::ListValue& val) {
|
||||
return gin::ConvertToV8(isolate, base::ValueView{val});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -115,7 +115,7 @@ node::Environment* CreateEnvironment(v8::Isolate* isolate,
|
||||
node::Environment* env = node::CreateEnvironment(isolate_data, context, args,
|
||||
exec_args, env_flags);
|
||||
if (auto message = try_catch.Message(); !message.IsEmpty()) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
if (std::string str; gin::ConvertFromV8(isolate, message->Get(), &str))
|
||||
dict.Set("message", std::move(str));
|
||||
|
||||
@@ -51,7 +51,7 @@ bool PrintRenderFrameHelperDelegate::OverridePrint(
|
||||
// instructs the PDF plugin to print. This is to make window.print() on a
|
||||
// PDF plugin document correctly print the PDF. See
|
||||
// https://crbug.com/448720.
|
||||
base::Value::Dict message;
|
||||
base::DictValue message;
|
||||
message.Set("type", "print");
|
||||
post_message_support->PostMessageFromValue(base::Value(std::move(message)));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user