OLD | NEW |
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 Loading... |
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 Loading... |
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 video player resources. |
| 1929 // If something is in progress the resource will not be freed, it will |
| 1930 // only be freed once the tab is destroyed or if the user navigates away |
| 1931 // via WebMediaPlayerAndroid::Destroy. |
| 1932 media_player_manager_->ReleaseVideoResources(); |
| 1933 } |
1925 #endif | 1934 #endif |
1926 | 1935 |
1927 /////////////////////////////////////////////////////////////////////////////// | 1936 /////////////////////////////////////////////////////////////////////////////// |
1928 | 1937 |
1929 // Tell the embedding application that the URL of the active page has changed | 1938 // Tell the embedding application that the URL of the active page has changed |
1930 void RenderViewImpl::UpdateURL(WebFrame* frame) { | 1939 void RenderViewImpl::UpdateURL(WebFrame* frame) { |
1931 WebDataSource* ds = frame->dataSource(); | 1940 WebDataSource* ds = frame->dataSource(); |
1932 DCHECK(ds); | 1941 DCHECK(ds); |
1933 | 1942 |
1934 const WebURLRequest& request = ds->request(); | 1943 const WebURLRequest& request = ds->request(); |
(...skipping 3755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5690 | 5699 |
5691 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const { | 5700 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const { |
5692 if (!webview()) | 5701 if (!webview()) |
5693 return false; | 5702 return false; |
5694 return webview()->hasTouchEventHandlersAt(point); | 5703 return webview()->hasTouchEventHandlersAt(point); |
5695 } | 5704 } |
5696 | 5705 |
5697 void RenderViewImpl::OnWasHidden() { | 5706 void RenderViewImpl::OnWasHidden() { |
5698 RenderWidget::OnWasHidden(); | 5707 RenderWidget::OnWasHidden(); |
5699 | 5708 |
5700 #if defined(OS_ANDROID) | 5709 #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()-> | 5710 RenderThreadImpl::current()->video_capture_impl_manager()-> |
5710 SuspendDevices(true); | 5711 SuspendDevices(true); |
5711 #endif | 5712 #endif |
5712 #endif | |
5713 | 5713 |
5714 if (webview()) | 5714 if (webview()) |
5715 webview()->setVisibilityState(visibilityState(), false); | 5715 webview()->setVisibilityState(visibilityState(), false); |
5716 | 5716 |
5717 #if defined(ENABLE_PLUGINS) | 5717 #if defined(ENABLE_PLUGINS) |
5718 // Inform PPAPI plugins that their page is no longer visible. | 5718 // Inform PPAPI plugins that their page is no longer visible. |
5719 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); | 5719 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); |
5720 i != active_pepper_instances_.end(); ++i) | 5720 i != active_pepper_instances_.end(); ++i) |
5721 (*i)->PageVisibilityChanged(false); | 5721 (*i)->PageVisibilityChanged(false); |
5722 | 5722 |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6500 for (size_t i = 0; i < icon_urls.size(); i++) { | 6500 for (size_t i = 0; i < icon_urls.size(); i++) { |
6501 WebURL url = icon_urls[i].iconURL(); | 6501 WebURL url = icon_urls[i].iconURL(); |
6502 if (!url.isEmpty()) | 6502 if (!url.isEmpty()) |
6503 urls.push_back(FaviconURL(url, | 6503 urls.push_back(FaviconURL(url, |
6504 ToFaviconType(icon_urls[i].iconType()))); | 6504 ToFaviconType(icon_urls[i].iconType()))); |
6505 } | 6505 } |
6506 SendUpdateFaviconURL(urls); | 6506 SendUpdateFaviconURL(urls); |
6507 } | 6507 } |
6508 | 6508 |
6509 } // namespace content | 6509 } // namespace content |
OLD | NEW |