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

Side by Side Diff: content/browser/devtools/render_frame_devtools_agent_host.cc

Issue 2361613002: DevTools: untangle device discovery request from the devtools android bridge. (Closed)
Patch Set: make device hosts profile-independent, plump browser context for inspect. Created 4 years, 3 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/devtools/render_frame_devtools_agent_host.h" 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 void RenderFrameDevToolsAgentHost::OnRequestNewWindow( 1008 void RenderFrameDevToolsAgentHost::OnRequestNewWindow(
1009 RenderFrameHost* sender, 1009 RenderFrameHost* sender,
1010 int new_routing_id) { 1010 int new_routing_id) {
1011 RenderFrameHostImpl* frame_host = RenderFrameHostImpl::FromID( 1011 RenderFrameHostImpl* frame_host = RenderFrameHostImpl::FromID(
1012 sender->GetProcess()->GetID(), new_routing_id); 1012 sender->GetProcess()->GetID(), new_routing_id);
1013 1013
1014 bool success = false; 1014 bool success = false;
1015 if (IsAttached() && sender->GetRoutingID() != new_routing_id && frame_host) { 1015 if (IsAttached() && sender->GetRoutingID() != new_routing_id && frame_host) {
1016 scoped_refptr<DevToolsAgentHost> agent = 1016 scoped_refptr<DevToolsAgentHost> agent =
1017 DevToolsAgentHost::GetOrCreateFor(frame_host); 1017 DevToolsAgentHost::GetOrCreateFor(frame_host);
1018 success = agent->Inspect(); 1018 success = agent->Inspect(nullptr);
1019 } 1019 }
1020 1020
1021 sender->Send(new DevToolsAgentMsg_RequestNewWindow_ACK( 1021 sender->Send(new DevToolsAgentMsg_RequestNewWindow_ACK(
1022 sender->GetRoutingID(), success)); 1022 sender->GetRoutingID(), success));
1023 } 1023 }
1024 1024
1025 bool RenderFrameDevToolsAgentHost::HasRenderFrameHost( 1025 bool RenderFrameDevToolsAgentHost::HasRenderFrameHost(
1026 RenderFrameHost* host) { 1026 RenderFrameHost* host) {
1027 return (current_ && current_->host() == host) || 1027 return (current_ && current_->host() == host) ||
1028 (pending_ && pending_->host() == host); 1028 (pending_ && pending_->host() == host);
1029 } 1029 }
1030 1030
1031 bool RenderFrameDevToolsAgentHost::IsChildFrame() { 1031 bool RenderFrameDevToolsAgentHost::IsChildFrame() {
1032 return current_ && current_->host()->GetParent(); 1032 return current_ && current_->host()->GetParent();
1033 } 1033 }
1034 1034
1035 } // namespace content 1035 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698