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

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

Issue 23464080: [Android] Decouple pausing video from RenderView pause. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 7 years, 3 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) 1406 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener)
1407 #if defined(OS_ANDROID) 1407 #if defined(OS_ANDROID)
1408 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1408 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1409 OnActivateNearestFindResult) 1409 OnActivateNearestFindResult)
1410 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1410 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1411 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1411 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1412 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, 1412 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView,
1413 OnUndoScrollFocusedEditableNodeIntoRect) 1413 OnUndoScrollFocusedEditableNodeIntoRect)
1414 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1414 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1415 OnUpdateTopControlsState) 1415 OnUpdateTopControlsState)
1416 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
1416 #elif defined(OS_MACOSX) 1417 #elif defined(OS_MACOSX)
1417 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) 1418 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard)
1418 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, 1419 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
1419 OnPluginImeCompositionCompleted) 1420 OnPluginImeCompositionCompleted)
1420 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1421 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1421 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) 1422 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize)
1422 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) 1423 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
1423 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) 1424 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
1424 #endif 1425 #endif
1425 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB, 1426 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB,
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 webview()->willEndLiveResize(); 1916 webview()->willEndLiveResize();
1916 } 1917 }
1917 #endif 1918 #endif
1918 1919
1919 #if defined(OS_ANDROID) 1920 #if defined(OS_ANDROID)
1920 void RenderViewImpl::OnUndoScrollFocusedEditableNodeIntoRect() { 1921 void RenderViewImpl::OnUndoScrollFocusedEditableNodeIntoRect() {
1921 const WebNode node = GetFocusedNode(); 1922 const WebNode node = GetFocusedNode();
1922 if (!node.isNull() && IsEditableNode(node)) 1923 if (!node.isNull() && IsEditableNode(node))
1923 webview()->restoreScrollAndScaleState(); 1924 webview()->restoreScrollAndScaleState();
1924 } 1925 }
1926
1927 void RenderViewImpl::OnPauseVideo() {
1928 // Inform RendererMediaPlayerManager to release all media player resources.
1929 // unless some audio is playing.
1930 // If something is in progress the resource will not be freed, it will
1931 // only be freed once the tab is destroyed or if the user navigates away
1932 // via WebMediaPlayerAndroid::Destroy
1933 media_player_manager_->ReleaseMediaResources();
qinmin 2013/09/19 16:37:38 nit: change the function name of ReleaseMediaResou
benm (inactive) 2013/09/19 17:51:25 Done.
1934 }
1925 #endif 1935 #endif
1926 1936
1927 /////////////////////////////////////////////////////////////////////////////// 1937 ///////////////////////////////////////////////////////////////////////////////
1928 1938
1929 // Tell the embedding application that the URL of the active page has changed 1939 // Tell the embedding application that the URL of the active page has changed
1930 void RenderViewImpl::UpdateURL(WebFrame* frame) { 1940 void RenderViewImpl::UpdateURL(WebFrame* frame) {
1931 WebDataSource* ds = frame->dataSource(); 1941 WebDataSource* ds = frame->dataSource();
1932 DCHECK(ds); 1942 DCHECK(ds);
1933 1943
1934 const WebURLRequest& request = ds->request(); 1944 const WebURLRequest& request = ds->request();
(...skipping 3755 matching lines...) Expand 10 before | Expand all | Expand 10 after
5690 5700
5691 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const { 5701 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const {
5692 if (!webview()) 5702 if (!webview())
5693 return false; 5703 return false;
5694 return webview()->hasTouchEventHandlersAt(point); 5704 return webview()->hasTouchEventHandlersAt(point);
5695 } 5705 }
5696 5706
5697 void RenderViewImpl::OnWasHidden() { 5707 void RenderViewImpl::OnWasHidden() {
5698 RenderWidget::OnWasHidden(); 5708 RenderWidget::OnWasHidden();
5699 5709
5700 #if defined(OS_ANDROID) 5710 #if defined(OS_ANDROID) && defined(ENABLE_WEBRTC)
5701 // Inform RendererMediaPlayerManager to release all media player resources.
5702 // unless some audio is playing.
5703 // If something is in progress the resource will not be freed, it will
5704 // only be freed once the tab is destroyed or if the user navigates away
5705 // via WebMediaPlayerAndroid::Destroy
5706 media_player_manager_->ReleaseMediaResources();
5707
5708 #if defined(ENABLE_WEBRTC)
5709 RenderThreadImpl::current()->video_capture_impl_manager()-> 5711 RenderThreadImpl::current()->video_capture_impl_manager()->
5710 SuspendDevices(true); 5712 SuspendDevices(true);
5711 #endif 5713 #endif
5712 #endif
5713 5714
5714 if (webview()) 5715 if (webview())
5715 webview()->setVisibilityState(visibilityState(), false); 5716 webview()->setVisibilityState(visibilityState(), false);
5716 5717
5717 #if defined(ENABLE_PLUGINS) 5718 #if defined(ENABLE_PLUGINS)
5718 // Inform PPAPI plugins that their page is no longer visible. 5719 // Inform PPAPI plugins that their page is no longer visible.
5719 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); 5720 for (PepperPluginSet::iterator i = active_pepper_instances_.begin();
5720 i != active_pepper_instances_.end(); ++i) 5721 i != active_pepper_instances_.end(); ++i)
5721 (*i)->PageVisibilityChanged(false); 5722 (*i)->PageVisibilityChanged(false);
5722 5723
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
6500 for (size_t i = 0; i < icon_urls.size(); i++) { 6501 for (size_t i = 0; i < icon_urls.size(); i++) {
6501 WebURL url = icon_urls[i].iconURL(); 6502 WebURL url = icon_urls[i].iconURL();
6502 if (!url.isEmpty()) 6503 if (!url.isEmpty())
6503 urls.push_back(FaviconURL(url, 6504 urls.push_back(FaviconURL(url,
6504 ToFaviconType(icon_urls[i].iconType()))); 6505 ToFaviconType(icon_urls[i].iconType())));
6505 } 6506 }
6506 SendUpdateFaviconURL(urls); 6507 SendUpdateFaviconURL(urls);
6507 } 6508 }
6508 6509
6509 } // namespace content 6510 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698