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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2914913002: [Mac] Enable AppNap for renderers (Closed)
Patch Set: Add comment for magic numbers Created 3 years, 6 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
« no previous file with comments | « content/common/mac/app_nap_activity.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 116d31a8431f2b892b4bb51655a92834a6f5405e..3dad83a9d7861aab8e23fa5b369c123a3f984767 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -189,6 +189,8 @@
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
+#include "base/process/process.h"
+#include "content/common/mac/app_nap_activity.h"
#include "content/renderer/theme_helper_mac.h"
#include "content/renderer/webscrollbarbehavior_impl_mac.h"
#endif
@@ -799,6 +801,10 @@ void RenderThreadImpl::Init(
Boolean value = CFPreferencesGetAppBooleanValue(
key, kCFPreferencesCurrentApplication, &key_exists);
is_elastic_overscroll_enabled_ = !key_exists || value;
+
+ if (base::Process::IsAppNapEnabled()) {
+ AppNapActivity::InitializeAppNapSupport();
+ }
#else
is_elastic_overscroll_enabled_ = false;
#endif
« no previous file with comments | « content/common/mac/app_nap_activity.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698