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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 params.never_visible = delegate_->IsNeverVisible(); | 307 params.never_visible = delegate_->IsNeverVisible(); |
308 params.window_was_created_with_opener = window_was_created_with_opener; | 308 params.window_was_created_with_opener = window_was_created_with_opener; |
309 params.next_page_id = next_page_id; | 309 params.next_page_id = next_page_id; |
310 GetWebScreenInfo(¶ms.screen_info); | 310 GetWebScreenInfo(¶ms.screen_info); |
311 params.accessibility_mode = accessibility_mode(); | 311 params.accessibility_mode = accessibility_mode(); |
312 | 312 |
313 Send(new ViewMsg_New(params)); | 313 Send(new ViewMsg_New(params)); |
314 | 314 |
315 // If it's enabled, tell the renderer to set up the Javascript bindings for | 315 // If it's enabled, tell the renderer to set up the Javascript bindings for |
316 // sending messages back to the browser. | 316 // sending messages back to the browser. |
317 if (GetProcess()->IsGuest()) | 317 if (GetProcess()->IsIsolatedGuest()) |
318 DCHECK_EQ(0, enabled_bindings_); | 318 DCHECK_EQ(0, enabled_bindings_); |
319 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); | 319 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); |
320 // Let our delegate know that we created a RenderView. | 320 // Let our delegate know that we created a RenderView. |
321 delegate_->RenderViewCreated(this); | 321 delegate_->RenderViewCreated(this); |
322 | 322 |
323 return true; | 323 return true; |
324 } | 324 } |
325 | 325 |
326 bool RenderViewHostImpl::IsRenderViewLive() const { | 326 bool RenderViewHostImpl::IsRenderViewLive() const { |
327 return GetProcess()->HasConnection() && renderer_initialized_; | 327 return GetProcess()->HasConnection() && renderer_initialized_; |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 654 } |
655 | 655 |
656 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( | 656 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( |
657 bool has_pending_request) { | 657 bool has_pending_request) { |
658 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 658 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
659 GetProcess()->GetID(), GetRoutingID(), has_pending_request); | 659 GetProcess()->GetID(), GetRoutingID(), has_pending_request); |
660 } | 660 } |
661 | 661 |
662 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { | 662 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { |
663 // Never grant any bindings to browser plugin guests. | 663 // Never grant any bindings to browser plugin guests. |
664 if (GetProcess()->IsGuest()) { | 664 if (GetProcess()->IsIsolatedGuest()) { |
665 NOTREACHED() << "Never grant bindings to a guest process."; | 665 NOTREACHED() << "Never grant bindings to a guest process."; |
666 return; | 666 return; |
667 } | 667 } |
668 | 668 |
669 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { | 669 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { |
670 NOTREACHED() << "You must grant bindings before setting the handle"; | 670 NOTREACHED() << "You must grant bindings before setting the handle"; |
671 return; | 671 return; |
672 } | 672 } |
673 | 673 |
674 DCHECK(renderer_initialized_); | 674 DCHECK(renderer_initialized_); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 void RenderViewHostImpl::DragSourceSystemDragEnded() { | 817 void RenderViewHostImpl::DragSourceSystemDragEnded() { |
818 Send(new DragMsg_SourceSystemDragEnded(GetRoutingID())); | 818 Send(new DragMsg_SourceSystemDragEnded(GetRoutingID())); |
819 } | 819 } |
820 | 820 |
821 RenderFrameHost* RenderViewHostImpl::GetMainFrame() { | 821 RenderFrameHost* RenderViewHostImpl::GetMainFrame() { |
822 return RenderFrameHost::FromID(GetProcess()->GetID(), main_frame_routing_id_); | 822 return RenderFrameHost::FromID(GetProcess()->GetID(), main_frame_routing_id_); |
823 } | 823 } |
824 | 824 |
825 void RenderViewHostImpl::AllowBindings(int bindings_flags) { | 825 void RenderViewHostImpl::AllowBindings(int bindings_flags) { |
826 // Never grant any bindings to browser plugin guests. | 826 // Never grant any bindings to browser plugin guests. |
827 if (GetProcess()->IsGuest()) { | 827 if (GetProcess()->IsIsolatedGuest()) { |
828 NOTREACHED() << "Never grant bindings to a guest process."; | 828 NOTREACHED() << "Never grant bindings to a guest process."; |
829 return; | 829 return; |
830 } | 830 } |
831 | 831 |
832 // Ensure we aren't granting WebUI bindings to a process that has already | 832 // Ensure we aren't granting WebUI bindings to a process that has already |
833 // been used for non-privileged views. | 833 // been used for non-privileged views. |
834 if (bindings_flags & BINDINGS_POLICY_WEB_UI && | 834 if (bindings_flags & BINDINGS_POLICY_WEB_UI && |
835 GetProcess()->HasConnection() && | 835 GetProcess()->HasConnection() && |
836 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 836 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
837 GetProcess()->GetID())) { | 837 GetProcess()->GetID())) { |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1683 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1684 | 1684 |
1685 frame_tree->ResetForMainFrameSwap(); | 1685 frame_tree->ResetForMainFrameSwap(); |
1686 } | 1686 } |
1687 | 1687 |
1688 void RenderViewHostImpl::SelectWordAroundCaret() { | 1688 void RenderViewHostImpl::SelectWordAroundCaret() { |
1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1690 } | 1690 } |
1691 | 1691 |
1692 } // namespace content | 1692 } // namespace content |
OLD | NEW |