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

Side by Side Diff: chrome/renderer/plugins/power_saver_info.h

Issue 1497623002: Plugin Power Saver: Improve Poster behavior for essential plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
(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_
OLDNEW
« no previous file with comments | « chrome/renderer/plugins/plugin_preroller.cc ('k') | chrome/renderer/plugins/power_saver_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698