OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/devtools/devtools_targets_ui.h" | 5 #include "chrome/browser/devtools/devtools_targets_ui.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 continue; | 156 continue; |
157 | 157 |
158 DevToolsTargetImpl* target_ptr = target.get(); | 158 DevToolsTargetImpl* target_ptr = target.get(); |
159 targets_[target_ptr->GetId()] = target.release(); | 159 targets_[target_ptr->GetId()] = target.release(); |
160 base::DictionaryValue* descriptor = Serialize(*target_ptr); | 160 base::DictionaryValue* descriptor = Serialize(*target_ptr); |
161 | 161 |
162 // TODO (kaznacheev): GetMainFrame() call is a temporary hack. | 162 // TODO (kaznacheev): GetMainFrame() call is a temporary hack. |
163 // Revisit this when multiple OOP frames are supported. | 163 // Revisit this when multiple OOP frames are supported. |
164 RenderFrameHost* rfh = rvh->GetMainFrame(); | 164 RenderFrameHost* rfh = rvh->GetMainFrame(); |
165 rfh_to_descriptor[rfh] = descriptor; | 165 rfh_to_descriptor[rfh] = descriptor; |
166 if (rvh->GetProcess()->IsGuest() || rfh->IsCrossProcessSubframe()) { | 166 content::WebContents* web_contents = |
| 167 content::WebContents::FromRenderViewHost(rvh); |
| 168 if (GuestViewBase::IsGuest(web_contents) || rfh->IsCrossProcessSubframe()) { |
167 nested_frames.push_back(rfh); | 169 nested_frames.push_back(rfh); |
168 } else { | 170 } else { |
169 list_value->Append(descriptor); | 171 list_value->Append(descriptor); |
170 } | 172 } |
171 } | 173 } |
172 | 174 |
173 // Add the list of nested targets to each of its owners. | 175 // Add the list of nested targets to each of its owners. |
174 for (std::vector<RenderFrameHost*>::iterator it(nested_frames.begin()); | 176 for (std::vector<RenderFrameHost*>::iterator it(nested_frames.begin()); |
175 it != nested_frames.end(); ++it) { | 177 it != nested_frames.end(); ++it) { |
176 RenderFrameHost* rfh = (*it); | 178 RenderFrameHost* rfh = (*it); |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 base::StringPrintf("%d", it->first), it->second); | 601 base::StringPrintf("%d", it->first), it->second); |
600 } | 602 } |
601 | 603 |
602 std::string device_id = base::StringPrintf( | 604 std::string device_id = base::StringPrintf( |
603 kAdbDeviceIdFormat, | 605 kAdbDeviceIdFormat, |
604 sit->first.c_str()); | 606 sit->first.c_str()); |
605 result.Set(device_id, device_status_dict); | 607 result.Set(device_id, device_status_dict); |
606 } | 608 } |
607 callback_.Run(result); | 609 callback_.Run(result); |
608 } | 610 } |
OLD | NEW |