Skip to content

Commit

Permalink
Fix a problem that DidEnterFullscreen is fired when exiting fullscreen
Browse files Browse the repository at this point in the history
When exiting fullscreen, we will pass a Null surface to BrowserMediaPlayerManager::SetVideoSurface().
In this case, we should not send DidExitFullscreen IPC to renderer

Review URL: https://codereview.chromium.org/112133004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240043 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
qinmin@chromium.org committed Dec 11, 2013
1 parent 56f6231 commit 69edcce
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions content/browser/media/android/browser_media_player_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ void BrowserMediaPlayerManager::OnTimeUpdate(int player_id,
void BrowserMediaPlayerManager::SetVideoSurface(
gfx::ScopedJavaSurface surface) {
MediaPlayerAndroid* player = GetFullscreenPlayer();
if (player) {
player->SetVideoSurface(surface.Pass());
Send(new MediaPlayerMsg_DidEnterFullscreen(
routing_id(), player->player_id()));
if (!player)
return;
if (!surface.IsEmpty()) {
Send(new MediaPlayerMsg_DidEnterFullscreen(routing_id(),
player->player_id()));
}
player->SetVideoSurface(surface.Pass());
}

void BrowserMediaPlayerManager::OnMediaMetadataChanged(
Expand Down

0 comments on commit 69edcce

Please sign in to comment.