mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove deprecated base::[Dictionary|List]Value API usage
This commit is contained in:
@@ -61,9 +61,9 @@ bool CefPrintRenderFrameHelperDelegate::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::DictionaryValue message;
|
||||
message.SetString("type", "print");
|
||||
post_message_support->PostMessageFromValue(message);
|
||||
base::Value::Dict message;
|
||||
message.Set("type", "print");
|
||||
post_message_support->PostMessageFromValue(base::Value(std::move(message)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@@ -290,7 +290,7 @@ void CefFrameImpl::SendProcessMessage(CefProcessId target_process,
|
||||
SendToBrowserFrame(
|
||||
__FUNCTION__,
|
||||
base::BindOnce(
|
||||
[](const CefString& name, base::ListValue argument_list,
|
||||
[](const CefString& name, base::Value::List argument_list,
|
||||
const BrowserFrameType& render_frame) {
|
||||
render_frame->SendMessage(name, std::move(argument_list));
|
||||
},
|
||||
@@ -732,13 +732,13 @@ void CefFrameImpl::FrameDetached() {
|
||||
OnDisconnect(DisconnectReason::BROWSER_FRAME_DETACHED);
|
||||
}
|
||||
|
||||
void CefFrameImpl::SendMessage(const std::string& name, base::Value arguments) {
|
||||
void CefFrameImpl::SendMessage(const std::string& name,
|
||||
base::Value::List arguments) {
|
||||
if (auto app = CefAppManager::Get()->GetApplication()) {
|
||||
if (auto handler = app->GetRenderProcessHandler()) {
|
||||
auto& list_value = base::Value::AsListValue(arguments);
|
||||
CefRefPtr<CefProcessMessageImpl> message(new CefProcessMessageImpl(
|
||||
name, std::move(const_cast<base::ListValue&>(list_value)),
|
||||
/*read_only=*/true));
|
||||
CefRefPtr<CefProcessMessageImpl> message(
|
||||
new CefProcessMessageImpl(name, std::move(arguments),
|
||||
/*read_only=*/true));
|
||||
handler->OnProcessMessageReceived(browser_, this, PID_BROWSER,
|
||||
message.get());
|
||||
}
|
||||
@@ -835,8 +835,9 @@ void CefFrameImpl::DidStopLoading() {
|
||||
void CefFrameImpl::MoveOrResizeStarted() {
|
||||
if (frame_) {
|
||||
auto web_view = frame_->View();
|
||||
if (web_view)
|
||||
if (web_view) {
|
||||
web_view->CancelPagePopup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -149,7 +149,8 @@ class CefFrameImpl
|
||||
// cef::mojom::RenderFrame methods:
|
||||
void FrameAttachedAck() override;
|
||||
void FrameDetached() override;
|
||||
void SendMessage(const std::string& name, base::Value arguments) override;
|
||||
void SendMessage(const std::string& name,
|
||||
base::Value::List arguments) override;
|
||||
void SendSharedMemoryRegion(const std::string& name,
|
||||
base::ReadOnlySharedMemoryRegion region) override;
|
||||
void SendCommand(const std::string& command) override;
|
||||
|
@@ -350,15 +350,11 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CefDictionaryValueImpl> dictValuePtr;
|
||||
if (params->extra_info) {
|
||||
auto& dict_value = base::Value::AsDictionaryValue(*params->extra_info);
|
||||
dictValuePtr = new CefDictionaryValueImpl(
|
||||
const_cast<base::DictionaryValue*>(&dict_value),
|
||||
/*will_delete=*/false, /*read_only=*/true);
|
||||
dictValuePtr =
|
||||
new CefDictionaryValueImpl(std::move(*params->extra_info),
|
||||
/*read_only=*/true);
|
||||
}
|
||||
handler->OnBrowserCreated(browser.get(), dictValuePtr.get());
|
||||
if (dictValuePtr) {
|
||||
std::ignore = dictValuePtr->Detach(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user