| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 | 440 |
| 441 base::DictionaryValue* DevToolsTargetsUIHandler::Serialize( | 441 base::DictionaryValue* DevToolsTargetsUIHandler::Serialize( |
| 442 const DevToolsTargetImpl& target) { | 442 const DevToolsTargetImpl& target) { |
| 443 base::DictionaryValue* target_data = new base::DictionaryValue(); | 443 base::DictionaryValue* target_data = new base::DictionaryValue(); |
| 444 target_data->SetString(kTargetSourceField, source_id_); | 444 target_data->SetString(kTargetSourceField, source_id_); |
| 445 target_data->SetString(kTargetIdField, target.GetId()); | 445 target_data->SetString(kTargetIdField, target.GetId()); |
| 446 target_data->SetString(kTargetTypeField, target.GetType()); | 446 target_data->SetString(kTargetTypeField, target.GetType()); |
| 447 target_data->SetBoolean(kAttachedField, target.IsAttached()); | 447 target_data->SetBoolean(kAttachedField, target.IsAttached()); |
| 448 target_data->SetString(kUrlField, target.GetURL().spec()); | 448 target_data->SetString(kUrlField, target.GetURL().spec()); |
| 449 target_data->SetString(kNameField, net::EscapeForHTML(target.GetTitle())); | 449 target_data->SetString(kNameField, target.GetTitle()); |
| 450 target_data->SetString(kFaviconUrlField, target.GetFaviconURL().spec()); | 450 target_data->SetString(kFaviconUrlField, target.GetFaviconURL().spec()); |
| 451 target_data->SetString(kDescriptionField, target.GetDescription()); | 451 target_data->SetString(kDescriptionField, target.GetDescription()); |
| 452 return target_data; | 452 return target_data; |
| 453 } | 453 } |
| 454 | 454 |
| 455 void DevToolsTargetsUIHandler::SendSerializedTargets( | 455 void DevToolsTargetsUIHandler::SendSerializedTargets( |
| 456 const base::ListValue& list) { | 456 const base::ListValue& list) { |
| 457 callback_.Run(source_id_, list); | 457 callback_.Run(source_id_, list); |
| 458 } | 458 } |
| 459 | 459 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 device_status_dict->SetString(kPortForwardingBrowserId, | 496 device_status_dict->SetString(kPortForwardingBrowserId, |
| 497 sit->first->GetId()); | 497 sit->first->GetId()); |
| 498 | 498 |
| 499 std::string device_id = base::StringPrintf( | 499 std::string device_id = base::StringPrintf( |
| 500 kAdbDeviceIdFormat, | 500 kAdbDeviceIdFormat, |
| 501 sit->first->serial().c_str()); | 501 sit->first->serial().c_str()); |
| 502 result.Set(device_id, device_status_dict); | 502 result.Set(device_id, device_status_dict); |
| 503 } | 503 } |
| 504 callback_.Run(result); | 504 callback_.Run(result); |
| 505 } | 505 } |
| OLD | NEW |