Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
52 #include "content/common/speech_recognition_messages.h" 51 #include "content/common/speech_recognition_messages.h"
53 #include "content/common/swapped_out_messages.h" 52 #include "content/common/swapped_out_messages.h"
54 #include "content/common/view_messages.h" 53 #include "content/common/view_messages.h"
55 #include "content/common/web_ui_setup.mojom.h"
56 #include "content/public/browser/ax_event_notification_details.h" 54 #include "content/public/browser/ax_event_notification_details.h"
57 #include "content/public/browser/browser_accessibility_state.h" 55 #include "content/public/browser/browser_accessibility_state.h"
58 #include "content/public/browser/browser_context.h" 56 #include "content/public/browser/browser_context.h"
59 #include "content/public/browser/browser_message_filter.h" 57 #include "content/public/browser/browser_message_filter.h"
60 #include "content/public/browser/content_browser_client.h" 58 #include "content/public/browser/content_browser_client.h"
61 #include "content/public/browser/native_web_keyboard_event.h" 59 #include "content/public/browser/native_web_keyboard_event.h"
62 #include "content/public/browser/notification_details.h" 60 #include "content/public/browser/notification_details.h"
63 #include "content/public/browser/notification_service.h" 61 #include "content/public/browser/notification_service.h"
64 #include "content/public/browser/notification_types.h" 62 #include "content/public/browser/notification_types.h"
65 #include "content/public/browser/render_frame_host.h" 63 #include "content/public/browser/render_frame_host.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( 647 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest(
650 GetProcess()->GetID(), GetRoutingID()); 648 GetProcess()->GetID(), GetRoutingID());
651 } 649 }
652 650
653 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( 651 void RenderViewHostImpl::SetHasPendingCrossSiteRequest(
654 bool has_pending_request) { 652 bool has_pending_request) {
655 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( 653 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest(
656 GetProcess()->GetID(), GetRoutingID(), has_pending_request); 654 GetProcess()->GetID(), GetRoutingID(), has_pending_request);
657 } 655 }
658 656
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
680 #if defined(OS_ANDROID) 657 #if defined(OS_ANDROID)
681 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, 658 void RenderViewHostImpl::ActivateNearestFindResult(int request_id,
682 float x, 659 float x,
683 float y) { 660 float y) {
684 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), 661 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(),
685 request_id, x, y)); 662 request_id, x, y));
686 } 663 }
687 664
688 void RenderViewHostImpl::RequestFindMatchRects(int current_version) { 665 void RenderViewHostImpl::RequestFindMatchRects(int current_version) {
689 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version)); 666 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version));
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 FrameTree* frame_tree = delegate_->GetFrameTree(); 1657 FrameTree* frame_tree = delegate_->GetFrameTree();
1681 1658
1682 frame_tree->ResetForMainFrameSwap(); 1659 frame_tree->ResetForMainFrameSwap();
1683 } 1660 }
1684 1661
1685 void RenderViewHostImpl::SelectWordAroundCaret() { 1662 void RenderViewHostImpl::SelectWordAroundCaret() {
1686 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1663 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1687 } 1664 }
1688 1665
1689 } // namespace content 1666 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698