Plugin Power Saver: Fix implicitly sized and below the fold plugins.

This patch changes a few behaviors.

1. Make implicitly sized (e.g. width="100%") plugins work with Plugin Power Saver. Previously sizes were read from plugin parameters, which doesn't work for implicitly sized plugins. Now, we look at the actual blink::WebRect view bounds.

2. Timeout keyframe extraction after 150 frames rather than a fixed 5 seconds. The previous behavior was broken for plugins that are loaded off-screen. (The countdown begins even though no frames are being generated until the plugin goes on-screen).

3. When "Detect and run..." is on, always respect the 'poster' parameter. This is a tweak to the existing behavior, which is to use the 'poster' param only for peripheral plugins. This should have no user impact, since no one actually uses the 'poster' param right now.

4. Clean up metric collection in LoadablePluginPlaceholder. Previous behavior was overcounting in some circumstances.

5. Reduces RenderFrame public interface and total SLOC.

BUG=443431,456217, 403800

Review URL: https://codereview.chromium.org/904913003

Cr-Commit-Position: refs/heads/master@{#315393}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 7c56df7..9c53107 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -315,11 +315,9 @@
   void RegisterPeripheralPlugin(
       const GURL& content_origin,
       const base::Closure& unthrottle_callback) override;
-  bool ShouldThrottleContent(const blink::WebPluginParams& params,
-                             const GURL& page_frame_url,
-                             GURL* poster_image,
-                             bool* cross_origin_main_content) const override;
-  void WhitelistContentOrigin(const GURL& content_origin) override;
+  PluginPowerSaverHelper* plugin_power_saver_helper() {
+    return plugin_power_saver_helper_;
+  }
 #endif
   bool IsFTPDirectoryListing() override;
   void AttachGuest(int element_instance_id) override;