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

Side by Side Diff: media/base/media_observer.h

Issue 2511143006: Detect change on the intersection of video and viewport. (Closed)
Patch Set: Addressed miu's comments. Created 4 years, 1 month 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_MEDIA_OBSERVER_H_ 5 #ifndef MEDIA_BASE_MEDIA_OBSERVER_H_
6 #define MEDIA_BASE_MEDIA_OBSERVER_H_ 6 #define MEDIA_BASE_MEDIA_OBSERVER_H_
7 7
8 #include "media/base/cdm_context.h" 8 #include "media/base/cdm_context.h"
9 #include "media/base/pipeline_metadata.h" 9 #include "media/base/pipeline_metadata.h"
10 #include "ui/gfx/geometry/rect.h"
10 11
11 namespace media { 12 namespace media {
12 13
13 // This class is an observer of media player events. 14 // This class is an observer of media player events.
14 class MEDIA_EXPORT MediaObserver { 15 class MEDIA_EXPORT MediaObserver {
15 public: 16 public:
16 MediaObserver(); 17 MediaObserver();
17 virtual ~MediaObserver(); 18 virtual ~MediaObserver();
18 19
20 struct ViewportIntersectionInfo {
szager1 2016/11/23 17:44:58 As we mentioned in the meeting, we'd prefer not to
ojan 2016/11/23 18:43:43 To expand on this a bit, my mental model is that w
xjz 2016/11/23 23:43:25 Done.
xjz 2016/11/23 23:43:25 As szager1 suggested, moved the logic determining
21 ViewportIntersectionInfo() {}
22 ~ViewportIntersectionInfo() {}
23
24 gfx::Rect root_rect;
25 gfx::Rect intersect_rect;
26 };
27
19 // Called when the media element entered/exited fullscreen. 28 // Called when the media element entered/exited fullscreen.
20 virtual void OnEnteredFullscreen() = 0; 29 virtual void OnEnteredFullscreen() = 0;
21 virtual void OnExitedFullscreen() = 0; 30 virtual void OnExitedFullscreen() = 0;
22 31
32 // Called when the intersection of the media element and viewport changes.
33 virtual void OnViewportIntersectionChanged(
34 const ViewportIntersectionInfo& info) {}
35
23 // Called when CDM is attached to the media element. The |cdm_context| is 36 // Called when CDM is attached to the media element. The |cdm_context| is
24 // only guaranteed to be valid in this call. 37 // only guaranteed to be valid in this call.
25 virtual void OnSetCdm(CdmContext* cdm_context) = 0; 38 virtual void OnSetCdm(CdmContext* cdm_context) = 0;
26 39
27 // Called after demuxer is initialized. 40 // Called after demuxer is initialized.
28 virtual void OnMetadataChanged(const PipelineMetadata& metadata) = 0; 41 virtual void OnMetadataChanged(const PipelineMetadata& metadata) = 0;
29 }; 42 };
30 43
31 } // namespace media 44 } // namespace media
32 45
33 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_ 46 #endif // MEDIA_BASE_MEDIA_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.h » ('j') | third_party/WebKit/Source/core/dom/IntersectionGeometry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698