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

Unified Diff: cc/layers/layer.cc

Issue 2140783002: services/ui: Detect when a video is playing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 7d683bd2c065be64c7ef417a403d8abb4a18e9d6..7c19d2a4a1769cd0bb2f63b7375e97d8dc43043e 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -95,6 +95,7 @@ Layer::Layer()
force_render_surface_for_testing_(false),
subtree_property_changed_(false),
layer_property_changed_(false),
+ may_contain_video_(false),
safe_opaque_background_color_(0),
draw_blend_mode_(SkXfermode::kSrcOver_Mode),
num_unclipped_descendants_(0) {}
@@ -1144,6 +1145,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
// property trees. So, it is enough to check it only for the current layer.
if (subtree_property_changed_ || layer_property_changed_)
layer->NoteLayerPropertyChanged();
+ layer->set_may_contain_video(may_contain_video_);
layer->SetMasksToBounds(inputs_.masks_to_bounds);
layer->set_main_thread_scrolling_reasons(
inputs_.main_thread_scrolling_reasons);
@@ -1598,6 +1600,13 @@ void Layer::SetLayerPropertyChanged() {
SetNeedsPushProperties();
}
+void Layer::SetMayContainVideo(bool yes) {
+ if (may_contain_video_ == yes)
+ return;
+ may_contain_video_ = yes;
+ SetNeedsPushProperties();
+}
+
bool Layer::FilterIsAnimating() const {
return GetAnimationHost()->IsAnimatingFilterProperty(
element_id(), GetElementTypeForAnimation());

Powered by Google App Engine
This is Rietveld 408576698