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

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

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 #include "media/remoting/remoting_controller.h" 5 #include "media/remoting/remoting_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 UpdateAndMaybeSwitch(); 135 UpdateAndMaybeSwitch();
136 } 136 }
137 137
138 void RemotingController::OnExitedFullscreen() { 138 void RemotingController::OnExitedFullscreen() {
139 DCHECK(task_runner_->BelongsToCurrentThread()); 139 DCHECK(task_runner_->BelongsToCurrentThread());
140 140
141 is_fullscreen_ = false; 141 is_fullscreen_ = false;
142 UpdateAndMaybeSwitch(); 142 UpdateAndMaybeSwitch();
143 } 143 }
144 144
145 void RemotingController::OnVideoViewportRatioChanged(double ratio) {
146 DCHECK(task_runner_->BelongsToCurrentThread());
147
148 is_fullscreen_ = ratio > 0.85;
miu 2016/11/05 02:47:46 Need "debouncing" logic here. Something like "no c
xjz 2016/11/09 02:24:28 Done.
149 UpdateAndMaybeSwitch();
150 }
151
145 void RemotingController::OnSetCdm(CdmContext* cdm_context) { 152 void RemotingController::OnSetCdm(CdmContext* cdm_context) {
146 DCHECK(task_runner_->BelongsToCurrentThread()); 153 DCHECK(task_runner_->BelongsToCurrentThread());
147 154
148 // TODO(xjz): Not implemented. Will add in up-coming change. 155 // TODO(xjz): Not implemented. Will add in up-coming change.
149 NOTIMPLEMENTED(); 156 NOTIMPLEMENTED();
150 } 157 }
151 158
152 void RemotingController::SetSwitchRendererCallback( 159 void RemotingController::SetSwitchRendererCallback(
153 const SwitchRendererCallback& cb) { 160 const SwitchRendererCallback& cb) {
154 DCHECK(task_runner_->BelongsToCurrentThread()); 161 DCHECK(task_runner_->BelongsToCurrentThread());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // |swithc_renderer_cb_.Run()| will be called after remoting is started 270 // |swithc_renderer_cb_.Run()| will be called after remoting is started
264 // successfully. 271 // successfully.
265 remoter_->Start(); 272 remoter_->Start();
266 } else { 273 } else {
267 switch_renderer_cb_.Run(); 274 switch_renderer_cb_.Run();
268 remoter_->Stop(mojom::RemotingStopReason::LOCAL_PLAYBACK); 275 remoter_->Stop(mojom::RemotingStopReason::LOCAL_PLAYBACK);
269 } 276 }
270 } 277 }
271 278
272 } // namespace media 279 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698