Chromium Code Reviews| 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::FromWebContents(web_contents) || | |
|
lazyboy
2014/05/23 15:20:13
As noted offline, add a more obvious bool GuestVie
Fady Samuel
2014/05/23 15:35:59
Done.
| |
| 169 rfh->IsCrossProcessSubframe()) { | |
| 167 nested_frames.push_back(rfh); | 170 nested_frames.push_back(rfh); |
| 168 } else { | 171 } else { |
| 169 list_value->Append(descriptor); | 172 list_value->Append(descriptor); |
| 170 } | 173 } |
| 171 } | 174 } |
| 172 | 175 |
| 173 // Add the list of nested targets to each of its owners. | 176 // Add the list of nested targets to each of its owners. |
| 174 for (std::vector<RenderFrameHost*>::iterator it(nested_frames.begin()); | 177 for (std::vector<RenderFrameHost*>::iterator it(nested_frames.begin()); |
| 175 it != nested_frames.end(); ++it) { | 178 it != nested_frames.end(); ++it) { |
| 176 RenderFrameHost* rfh = (*it); | 179 RenderFrameHost* rfh = (*it); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 base::StringPrintf("%d", it->first), it->second); | 602 base::StringPrintf("%d", it->first), it->second); |
| 600 } | 603 } |
| 601 | 604 |
| 602 std::string device_id = base::StringPrintf( | 605 std::string device_id = base::StringPrintf( |
| 603 kAdbDeviceIdFormat, | 606 kAdbDeviceIdFormat, |
| 604 sit->first.c_str()); | 607 sit->first.c_str()); |
| 605 result.Set(device_id, device_status_dict); | 608 result.Set(device_id, device_status_dict); |
| 606 } | 609 } |
| 607 callback_.Run(result); | 610 callback_.Run(result); |
| 608 } | 611 } |
| OLD | NEW |