| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 DCHECK(thread_checker_.CalledOnValidThread()); | 414 DCHECK(thread_checker_.CalledOnValidThread()); |
| 415 | 415 |
| 416 render_frame_suspended_ = false; | 416 render_frame_suspended_ = false; |
| 417 | 417 |
| 418 // Resume playback on visibility. play() clears |should_play_upon_shown_|. | 418 // Resume playback on visibility. play() clears |should_play_upon_shown_|. |
| 419 if (should_play_upon_shown_) | 419 if (should_play_upon_shown_) |
| 420 play(); | 420 play(); |
| 421 #endif // defined(OS_ANDROID) | 421 #endif // defined(OS_ANDROID) |
| 422 } | 422 } |
| 423 | 423 |
| 424 void WebMediaPlayerMS::OnSuspendRequested(bool must_suspend) { | 424 bool WebMediaPlayerMS::OnSuspendRequested(bool must_suspend) { |
| 425 #if defined(OS_ANDROID) | 425 #if defined(OS_ANDROID) |
| 426 if (!must_suspend) | 426 if (!must_suspend) |
| 427 return; | 427 return false; |
| 428 | 428 |
| 429 if (!paused_) { | 429 if (!paused_) { |
| 430 pause(); | 430 pause(); |
| 431 should_play_upon_shown_ = true; | 431 should_play_upon_shown_ = true; |
| 432 } | 432 } |
| 433 | 433 |
| 434 if (delegate_) | 434 if (delegate_) |
| 435 delegate_->PlayerGone(delegate_id_); | 435 delegate_->PlayerGone(delegate_id_); |
| 436 | 436 |
| 437 render_frame_suspended_ = true; | 437 render_frame_suspended_ = true; |
| 438 #endif | 438 #endif |
| 439 return true; |
| 439 } | 440 } |
| 440 | 441 |
| 441 void WebMediaPlayerMS::OnPlay() { | 442 void WebMediaPlayerMS::OnPlay() { |
| 442 // TODO(perkj, magjed): It's not clear how WebRTC should work with an | 443 // TODO(perkj, magjed): It's not clear how WebRTC should work with an |
| 443 // MediaSession, until these issues are resolved, disable session controls. | 444 // MediaSession, until these issues are resolved, disable session controls. |
| 444 // http://crbug.com/595297. | 445 // http://crbug.com/595297. |
| 445 } | 446 } |
| 446 | 447 |
| 447 void WebMediaPlayerMS::OnPause() { | 448 void WebMediaPlayerMS::OnPause() { |
| 448 // TODO(perkj, magjed): See TODO in OnPlay(). | 449 // TODO(perkj, magjed): See TODO in OnPlay(). |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 void WebMediaPlayerMS::ResetCanvasCache() { | 561 void WebMediaPlayerMS::ResetCanvasCache() { |
| 561 DCHECK(thread_checker_.CalledOnValidThread()); | 562 DCHECK(thread_checker_.CalledOnValidThread()); |
| 562 video_renderer_.ResetCache(); | 563 video_renderer_.ResetCache(); |
| 563 } | 564 } |
| 564 | 565 |
| 565 void WebMediaPlayerMS::TriggerResize() { | 566 void WebMediaPlayerMS::TriggerResize() { |
| 566 get_client()->sizeChanged(); | 567 get_client()->sizeChanged(); |
| 567 } | 568 } |
| 568 | 569 |
| 569 } // namespace content | 570 } // namespace content |
| OLD | NEW |