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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 680193002: Plugin Power Saver: Implement size-based heuristic for peripheral content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/metrics/stats_counters.h" 14 #include "base/metrics/stats_counters.h"
15 #include "base/process/process.h" 15 #include "base/process/process.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "content/browser/accessibility/accessibility_mode_helper.h" 21 #include "content/browser/accessibility/accessibility_mode_helper.h"
22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 22 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
23 #include "content/browser/browser_plugin/browser_plugin_content_origin_whitelist .h"
23 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 24 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
24 #include "content/browser/browser_plugin/browser_plugin_guest.h" 25 #include "content/browser/browser_plugin/browser_plugin_guest.h"
25 #include "content/browser/child_process_security_policy_impl.h" 26 #include "content/browser/child_process_security_policy_impl.h"
26 #include "content/browser/devtools/devtools_manager.h" 27 #include "content/browser/devtools/devtools_manager.h"
27 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 28 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
28 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 29 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
29 #include "content/browser/download/download_stats.h" 30 #include "content/browser/download/download_stats.h"
30 #include "content/browser/download/mhtml_generation_manager.h" 31 #include "content/browser/download/mhtml_generation_manager.h"
31 #include "content/browser/download/save_package.h" 32 #include "content/browser/download/save_package.h"
32 #include "content/browser/frame_host/cross_process_frame_connector.h" 33 #include "content/browser/frame_host/cross_process_frame_connector.h"
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 CHECK(render_view_host_delegate_view_); 1175 CHECK(render_view_host_delegate_view_);
1175 CHECK(view_.get()); 1176 CHECK(view_.get());
1176 1177
1177 gfx::Size initial_size = params.initial_size; 1178 gfx::Size initial_size = params.initial_size;
1178 view_->CreateView(initial_size, params.context); 1179 view_->CreateView(initial_size, params.context);
1179 1180
1180 // Listen for whether our opener gets destroyed. 1181 // Listen for whether our opener gets destroyed.
1181 if (opener_) 1182 if (opener_)
1182 AddDestructionObserver(opener_); 1183 AddDestructionObserver(opener_);
1183 1184
1185 #if defined(ENABLE_PLUGINS)
1186 browser_plugin_content_origin_whitelist_.reset(
1187 new BrowserPluginContentOriginWhitelist(this));
1188 #endif
1189
1184 registrar_.Add(this, 1190 registrar_.Add(this,
1185 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1191 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1186 NotificationService::AllBrowserContextsAndSources()); 1192 NotificationService::AllBrowserContextsAndSources());
1187 1193
1188 geolocation_dispatcher_host_.reset(new GeolocationDispatcherHost(this)); 1194 geolocation_dispatcher_host_.reset(new GeolocationDispatcherHost(this));
1189 midi_dispatcher_host_.reset(new MidiDispatcherHost(this)); 1195 midi_dispatcher_host_.reset(new MidiDispatcherHost(this));
1190 1196
1191 screen_orientation_dispatcher_host_.reset( 1197 screen_orientation_dispatcher_host_.reset(
1192 new ScreenOrientationDispatcherHostImpl(this)); 1198 new ScreenOrientationDispatcherHostImpl(this));
1193 1199
(...skipping 3136 matching lines...) Expand 10 before | Expand all | Expand 10 after
4330 node->render_manager()->ResumeResponseDeferredAtStart(); 4336 node->render_manager()->ResumeResponseDeferredAtStart();
4331 } 4337 }
4332 4338
4333 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4339 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4334 force_disable_overscroll_content_ = force_disable; 4340 force_disable_overscroll_content_ = force_disable;
4335 if (view_) 4341 if (view_)
4336 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4342 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4337 } 4343 }
4338 4344
4339 } // namespace content 4345 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698