| Index: content/renderer/peripheral_content_heuristic.h
|
| diff --git a/content/renderer/peripheral_content_heuristic.h b/content/renderer/peripheral_content_heuristic.h
|
| index 5b28693cdda5827b8e13f60e950b28c5d134b0b3..251edaa966c49680c65c28d9006f9d21716a2a41 100644
|
| --- a/content/renderer/peripheral_content_heuristic.h
|
| +++ b/content/renderer/peripheral_content_heuristic.h
|
| @@ -8,24 +8,17 @@
|
| #include <set>
|
|
|
| #include "content/common/content_export.h"
|
| +#include "content/public/renderer/render_frame.h"
|
| #include "url/origin.h"
|
|
|
| +namespace gfx {
|
| +class Size;
|
| +}
|
| +
|
| namespace content {
|
|
|
| class CONTENT_EXPORT PeripheralContentHeuristic {
|
| public:
|
| - // Initial decision of the peripheral content decision.
|
| - // These numeric values are used in UMA logs; do not change them.
|
| - enum Decision {
|
| - HEURISTIC_DECISION_PERIPHERAL = 0,
|
| - HEURISTIC_DECISION_ESSENTIAL_SAME_ORIGIN = 1,
|
| - HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_BIG = 2,
|
| - HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_WHITELISTED = 3,
|
| - HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_TINY = 4,
|
| - HEURISTIC_DECISION_ESSENTIAL_UNKNOWN_SIZE = 5,
|
| - HEURISTIC_DECISION_NUM_ITEMS
|
| - };
|
| -
|
| // Returns true if this content should have power saver enabled.
|
| //
|
| // Power Saver is enabled for content that are cross-origin and
|
| @@ -43,17 +36,16 @@ class CONTENT_EXPORT PeripheralContentHeuristic {
|
| //
|
| // |content_origin| is the origin of the content e.g. plugin or video source.
|
| //
|
| - // |width| and |height| are zoom and device scale independent logical pixels.
|
| - static Decision GetPeripheralStatus(
|
| + // |unobscured_size| is in zoom and device scale independent logical pixels.
|
| + static RenderFrame::PeripheralContentStatus GetPeripheralStatus(
|
| const std::set<url::Origin>& origin_whitelist,
|
| const url::Origin& main_frame_origin,
|
| const url::Origin& content_origin,
|
| - int width,
|
| - int height);
|
| + const gfx::Size& unobscured_size);
|
|
|
| // Returns true if content is considered "large", and thus essential.
|
| - // |width| and |height| are zoom and device scale independent logical pixels.
|
| - static bool IsLargeContent(int width, int height);
|
| + // |unobscured_size| is in zoom and device scale independent logical pixels.
|
| + static bool IsLargeContent(const gfx::Size& unobscured_size);
|
| };
|
|
|
| } // namespace content
|
|
|