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

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 789533002: Fullscreen: make fullscreen requests come from RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make try happy Created 5 years, 11 months 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 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/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/android/scoped_java_ref.h" 7 #include "base/android/scoped_java_ref.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/browser/android/content_view_core_impl.h" 9 #include "content/browser/android/content_view_core_impl.h"
10 #include "content/browser/media/android/browser_demuxer_android.h" 10 #include "content/browser/media/android/browser_demuxer_android.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { 131 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() {
132 // During the tear down process, OnDestroyPlayer() may or may not be called 132 // During the tear down process, OnDestroyPlayer() may or may not be called
133 // (e.g. the WebContents may be destroyed before the render process). So 133 // (e.g. the WebContents may be destroyed before the render process). So
134 // we cannot DCHECK(players_.empty()) here. Instead, all media players in 134 // we cannot DCHECK(players_.empty()) here. Instead, all media players in
135 // |players_| will be destroyed here because |player_| is a ScopedVector. 135 // |players_| will be destroyed here because |player_| is a ScopedVector.
136 } 136 }
137 137
138 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { 138 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) {
139 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) 139 if (WebContentsDelegate* delegate = web_contents_->GetDelegate())
140 delegate->ToggleFullscreenModeForTab(web_contents_, false); 140 delegate->ExitFullscreenModeForTab(web_contents_);
141 if (RenderWidgetHostViewAndroid* view_android = 141 if (RenderWidgetHostViewAndroid* view_android =
142 static_cast<RenderWidgetHostViewAndroid*>( 142 static_cast<RenderWidgetHostViewAndroid*>(
143 web_contents_->GetRenderWidgetHostView())) { 143 web_contents_->GetRenderWidgetHostView())) {
144 view_android->SetOverlayVideoMode(false); 144 view_android->SetOverlayVideoMode(false);
145 } 145 }
146 146
147 Send( 147 Send(
148 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); 148 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_));
149 video_view_.reset(); 149 video_view_.reset();
150 MediaPlayerAndroid* player = GetFullscreenPlayer(); 150 MediaPlayerAndroid* player = GetFullscreenPlayer();
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 576 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
577 #endif // defined(VIDEO_HOLE) 577 #endif // defined(VIDEO_HOLE)
578 } 578 }
579 579
580 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { 580 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) {
581 player->Release(); 581 player->Release();
582 ReleaseMediaResources(player->player_id()); 582 ReleaseMediaResources(player->player_id());
583 } 583 }
584 584
585 } // namespace content 585 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698