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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 103583005: Restart fullscreen video playback when switching back from background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed one more buggy line and the fullscreen_player_is_released_ member which is not necessary now Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 #if defined(OS_ANDROID) 1334 #if defined(OS_ANDROID)
1335 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1335 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1336 OnActivateNearestFindResult) 1336 OnActivateNearestFindResult)
1337 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1337 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1338 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1338 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1339 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, 1339 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView,
1340 OnUndoScrollFocusedEditableNodeIntoRect) 1340 OnUndoScrollFocusedEditableNodeIntoRect)
1341 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1341 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1342 OnUpdateTopControlsState) 1342 OnUpdateTopControlsState)
1343 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) 1343 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
1344 IPC_MESSAGE_HANDLER(ViewMsg_ResumeFullscreenVideo, OnResumeFullscreenVideo)
1344 #elif defined(OS_MACOSX) 1345 #elif defined(OS_MACOSX)
1345 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) 1346 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard)
1346 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, 1347 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
1347 OnPluginImeCompositionCompleted) 1348 OnPluginImeCompositionCompleted)
1348 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1349 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1349 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) 1350 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize)
1350 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) 1351 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
1351 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) 1352 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
1352 #endif 1353 #endif
1353 // Adding a new message? Add platform independent ones first, then put the 1354 // Adding a new message? Add platform independent ones first, then put the
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 #endif 1847 #endif
1847 1848
1848 #if defined(OS_ANDROID) 1849 #if defined(OS_ANDROID)
1849 void RenderViewImpl::OnUndoScrollFocusedEditableNodeIntoRect() { 1850 void RenderViewImpl::OnUndoScrollFocusedEditableNodeIntoRect() {
1850 const WebNode node = GetFocusedNode(); 1851 const WebNode node = GetFocusedNode();
1851 if (!node.isNull() && IsEditableNode(node)) 1852 if (!node.isNull() && IsEditableNode(node))
1852 webview()->restoreScrollAndScaleState(); 1853 webview()->restoreScrollAndScaleState();
1853 } 1854 }
1854 1855
1855 void RenderViewImpl::OnPauseVideo() { 1856 void RenderViewImpl::OnPauseVideo() {
1856 // Inform RendererMediaPlayerManager to release all video player resources. 1857 media_player_manager_->SuspendFullscreenVideo();
1857 // If something is in progress the resource will not be freed, it will
1858 // only be freed once the tab is destroyed or if the user navigates away
1859 // via WebMediaPlayerAndroid::Destroy.
1860 media_player_manager_->ReleaseVideoResources(); 1858 media_player_manager_->ReleaseVideoResources();
1861 } 1859 }
1860
1861 void RenderViewImpl::OnResumeFullscreenVideo() {
1862 media_player_manager_->ResumeFullscreenVideo();
1863 }
1862 #endif 1864 #endif
1863 1865
1864 /////////////////////////////////////////////////////////////////////////////// 1866 ///////////////////////////////////////////////////////////////////////////////
1865 1867
1866 // Tell the embedding application that the URL of the active page has changed 1868 // Tell the embedding application that the URL of the active page has changed
1867 void RenderViewImpl::UpdateURL(WebFrame* frame) { 1869 void RenderViewImpl::UpdateURL(WebFrame* frame) {
1868 WebDataSource* ds = frame->dataSource(); 1870 WebDataSource* ds = frame->dataSource();
1869 DCHECK(ds); 1871 DCHECK(ds);
1870 1872
1871 const WebURLRequest& request = ds->request(); 1873 const WebURLRequest& request = ds->request();
(...skipping 4557 matching lines...) Expand 10 before | Expand all | Expand 10 after
6429 for (size_t i = 0; i < icon_urls.size(); i++) { 6431 for (size_t i = 0; i < icon_urls.size(); i++) {
6430 WebURL url = icon_urls[i].iconURL(); 6432 WebURL url = icon_urls[i].iconURL();
6431 if (!url.isEmpty()) 6433 if (!url.isEmpty())
6432 urls.push_back(FaviconURL(url, 6434 urls.push_back(FaviconURL(url,
6433 ToFaviconType(icon_urls[i].iconType()))); 6435 ToFaviconType(icon_urls[i].iconType())));
6434 } 6436 }
6435 SendUpdateFaviconURL(urls); 6437 SendUpdateFaviconURL(urls);
6436 } 6438 }
6437 6439
6438 } // namespace content 6440 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698