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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 785723002: Add new extension APIs related to animation policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 months 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: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 83b62c9740b6ff4b62972d7c5675376ab7a252b2..dc10e10aa2c47238560178fd38d14a65356a3f47 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -222,6 +222,7 @@
#endif
#if defined(ENABLE_EXTENSIONS)
+#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/media/cast_transport_host_filter.h"
@@ -2219,6 +2220,18 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
web_prefs->hyperlink_auditing_enabled =
prefs->GetBoolean(prefs::kEnableHyperlinkAuditing);
+#if defined(ENABLE_EXTENSIONS)
+ std::string image_animation_policy =
+ prefs->GetString(prefs::kAnimationPolicy);
+ if (image_animation_policy == kAnimationPolicyOnce)
+ web_prefs->animation_policy =
+ content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE;
+ else if (image_animation_policy == kAnimationPolicyNone)
+ web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION;
+ else
+ web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED;
+#endif
+
// Make sure we will set the default_encoding with canonical encoding name.
web_prefs->default_encoding =
CharacterEncoding::GetCanonicalEncodingNameByAliasName(
« no previous file with comments | « chrome/browser/accessibility/animation_policy_prefs.cc ('k') | chrome/browser/extensions/api/preference/preference_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698