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

Unified Diff: chrome/renderer/render_view.cc

Issue 6532012: Set the minimum timer interval on a per-page basis, and adjust it when... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webkit_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 75329)
+++ chrome/renderer/render_view.cc (working copy)
@@ -185,6 +185,7 @@
#include "webkit/glue/site_isolation_metrics.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webdropdata.h"
+#include "webkit/glue/webkit_constants.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webmediaplayer_impl.h"
#include "webkit/plugins/npapi/default_plugin_shared.h"
@@ -5370,29 +5371,41 @@
FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event));
}
-#if defined(OS_MACOSX)
void RenderView::OnWasHidden() {
RenderWidget::OnWasHidden();
+ if (webview()) {
+ webview()->settings()->setMinimumTimerInterval(
+ webkit_glue::kBackgroundTabTimerInterval);
+ }
+
+#if defined(OS_MACOSX)
// Inform plugins that their container is no longer visible.
std::set<WebPluginDelegateProxy*>::iterator plugin_it;
for (plugin_it = plugin_delegates_.begin();
plugin_it != plugin_delegates_.end(); ++plugin_it) {
(*plugin_it)->SetContainerVisibility(false);
}
+#endif // OS_MACOSX
}
void RenderView::OnWasRestored(bool needs_repainting) {
RenderWidget::OnWasRestored(needs_repainting);
+ if (webview()) {
+ webview()->settings()->setMinimumTimerInterval(
+ webkit_glue::kForegroundTabTimerInterval);
+ }
+
+#if defined(OS_MACOSX)
// Inform plugins that their container is now visible.
std::set<WebPluginDelegateProxy*>::iterator plugin_it;
for (plugin_it = plugin_delegates_.begin();
plugin_it != plugin_delegates_.end(); ++plugin_it) {
(*plugin_it)->SetContainerVisibility(true);
}
+#endif // OS_MACOSX
}
-#endif // OS_MACOSX
void RenderView::OnSetFocus(bool enable) {
RenderWidget::OnSetFocus(enable);
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webkit_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698