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