feat: add new imageAnimationPolicy webpref and webContents setter (#29095)
This commit is contained in:
parent
79cb5144ae
commit
8446ce1fc7
7 changed files with 51 additions and 0 deletions
|
@ -3142,6 +3142,13 @@ void WebContents::NotifyUserActivation() {
|
|||
blink::mojom::UserActivationNotificationType::kInteraction);
|
||||
}
|
||||
|
||||
void WebContents::SetImageAnimationPolicy(const std::string& new_policy) {
|
||||
auto* web_preferences = WebContentsPreferences::From(web_contents());
|
||||
web_preferences->preference()->SetKey(options::kImageAnimationPolicy,
|
||||
base::Value(new_policy));
|
||||
web_contents()->OnWebPreferencesChanged();
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> WebContents::TakeHeapSnapshot(
|
||||
v8::Isolate* isolate,
|
||||
const base::FilePath& file_path) {
|
||||
|
@ -3689,6 +3696,8 @@ v8::Local<v8::ObjectTemplate> WebContents::FillObjectTemplate(
|
|||
&WebContents::GetWebRTCIPHandlingPolicy)
|
||||
.SetMethod("_grantOriginAccess", &WebContents::GrantOriginAccess)
|
||||
.SetMethod("takeHeapSnapshot", &WebContents::TakeHeapSnapshot)
|
||||
.SetMethod("setImageAnimationPolicy",
|
||||
&WebContents::SetImageAnimationPolicy)
|
||||
.SetProperty("id", &WebContents::ID)
|
||||
.SetProperty("session", &WebContents::Session)
|
||||
.SetProperty("hostWebContents", &WebContents::HostWebContents)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue