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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 base::Unretained(this)), | 131 base::Unretained(this)), |
132 base::TimeDelta::FromMilliseconds(kUpdateDelay))); | 132 base::TimeDelta::FromMilliseconds(kUpdateDelay))); |
133 } | 133 } |
134 | 134 |
135 void RenderViewHostTargetsUIHandler::UpdateTargets() { | 135 void RenderViewHostTargetsUIHandler::UpdateTargets() { |
136 base::ListValue list_value; | 136 base::ListValue list_value; |
137 | 137 |
138 std::map<std::string, base::DictionaryValue*> id_to_descriptor; | 138 std::map<std::string, base::DictionaryValue*> id_to_descriptor; |
139 | 139 |
140 DevToolsTargetImpl::List targets = | 140 DevToolsTargetImpl::List targets = |
141 DevToolsTargetImpl::EnumerateRenderViewHostTargets(); | 141 DevToolsTargetImpl::EnumerateWebContentsTargets(); |
142 | 142 |
143 STLDeleteValues(&targets_); | 143 STLDeleteValues(&targets_); |
144 for (DevToolsTargetImpl::List::iterator it = targets.begin(); | 144 for (DevToolsTargetImpl::List::iterator it = targets.begin(); |
145 it != targets.end(); ++it) { | 145 it != targets.end(); ++it) { |
146 DevToolsTargetImpl* target = *it; | 146 DevToolsTargetImpl* target = *it; |
147 targets_[target->GetId()] = target; | 147 targets_[target->GetId()] = target; |
148 id_to_descriptor[target->GetId()] = Serialize(*target); | 148 id_to_descriptor[target->GetId()] = Serialize(*target); |
149 } | 149 } |
150 | 150 |
151 for (TargetMap::iterator it(targets_.begin()); it != targets_.end(); ++it) { | 151 for (TargetMap::iterator it(targets_.begin()); it != targets_.end(); ++it) { |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 base::StringPrintf("%d", it->first), it->second); | 541 base::StringPrintf("%d", it->first), it->second); |
542 } | 542 } |
543 | 543 |
544 std::string device_id = base::StringPrintf( | 544 std::string device_id = base::StringPrintf( |
545 kAdbDeviceIdFormat, | 545 kAdbDeviceIdFormat, |
546 sit->first.c_str()); | 546 sit->first.c_str()); |
547 result.Set(device_id, device_status_dict); | 547 result.Set(device_id, device_status_dict); |
548 } | 548 } |
549 callback_.Run(result); | 549 callback_.Run(result); |
550 } | 550 } |
OLD | NEW |