| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_RENDERER_PLUGINS_POWER_SAVER_INFO_H_ | |
| 6 #define CHROME_RENDERER_PLUGINS_POWER_SAVER_INFO_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ui/gfx/geometry/size.h" | |
| 11 #include "url/gurl.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 struct WebPluginParams; | |
| 15 } | |
| 16 | |
| 17 namespace content { | |
| 18 class RenderFrame; | |
| 19 struct WebPluginInfo; | |
| 20 } | |
| 21 | |
| 22 // This contains information specifying the plugin's Power Saver behavior. | |
| 23 // The default constructor has Plugin Power Saver disabled. | |
| 24 struct PowerSaverInfo { | |
| 25 PowerSaverInfo(); | |
| 26 | |
| 27 // Determines the PowerSaverInfo using the peripheral content heuristic. | |
| 28 static PowerSaverInfo Get(content::RenderFrame* render_frame, | |
| 29 bool power_saver_setting_on, | |
| 30 const blink::WebPluginParams& params, | |
| 31 const content::WebPluginInfo& plugin_info, | |
| 32 const GURL& document_url); | |
| 33 | |
| 34 // Whether power saver should be enabled. | |
| 35 bool power_saver_enabled; | |
| 36 | |
| 37 // Whether the plugin should be deferred because it is in a background tab. | |
| 38 bool blocked_for_background_tab; | |
| 39 | |
| 40 // The poster image specified in image 'srcset' attribute format. | |
| 41 std::string poster_attribute; | |
| 42 | |
| 43 // Used to resolve relative paths in |poster_attribute|. | |
| 44 GURL base_url; | |
| 45 | |
| 46 // Specify this to provide partially obscured plugins a centered poster image. | |
| 47 gfx::Size custom_poster_size; | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_RENDERER_PLUGINS_POWER_SAVER_INFO_H_ | |
| OLD | NEW |