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

Side by Side Diff: media/remoting/remoting_controller.h

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Consolidate two ElementVisibilityObserver in AUtoplayUmaHelper. 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_REMOTING_REMOTING_CONTROLLER_H_ 5 #ifndef MEDIA_REMOTING_REMOTING_CONTROLLER_H_
6 #define MEDIA_REMOTING_REMOTING_CONTROLLER_H_ 6 #define MEDIA_REMOTING_REMOTING_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "media/base/media_observer.h" 10 #include "media/base/media_observer.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void OnMessageFromSink(const std::vector<uint8_t>& message) override; 51 void OnMessageFromSink(const std::vector<uint8_t>& message) override;
52 void OnStopped(mojom::RemotingStopReason reason) override; 52 void OnStopped(mojom::RemotingStopReason reason) override;
53 53
54 // MediaObserver implementations. 54 // MediaObserver implementations.
55 // This is called when the video element or its ancestor enters full screen. 55 // This is called when the video element or its ancestor enters full screen.
56 // We currently use this as an indicator for immersive playback. May add other 56 // We currently use this as an indicator for immersive playback. May add other
57 // criteria (e.g. the actual display width/height of the video element) in 57 // criteria (e.g. the actual display width/height of the video element) in
58 // future. 58 // future.
59 void OnEnteredFullscreen() override; 59 void OnEnteredFullscreen() override;
60 void OnExitedFullscreen() override; 60 void OnExitedFullscreen() override;
61 void OnVideoViewportRatioChanged(double ratio) override;
61 void OnSetCdm(CdmContext* cdm_context) override; 62 void OnSetCdm(CdmContext* cdm_context) override;
62 void OnMetadataChanged(const PipelineMetadata& metadata) override; 63 void OnMetadataChanged(const PipelineMetadata& metadata) override;
63 64
64 using SwitchRendererCallback = base::Callback<void()>; 65 using SwitchRendererCallback = base::Callback<void()>;
65 void SetSwitchRendererCallback(const SwitchRendererCallback& cb); 66 void SetSwitchRendererCallback(const SwitchRendererCallback& cb);
66 67
67 // Tells which renderer should be used. 68 // Tells which renderer should be used.
68 bool is_remoting() const { 69 bool is_remoting() const {
69 DCHECK(task_runner_->BelongsToCurrentThread()); 70 DCHECK(task_runner_->BelongsToCurrentThread());
70 return is_remoting_; 71 return is_remoting_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 123 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
123 124
124 base::WeakPtrFactory<RemotingController> weak_factory_; 125 base::WeakPtrFactory<RemotingController> weak_factory_;
125 126
126 DISALLOW_COPY_AND_ASSIGN(RemotingController); 127 DISALLOW_COPY_AND_ASSIGN(RemotingController);
127 }; 128 };
128 129
129 } // namespace media 130 } // namespace media
130 131
131 #endif // MEDIA_REMOTING_REMOTING_CONTROLLER_H_ 132 #endif // MEDIA_REMOTING_REMOTING_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698