| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/renderer/installedapp/related_apps_fetcher.h" | 5 #include "content/renderer/installedapp/related_apps_fetcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/public/common/manifest.h" | 8 #include "content/public/common/manifest.h" |
| 9 #include "content/renderer/manifest/manifest_debug_info.h" | 9 #include "content/renderer/manifest/manifest_debug_info.h" |
| 10 #include "content/renderer/manifest/manifest_manager.h" | 10 #include "content/renderer/manifest/manifest_manager.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 const GURL& /*url*/, | 34 const GURL& /*url*/, |
| 35 const Manifest& manifest, | 35 const Manifest& manifest, |
| 36 const ManifestDebugInfo& /*manifest_debug_info*/) { | 36 const ManifestDebugInfo& /*manifest_debug_info*/) { |
| 37 std::vector<blink::WebRelatedApplication> related_apps; | 37 std::vector<blink::WebRelatedApplication> related_apps; |
| 38 for (const auto& relatedApplication : manifest.related_applications) { | 38 for (const auto& relatedApplication : manifest.related_applications) { |
| 39 blink::WebRelatedApplication webRelatedApplication; | 39 blink::WebRelatedApplication webRelatedApplication; |
| 40 webRelatedApplication.platform = | 40 webRelatedApplication.platform = |
| 41 blink::WebString::fromUTF16(relatedApplication.platform); | 41 blink::WebString::fromUTF16(relatedApplication.platform); |
| 42 webRelatedApplication.id = | 42 webRelatedApplication.id = |
| 43 blink::WebString::fromUTF16(relatedApplication.id); | 43 blink::WebString::fromUTF16(relatedApplication.id); |
| 44 if (!relatedApplication.url.is_empty()) { | 44 webRelatedApplication.url = blink::WebURL(relatedApplication.url); |
| 45 webRelatedApplication.url = | |
| 46 blink::WebString::fromUTF8(relatedApplication.url.spec()); | |
| 47 } | |
| 48 related_apps.push_back(std::move(webRelatedApplication)); | 45 related_apps.push_back(std::move(webRelatedApplication)); |
| 49 } | 46 } |
| 50 callbacks->onSuccess(std::move(related_apps)); | 47 callbacks->onSuccess(std::move(related_apps)); |
| 51 } | 48 } |
| 52 | 49 |
| 53 } // namespace content | 50 } // namespace content |
| OLD | NEW |