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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 } | 652 } |
653 | 653 |
654 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( | 654 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( |
655 bool has_pending_request) { | 655 bool has_pending_request) { |
656 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 656 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
657 GetProcess()->GetID(), GetRoutingID(), has_pending_request); | 657 GetProcess()->GetID(), GetRoutingID(), has_pending_request); |
658 } | 658 } |
659 | 659 |
660 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { | 660 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { |
661 // Never grant any bindings to browser plugin guests. | 661 // Never grant any bindings to browser plugin guests. |
662 if (GetProcess()->IsGuest()) { | 662 if (GetProcess()->IsIsolatedGuest()) { |
663 NOTREACHED() << "Never grant bindings to a guest process."; | 663 NOTREACHED() << "Never grant bindings to a guest process."; |
664 return; | 664 return; |
665 } | 665 } |
666 | 666 |
667 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { | 667 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { |
668 NOTREACHED() << "You must grant bindings before setting the handle"; | 668 NOTREACHED() << "You must grant bindings before setting the handle"; |
669 return; | 669 return; |
670 } | 670 } |
671 | 671 |
672 DCHECK(renderer_initialized_); | 672 DCHECK(renderer_initialized_); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 void RenderViewHostImpl::DragSourceSystemDragEnded() { | 815 void RenderViewHostImpl::DragSourceSystemDragEnded() { |
816 Send(new DragMsg_SourceSystemDragEnded(GetRoutingID())); | 816 Send(new DragMsg_SourceSystemDragEnded(GetRoutingID())); |
817 } | 817 } |
818 | 818 |
819 RenderFrameHost* RenderViewHostImpl::GetMainFrame() { | 819 RenderFrameHost* RenderViewHostImpl::GetMainFrame() { |
820 return RenderFrameHost::FromID(GetProcess()->GetID(), main_frame_routing_id_); | 820 return RenderFrameHost::FromID(GetProcess()->GetID(), main_frame_routing_id_); |
821 } | 821 } |
822 | 822 |
823 void RenderViewHostImpl::AllowBindings(int bindings_flags) { | 823 void RenderViewHostImpl::AllowBindings(int bindings_flags) { |
824 // Never grant any bindings to browser plugin guests. | 824 // Never grant any bindings to browser plugin guests. |
825 if (GetProcess()->IsGuest()) { | 825 if (GetProcess()->IsIsolatedGuest()) { |
826 NOTREACHED() << "Never grant bindings to a guest process."; | 826 NOTREACHED() << "Never grant bindings to a guest process."; |
827 return; | 827 return; |
828 } | 828 } |
829 | 829 |
830 // Ensure we aren't granting WebUI bindings to a process that has already | 830 // Ensure we aren't granting WebUI bindings to a process that has already |
831 // been used for non-privileged views. | 831 // been used for non-privileged views. |
832 if (bindings_flags & BINDINGS_POLICY_WEB_UI && | 832 if (bindings_flags & BINDINGS_POLICY_WEB_UI && |
833 GetProcess()->HasConnection() && | 833 GetProcess()->HasConnection() && |
834 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 834 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
835 GetProcess()->GetID())) { | 835 GetProcess()->GetID())) { |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1681 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1682 | 1682 |
1683 frame_tree->ResetForMainFrameSwap(); | 1683 frame_tree->ResetForMainFrameSwap(); |
1684 } | 1684 } |
1685 | 1685 |
1686 void RenderViewHostImpl::SelectWordAroundCaret() { | 1686 void RenderViewHostImpl::SelectWordAroundCaret() { |
1687 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1687 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1688 } | 1688 } |
1689 | 1689 |
1690 } // namespace content | 1690 } // namespace content |
OLD | NEW |