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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webkit_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 #include "webkit/glue/form_field.h" 178 #include "webkit/glue/form_field.h"
179 #include "webkit/glue/glue_serialize.h" 179 #include "webkit/glue/glue_serialize.h"
180 #include "webkit/glue/image_decoder.h" 180 #include "webkit/glue/image_decoder.h"
181 #include "webkit/glue/image_resource_fetcher.h" 181 #include "webkit/glue/image_resource_fetcher.h"
182 #include "webkit/glue/media/video_renderer_impl.h" 182 #include "webkit/glue/media/video_renderer_impl.h"
183 #include "webkit/glue/password_form_dom_manager.h" 183 #include "webkit/glue/password_form_dom_manager.h"
184 #include "webkit/glue/resource_fetcher.h" 184 #include "webkit/glue/resource_fetcher.h"
185 #include "webkit/glue/site_isolation_metrics.h" 185 #include "webkit/glue/site_isolation_metrics.h"
186 #include "webkit/glue/webaccessibility.h" 186 #include "webkit/glue/webaccessibility.h"
187 #include "webkit/glue/webdropdata.h" 187 #include "webkit/glue/webdropdata.h"
188 #include "webkit/glue/webkit_constants.h"
188 #include "webkit/glue/webkit_glue.h" 189 #include "webkit/glue/webkit_glue.h"
189 #include "webkit/glue/webmediaplayer_impl.h" 190 #include "webkit/glue/webmediaplayer_impl.h"
190 #include "webkit/plugins/npapi/default_plugin_shared.h" 191 #include "webkit/plugins/npapi/default_plugin_shared.h"
191 #include "webkit/plugins/npapi/plugin_list.h" 192 #include "webkit/plugins/npapi/plugin_list.h"
192 #include "webkit/plugins/npapi/webplugin_delegate.h" 193 #include "webkit/plugins/npapi/webplugin_delegate.h"
193 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 194 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
194 #include "webkit/plugins/npapi/webplugin_impl.h" 195 #include "webkit/plugins/npapi/webplugin_impl.h"
195 #include "webkit/plugins/npapi/webview_plugin.h" 196 #include "webkit/plugins/npapi/webview_plugin.h"
196 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 197 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
197 198
(...skipping 5165 matching lines...) Expand 10 before | Expand all | Expand 10 after
5363 } 5364 }
5364 5365
5365 void RenderView::DidHandleKeyEvent() { 5366 void RenderView::DidHandleKeyEvent() {
5366 edit_commands_.clear(); 5367 edit_commands_.clear();
5367 } 5368 }
5368 5369
5369 void RenderView::DidHandleMouseEvent(const WebKit::WebMouseEvent& event) { 5370 void RenderView::DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {
5370 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); 5371 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event));
5371 } 5372 }
5372 5373
5373 #if defined(OS_MACOSX)
5374 void RenderView::OnWasHidden() { 5374 void RenderView::OnWasHidden() {
5375 RenderWidget::OnWasHidden(); 5375 RenderWidget::OnWasHidden();
5376 5376
5377 if (webview()) {
5378 webview()->settings()->setMinimumTimerInterval(
5379 webkit_glue::kBackgroundTabTimerInterval);
5380 }
5381
5382 #if defined(OS_MACOSX)
5377 // Inform plugins that their container is no longer visible. 5383 // Inform plugins that their container is no longer visible.
5378 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 5384 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
5379 for (plugin_it = plugin_delegates_.begin(); 5385 for (plugin_it = plugin_delegates_.begin();
5380 plugin_it != plugin_delegates_.end(); ++plugin_it) { 5386 plugin_it != plugin_delegates_.end(); ++plugin_it) {
5381 (*plugin_it)->SetContainerVisibility(false); 5387 (*plugin_it)->SetContainerVisibility(false);
5382 } 5388 }
5389 #endif // OS_MACOSX
5383 } 5390 }
5384 5391
5385 void RenderView::OnWasRestored(bool needs_repainting) { 5392 void RenderView::OnWasRestored(bool needs_repainting) {
5386 RenderWidget::OnWasRestored(needs_repainting); 5393 RenderWidget::OnWasRestored(needs_repainting);
5387 5394
5395 if (webview()) {
5396 webview()->settings()->setMinimumTimerInterval(
5397 webkit_glue::kForegroundTabTimerInterval);
5398 }
5399
5400 #if defined(OS_MACOSX)
5388 // Inform plugins that their container is now visible. 5401 // Inform plugins that their container is now visible.
5389 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 5402 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
5390 for (plugin_it = plugin_delegates_.begin(); 5403 for (plugin_it = plugin_delegates_.begin();
5391 plugin_it != plugin_delegates_.end(); ++plugin_it) { 5404 plugin_it != plugin_delegates_.end(); ++plugin_it) {
5392 (*plugin_it)->SetContainerVisibility(true); 5405 (*plugin_it)->SetContainerVisibility(true);
5393 } 5406 }
5407 #endif // OS_MACOSX
5394 } 5408 }
5395 #endif // OS_MACOSX
5396 5409
5397 void RenderView::OnSetFocus(bool enable) { 5410 void RenderView::OnSetFocus(bool enable) {
5398 RenderWidget::OnSetFocus(enable); 5411 RenderWidget::OnSetFocus(enable);
5399 5412
5400 if (webview() && webview()->isActive()) { 5413 if (webview() && webview()->isActive()) {
5401 // Notify all NPAPI plugins. 5414 // Notify all NPAPI plugins.
5402 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 5415 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
5403 for (plugin_it = plugin_delegates_.begin(); 5416 for (plugin_it = plugin_delegates_.begin();
5404 plugin_it != plugin_delegates_.end(); ++plugin_it) { 5417 plugin_it != plugin_delegates_.end(); ++plugin_it) {
5405 #if defined(OS_MACOSX) 5418 #if defined(OS_MACOSX)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
5677 } 5690 }
5678 } 5691 }
5679 5692
5680 void RenderView::OnContextMenuClosed( 5693 void RenderView::OnContextMenuClosed(
5681 const webkit_glue::CustomContextMenuContext& custom_context) { 5694 const webkit_glue::CustomContextMenuContext& custom_context) {
5682 if (custom_context.is_pepper_menu) 5695 if (custom_context.is_pepper_menu)
5683 pepper_delegate_.OnContextMenuClosed(custom_context); 5696 pepper_delegate_.OnContextMenuClosed(custom_context);
5684 else 5697 else
5685 context_menu_node_.reset(); 5698 context_menu_node_.reset();
5686 } 5699 }
OLDNEW
« 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