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

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: Fix gn Created 6 years, 6 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( 648 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest(
651 GetProcess()->GetID(), GetRoutingID()); 649 GetProcess()->GetID(), GetRoutingID());
652 } 650 }
653 651
654 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( 652 void RenderViewHostImpl::SetHasPendingCrossSiteRequest(
655 bool has_pending_request) { 653 bool has_pending_request) {
656 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( 654 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest(
657 GetProcess()->GetID(), GetRoutingID(), has_pending_request); 655 GetProcess()->GetID(), GetRoutingID(), has_pending_request);
658 } 656 }
659 657
660 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) {
661 // Never grant any bindings to browser plugin guests.
662 if (GetProcess()->IsIsolatedGuest()) {
663 NOTREACHED() << "Never grant bindings to a guest process.";
664 return;
665 }
666
667 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) {
668 NOTREACHED() << "You must grant bindings before setting the handle";
669 return;
670 }
671
672 DCHECK(renderer_initialized_);
673
674 WebUISetupPtr web_ui_setup;
675 static_cast<RenderProcessHostImpl*>(GetProcess())->ConnectTo(
676 kRendererService_WebUISetup, &web_ui_setup);
677
678 web_ui_setup->SetWebUIHandle(GetRoutingID(), handle.Pass());
679 }
680
681 #if defined(OS_ANDROID) 658 #if defined(OS_ANDROID)
682 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, 659 void RenderViewHostImpl::ActivateNearestFindResult(int request_id,
683 float x, 660 float x,
684 float y) { 661 float y) {
685 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), 662 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(),
686 request_id, x, y)); 663 request_id, x, y));
687 } 664 }
688 665
689 void RenderViewHostImpl::RequestFindMatchRects(int current_version) { 666 void RenderViewHostImpl::RequestFindMatchRects(int current_version) {
690 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version)); 667 Send(new ViewMsg_FindMatchRects(GetRoutingID(), current_version));
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 FrameTree* frame_tree = delegate_->GetFrameTree(); 1652 FrameTree* frame_tree = delegate_->GetFrameTree();
1676 1653
1677 frame_tree->ResetForMainFrameSwap(); 1654 frame_tree->ResetForMainFrameSwap();
1678 } 1655 }
1679 1656
1680 void RenderViewHostImpl::SelectWordAroundCaret() { 1657 void RenderViewHostImpl::SelectWordAroundCaret() {
1681 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1658 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1682 } 1659 }
1683 1660
1684 } // namespace content 1661 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698