Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: content/renderer/installedapp/related_apps_fetcher.cc

Issue 2748023002: getInstalledRelatedApps: Change internal url fields to URL type. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/installedapp/getinstalledrelatedapps.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/installedapp/getinstalledrelatedapps.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698