Chromium Code Reviews| 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 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1419 OnPluginImeCompositionCompleted) | 1419 OnPluginImeCompositionCompleted) |
| 1420 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1420 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 1421 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 1421 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 1422 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 1422 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
| 1423 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 1423 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
| 1424 #endif | 1424 #endif |
| 1425 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB, | 1425 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB, |
| 1426 OnReleaseDisambiguationPopupDIB) | 1426 OnReleaseDisambiguationPopupDIB) |
| 1427 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, | 1427 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, |
| 1428 OnWindowSnapshotCompleted) | 1428 OnWindowSnapshotCompleted) |
| 1429 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) | |
| 1429 | 1430 |
| 1430 // Have the super handle all other messages. | 1431 // Have the super handle all other messages. |
| 1431 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 1432 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
| 1432 IPC_END_MESSAGE_MAP() | 1433 IPC_END_MESSAGE_MAP() |
| 1433 | 1434 |
| 1434 if (!msg_is_ok) { | 1435 if (!msg_is_ok) { |
| 1435 // The message had a handler, but its deserialization failed. | 1436 // The message had a handler, but its deserialization failed. |
| 1436 // Kill the renderer to avoid potential spoofing attacks. | 1437 // Kill the renderer to avoid potential spoofing attacks. |
| 1437 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; | 1438 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; |
| 1438 } | 1439 } |
| (...skipping 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5690 | 5691 |
| 5691 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const { | 5692 bool RenderViewImpl::HasTouchEventHandlersAt(const gfx::Point& point) const { |
| 5692 if (!webview()) | 5693 if (!webview()) |
| 5693 return false; | 5694 return false; |
| 5694 return webview()->hasTouchEventHandlersAt(point); | 5695 return webview()->hasTouchEventHandlersAt(point); |
| 5695 } | 5696 } |
| 5696 | 5697 |
| 5697 void RenderViewImpl::OnWasHidden() { | 5698 void RenderViewImpl::OnWasHidden() { |
| 5698 RenderWidget::OnWasHidden(); | 5699 RenderWidget::OnWasHidden(); |
| 5699 | 5700 |
| 5700 #if defined(OS_ANDROID) | 5701 #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()-> | 5702 RenderThreadImpl::current()->video_capture_impl_manager()-> |
| 5710 SuspendDevices(true); | 5703 SuspendDevices(true); |
| 5711 #endif | 5704 #endif |
| 5712 #endif | |
| 5713 | 5705 |
| 5714 if (webview()) | 5706 if (webview()) |
| 5715 webview()->setVisibilityState(visibilityState(), false); | 5707 webview()->setVisibilityState(visibilityState(), false); |
| 5716 | 5708 |
| 5717 #if defined(ENABLE_PLUGINS) | 5709 #if defined(ENABLE_PLUGINS) |
| 5718 // Inform PPAPI plugins that their page is no longer visible. | 5710 // Inform PPAPI plugins that their page is no longer visible. |
| 5719 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); | 5711 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); |
| 5720 i != active_pepper_instances_.end(); ++i) | 5712 i != active_pepper_instances_.end(); ++i) |
| 5721 (*i)->PageVisibilityChanged(false); | 5713 (*i)->PageVisibilityChanged(false); |
| 5722 | 5714 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 5752 // Inform NPAPI plugins that their container is now visible. | 5744 // Inform NPAPI plugins that their container is now visible. |
| 5753 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5745 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 5754 for (plugin_it = plugin_delegates_.begin(); | 5746 for (plugin_it = plugin_delegates_.begin(); |
| 5755 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5747 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 5756 (*plugin_it)->SetContainerVisibility(true); | 5748 (*plugin_it)->SetContainerVisibility(true); |
| 5757 } | 5749 } |
| 5758 #endif // OS_MACOSX | 5750 #endif // OS_MACOSX |
| 5759 #endif // ENABLE_PLUGINS | 5751 #endif // ENABLE_PLUGINS |
| 5760 } | 5752 } |
| 5761 | 5753 |
| 5754 void RenderViewImpl::OnPauseVideo() { | |
|
boliu
2013/09/19 01:58:39
Method is no-op on desktop platforms, which is ext
benm (inactive)
2013/09/19 03:27:32
Done.
| |
| 5755 #if defined(OS_ANDROID) | |
| 5756 // Inform RendererMediaPlayerManager to release all media player resources. | |
| 5757 // unless some audio is playing. | |
| 5758 // If something is in progress the resource will not be freed, it will | |
| 5759 // only be freed once the tab is destroyed or if the user navigates away | |
| 5760 // via WebMediaPlayerAndroid::Destroy | |
| 5761 media_player_manager_->ReleaseMediaResources(); | |
| 5762 #endif | |
| 5763 } | |
| 5764 | |
| 5762 GURL RenderViewImpl::GetURLForGraphicsContext3D() { | 5765 GURL RenderViewImpl::GetURLForGraphicsContext3D() { |
| 5763 DCHECK(webview()); | 5766 DCHECK(webview()); |
| 5764 if (webview()->mainFrame()) | 5767 if (webview()->mainFrame()) |
| 5765 return GURL(webview()->mainFrame()->document().url()); | 5768 return GURL(webview()->mainFrame()->document().url()); |
| 5766 else | 5769 else |
| 5767 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D"); | 5770 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D"); |
| 5768 } | 5771 } |
| 5769 | 5772 |
| 5770 bool RenderViewImpl::ForceCompositingModeEnabled() { | 5773 bool RenderViewImpl::ForceCompositingModeEnabled() { |
| 5771 return webkit_preferences_.force_compositing_mode; | 5774 return webkit_preferences_.force_compositing_mode; |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6500 for (size_t i = 0; i < icon_urls.size(); i++) { | 6503 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6501 WebURL url = icon_urls[i].iconURL(); | 6504 WebURL url = icon_urls[i].iconURL(); |
| 6502 if (!url.isEmpty()) | 6505 if (!url.isEmpty()) |
| 6503 urls.push_back(FaviconURL(url, | 6506 urls.push_back(FaviconURL(url, |
| 6504 ToFaviconType(icon_urls[i].iconType()))); | 6507 ToFaviconType(icon_urls[i].iconType()))); |
| 6505 } | 6508 } |
| 6506 SendUpdateFaviconURL(urls); | 6509 SendUpdateFaviconURL(urls); |
| 6507 } | 6510 } |
| 6508 | 6511 |
| 6509 } // namespace content | 6512 } // namespace content |
| OLD | NEW |