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

Unified Diff: content/renderer/peripheral_content_heuristic.h

Issue 1522173002: Reland: Plugin Power Saver: Improve Poster behavior for essential plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix an NPE crash/race on plugin destruction 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698