refactor: remove base::Value from WebContentsPreferences (#30193)
This commit is contained in:
parent
64ba8feb93
commit
385d0f590f
10 changed files with 433 additions and 415 deletions
|
@ -61,7 +61,7 @@ void ElectronJavaScriptDialogManager::RunJavaScriptDialog(
|
|||
|
||||
auto* web_preferences = WebContentsPreferences::From(web_contents);
|
||||
|
||||
if (web_preferences && web_preferences->IsEnabled("disableDialogs")) {
|
||||
if (web_preferences && web_preferences->ShouldDisableDialogs()) {
|
||||
return std::move(callback).Run(false, std::u16string());
|
||||
}
|
||||
|
||||
|
@ -81,14 +81,14 @@ void ElectronJavaScriptDialogManager::RunJavaScriptDialog(
|
|||
|
||||
std::string checkbox;
|
||||
if (origin_counts_[origin] > 1 && web_preferences &&
|
||||
web_preferences->IsEnabled("safeDialogs") &&
|
||||
!web_preferences->GetPreference("safeDialogsMessage", &checkbox)) {
|
||||
web_preferences->ShouldUseSafeDialogs() &&
|
||||
!web_preferences->GetSafeDialogsMessage(&checkbox)) {
|
||||
checkbox = "Prevent this app from creating additional dialogs";
|
||||
}
|
||||
|
||||
// Don't set parent for offscreen window.
|
||||
NativeWindow* window = nullptr;
|
||||
if (web_preferences && !web_preferences->IsEnabled(options::kOffscreen)) {
|
||||
if (web_preferences && !web_preferences->IsOffscreen()) {
|
||||
auto* relay = NativeWindowRelay::FromWebContents(web_contents);
|
||||
if (relay)
|
||||
window = relay->GetNativeWindow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue