Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1337)

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 785723002: Add new extension APIs related to animation policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index bd37a3cbb05e221e57d090cad2642c1a0d5d627b..04426da78cd53a714f01cc0714ac014e8b90a6f1 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -24,6 +24,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "cc/base/switches.h"
+#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/frame_host/frame_tree.h"
@@ -518,6 +519,15 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs(const GURL& url) {
prefs.v8_script_streaming_mode =
V8_SCRIPT_STREAMING_MODE_ONLY_ASYNC_AND_DEFER;
+ std::string image_animation_policy =
+ BrowserAccessibilityStateImpl::GetInstance()->GetImageAnimationPolicy();
+ if (image_animation_policy == "Allowed")
+ prefs.animation_policy = IMAGE_ANIMATION_POLICY_ALLOWED;
dmazzoni 2014/12/08 07:46:01 nit: just 2 spaces indent for an "if" block. (Line
+ else if (image_animation_policy == "Once")
+ prefs.animation_policy = IMAGE_ANIMATION_POLICY_ANIMATION_ONCE;
+ else if (image_animation_policy == "None")
+ prefs.animation_policy = IMAGE_ANIMATION_POLICY_NO_ANIMATION;
+
GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs);
return prefs;
}

Powered by Google App Engine
This is Rietveld 408576698