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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 38 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
39 #include "content/browser/download/download_stats.h" | 39 #include "content/browser/download/download_stats.h" |
40 #include "content/browser/download/mhtml_generation_manager.h" | 40 #include "content/browser/download/mhtml_generation_manager.h" |
41 #include "content/browser/download/save_package.h" | 41 #include "content/browser/download/save_package.h" |
42 #include "content/browser/frame_host/cross_process_frame_connector.h" | 42 #include "content/browser/frame_host/cross_process_frame_connector.h" |
43 #include "content/browser/frame_host/interstitial_page_impl.h" | 43 #include "content/browser/frame_host/interstitial_page_impl.h" |
44 #include "content/browser/frame_host/navigation_entry_impl.h" | 44 #include "content/browser/frame_host/navigation_entry_impl.h" |
45 #include "content/browser/frame_host/navigation_handle_impl.h" | 45 #include "content/browser/frame_host/navigation_handle_impl.h" |
46 #include "content/browser/frame_host/navigator_impl.h" | 46 #include "content/browser/frame_host/navigator_impl.h" |
47 #include "content/browser/frame_host/render_frame_host_impl.h" | 47 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 48 #include "content/browser/frame_host/render_frame_proxy_host.h" |
48 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 49 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
49 #include "content/browser/geolocation/geolocation_service_context.h" | 50 #include "content/browser/geolocation/geolocation_service_context.h" |
50 #include "content/browser/host_zoom_map_impl.h" | 51 #include "content/browser/host_zoom_map_impl.h" |
51 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 52 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
52 #include "content/browser/manifest/manifest_manager_host.h" | 53 #include "content/browser/manifest/manifest_manager_host.h" |
53 #include "content/browser/media/audio_stream_monitor.h" | 54 #include "content/browser/media/audio_stream_monitor.h" |
54 #include "content/browser/media/capture/web_contents_audio_muter.h" | 55 #include "content/browser/media/capture/web_contents_audio_muter.h" |
55 #include "content/browser/media/media_web_contents_observer.h" | 56 #include "content/browser/media/media_web_contents_observer.h" |
56 #include "content/browser/message_port_message_filter.h" | 57 #include "content/browser/message_port_message_filter.h" |
57 #include "content/browser/plugin_content_origin_whitelist.h" | 58 #include "content/browser/plugin_content_origin_whitelist.h" |
58 #include "content/browser/renderer_host/render_process_host_impl.h" | 59 #include "content/browser/renderer_host/render_process_host_impl.h" |
59 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 60 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
60 #include "content/browser/renderer_host/render_view_host_impl.h" | 61 #include "content/browser/renderer_host/render_view_host_impl.h" |
61 #include "content/browser/renderer_host/render_widget_host_impl.h" | 62 #include "content/browser/renderer_host/render_widget_host_impl.h" |
62 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 63 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
63 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 64 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
64 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" | 65 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" |
65 #include "content/browser/site_instance_impl.h" | 66 #include "content/browser/site_instance_impl.h" |
66 #include "content/browser/wake_lock/wake_lock_service_context.h" | 67 #include "content/browser/wake_lock/wake_lock_service_context.h" |
67 #include "content/browser/web_contents/web_contents_view_guest.h" | 68 #include "content/browser/web_contents/web_contents_view_guest.h" |
68 #include "content/browser/webui/generic_handler.h" | 69 #include "content/browser/webui/generic_handler.h" |
69 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 70 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
70 #include "content/browser/webui/web_ui_impl.h" | 71 #include "content/browser/webui/web_ui_impl.h" |
71 #include "content/common/browser_plugin/browser_plugin_constants.h" | 72 #include "content/common/browser_plugin/browser_plugin_constants.h" |
72 #include "content/common/browser_plugin/browser_plugin_messages.h" | 73 #include "content/common/browser_plugin/browser_plugin_messages.h" |
73 #include "content/common/frame_messages.h" | 74 #include "content/common/frame_messages.h" |
74 #include "content/common/input_messages.h" | 75 #include "content/common/input_messages.h" |
| 76 #include "content/common/page_messages.h" |
75 #include "content/common/site_isolation_policy.h" | 77 #include "content/common/site_isolation_policy.h" |
76 #include "content/common/ssl_status_serialization.h" | 78 #include "content/common/ssl_status_serialization.h" |
77 #include "content/common/view_messages.h" | 79 #include "content/common/view_messages.h" |
78 #include "content/public/browser/ax_event_notification_details.h" | 80 #include "content/public/browser/ax_event_notification_details.h" |
79 #include "content/public/browser/browser_context.h" | 81 #include "content/public/browser/browser_context.h" |
80 #include "content/public/browser/browser_plugin_guest_manager.h" | 82 #include "content/public/browser/browser_plugin_guest_manager.h" |
81 #include "content/public/browser/content_browser_client.h" | 83 #include "content/public/browser/content_browser_client.h" |
82 #include "content/public/browser/devtools_agent_host.h" | 84 #include "content/public/browser/devtools_agent_host.h" |
83 #include "content/public/browser/download_manager.h" | 85 #include "content/public/browser/download_manager.h" |
84 #include "content/public/browser/download_url_parameters.h" | 86 #include "content/public/browser/download_url_parameters.h" |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 for (RenderFrameHost* rfh : GetAllFrames()) { | 785 for (RenderFrameHost* rfh : GetAllFrames()) { |
784 ++number_of_messages; | 786 ++number_of_messages; |
785 IPC::Message* message_copy = new IPC::Message(*message); | 787 IPC::Message* message_copy = new IPC::Message(*message); |
786 message_copy->set_routing_id(rfh->GetRoutingID()); | 788 message_copy->set_routing_id(rfh->GetRoutingID()); |
787 rfh->Send(message_copy); | 789 rfh->Send(message_copy); |
788 } | 790 } |
789 delete message; | 791 delete message; |
790 return number_of_messages; | 792 return number_of_messages; |
791 } | 793 } |
792 | 794 |
| 795 void WebContentsImpl::SendPageMsg(IPC::Message* msg) { |
| 796 frame_tree_.root()->render_manager()->SendPageMsg(msg); |
| 797 } |
| 798 |
793 RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() const { | 799 RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() const { |
794 return GetRenderManager()->current_host(); | 800 return GetRenderManager()->current_host(); |
795 } | 801 } |
796 | 802 |
797 int WebContentsImpl::GetRoutingID() const { | 803 int WebContentsImpl::GetRoutingID() const { |
798 if (!GetRenderViewHost()) | 804 if (!GetRenderViewHost()) |
799 return MSG_ROUTING_NONE; | 805 return MSG_ROUTING_NONE; |
800 | 806 |
801 return GetRenderViewHost()->GetRoutingID(); | 807 return GetRenderViewHost()->GetRoutingID(); |
802 } | 808 } |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 void WebContentsImpl::OnMoveValidationMessage( | 2222 void WebContentsImpl::OnMoveValidationMessage( |
2217 const gfx::Rect& anchor_in_root_view) { | 2223 const gfx::Rect& anchor_in_root_view) { |
2218 if (delegate_) | 2224 if (delegate_) |
2219 delegate_->MoveValidationMessage(this, anchor_in_root_view); | 2225 delegate_->MoveValidationMessage(this, anchor_in_root_view); |
2220 } | 2226 } |
2221 | 2227 |
2222 void WebContentsImpl::SendScreenRects() { | 2228 void WebContentsImpl::SendScreenRects() { |
2223 RenderWidgetHostImpl::From(GetRenderViewHost()->GetWidget()) | 2229 RenderWidgetHostImpl::From(GetRenderViewHost()->GetWidget()) |
2224 ->SendScreenRects(); | 2230 ->SendScreenRects(); |
2225 | 2231 |
| 2232 RenderWidgetHostViewBase* rwhv = |
| 2233 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 2234 if (rwhv) { |
| 2235 SendPageMsg(new PageMsg_UpdateWindowScreenRect( |
| 2236 MSG_ROUTING_NONE, rwhv->GetBoundsInRootWindow())); |
| 2237 } |
| 2238 |
2226 if (browser_plugin_embedder_) | 2239 if (browser_plugin_embedder_) |
2227 browser_plugin_embedder_->DidSendScreenRects(); | 2240 browser_plugin_embedder_->DidSendScreenRects(); |
2228 } | 2241 } |
2229 | 2242 |
2230 BrowserAccessibilityManager* | 2243 BrowserAccessibilityManager* |
2231 WebContentsImpl::GetRootBrowserAccessibilityManager() { | 2244 WebContentsImpl::GetRootBrowserAccessibilityManager() { |
2232 RenderFrameHostImpl* rfh = GetMainFrame(); | 2245 RenderFrameHostImpl* rfh = GetMainFrame(); |
2233 return rfh ? rfh->browser_accessibility_manager() : nullptr; | 2246 return rfh ? rfh->browser_accessibility_manager() : nullptr; |
2234 } | 2247 } |
2235 | 2248 |
(...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4761 const WebContentsObserver::MediaPlayerId& id) { | 4774 const WebContentsObserver::MediaPlayerId& id) { |
4762 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4775 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4763 } | 4776 } |
4764 | 4777 |
4765 void WebContentsImpl::MediaStoppedPlaying( | 4778 void WebContentsImpl::MediaStoppedPlaying( |
4766 const WebContentsObserver::MediaPlayerId& id) { | 4779 const WebContentsObserver::MediaPlayerId& id) { |
4767 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4780 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4768 } | 4781 } |
4769 | 4782 |
4770 } // namespace content | 4783 } // namespace content |
OLD | NEW |