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 30 matching lines...) Expand all Loading... |
41 #include "content/browser/renderer_host/render_view_host_delegate.h" | 41 #include "content/browser/renderer_host/render_view_host_delegate.h" |
42 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 42 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
43 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 43 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
44 #include "content/common/accessibility_messages.h" | 44 #include "content/common/accessibility_messages.h" |
45 #include "content/common/browser_plugin/browser_plugin_messages.h" | 45 #include "content/common/browser_plugin/browser_plugin_messages.h" |
46 #include "content/common/content_switches_internal.h" | 46 #include "content/common/content_switches_internal.h" |
47 #include "content/common/drag_messages.h" | 47 #include "content/common/drag_messages.h" |
48 #include "content/common/frame_messages.h" | 48 #include "content/common/frame_messages.h" |
49 #include "content/common/input_messages.h" | 49 #include "content/common/input_messages.h" |
50 #include "content/common/inter_process_time_ticks_converter.h" | 50 #include "content/common/inter_process_time_ticks_converter.h" |
| 51 #include "content/common/mojo/mojo_service_names.h" |
51 #include "content/common/speech_recognition_messages.h" | 52 #include "content/common/speech_recognition_messages.h" |
52 #include "content/common/swapped_out_messages.h" | 53 #include "content/common/swapped_out_messages.h" |
53 #include "content/common/view_messages.h" | 54 #include "content/common/view_messages.h" |
| 55 #include "content/common/web_ui_setup.mojom.h" |
54 #include "content/public/browser/ax_event_notification_details.h" | 56 #include "content/public/browser/ax_event_notification_details.h" |
55 #include "content/public/browser/browser_accessibility_state.h" | 57 #include "content/public/browser/browser_accessibility_state.h" |
56 #include "content/public/browser/browser_context.h" | 58 #include "content/public/browser/browser_context.h" |
57 #include "content/public/browser/browser_message_filter.h" | 59 #include "content/public/browser/browser_message_filter.h" |
58 #include "content/public/browser/content_browser_client.h" | 60 #include "content/public/browser/content_browser_client.h" |
59 #include "content/public/browser/native_web_keyboard_event.h" | 61 #include "content/public/browser/native_web_keyboard_event.h" |
60 #include "content/public/browser/notification_details.h" | 62 #include "content/public/browser/notification_details.h" |
61 #include "content/public/browser/notification_service.h" | 63 #include "content/public/browser/notification_service.h" |
62 #include "content/public/browser/notification_types.h" | 64 #include "content/public/browser/notification_types.h" |
63 #include "content/public/browser/render_frame_host.h" | 65 #include "content/public/browser/render_frame_host.h" |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( | 649 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( |
648 GetProcess()->GetID(), GetRoutingID()); | 650 GetProcess()->GetID(), GetRoutingID()); |
649 } | 651 } |
650 | 652 |
651 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( | 653 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( |
652 bool has_pending_request) { | 654 bool has_pending_request) { |
653 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 655 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
654 GetProcess()->GetID(), GetRoutingID(), has_pending_request); | 656 GetProcess()->GetID(), GetRoutingID(), has_pending_request); |
655 } | 657 } |
656 | 658 |
| 659 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { |
| 660 // Never grant any bindings to browser plugin guests. |
| 661 if (GetProcess()->IsIsolatedGuest()) { |
| 662 NOTREACHED() << "Never grant bindings to a guest process."; |
| 663 return; |
| 664 } |
| 665 |
| 666 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { |
| 667 NOTREACHED() << "You must grant bindings before setting the handle"; |
| 668 return; |
| 669 } |
| 670 |
| 671 DCHECK(renderer_initialized_); |
| 672 |
| 673 WebUISetupPtr web_ui_setup; |
| 674 static_cast<RenderProcessHostImpl*>(GetProcess())->ConnectTo( |
| 675 kRendererService_WebUISetup, &web_ui_setup); |
| 676 |
| 677 web_ui_setup->SetWebUIHandle(GetRoutingID(), handle.Pass()); |
| 678 } |
| 679 |
657 #if defined(OS_ANDROID) | 680 #if defined(OS_ANDROID) |
658 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, | 681 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, |
659 float x, | 682 float x, |
660 float y) { | 683 float y) { |
661 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), | 684 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), |
662 request_id, x, y)); | 685 request_id, x, y)); |
663 } | 686 } |
664 | 687 |
665 void RenderViewHostImpl::RequestFindMatchRects(int current_version) { | 688 void RenderViewHostImpl::RequestFindMatchRects(int current_version) { |
666 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version)); | 689 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version)); |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1680 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1658 | 1681 |
1659 frame_tree->ResetForMainFrameSwap(); | 1682 frame_tree->ResetForMainFrameSwap(); |
1660 } | 1683 } |
1661 | 1684 |
1662 void RenderViewHostImpl::SelectWordAroundCaret() { | 1685 void RenderViewHostImpl::SelectWordAroundCaret() { |
1663 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1686 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1664 } | 1687 } |
1665 | 1688 |
1666 } // namespace content | 1689 } // namespace content |
OLD | NEW |