Extract common WebApp->SyncProto function and deduplicate.
Note there were small diffs in the functions that IIUC were bugs:
for (const WebApplicationIconInfo& icon_info :
web_app.sync_fallback_data().icon_infos)
vs
for (const WebApplicationIconInfo& icon_info : app.icon_infos())
==and==
if (app.sync_fallback_data().scope.is_valid())
sync_data->set_scope(app.sync_fallback_data().scope.spec());
vs
if (app.scope().is_valid())
sync_data->set_scope(app.scope().spec());
The sync_fallback_data versions were used in the merged function.
Change-Id: I581119437306540ef16139f05ed4184240fd7cba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291555
Commit-Queue: Glen Robertson <[email protected]>
Reviewed-by: Alan Cutter <[email protected]>
Cr-Commit-Position: refs/heads/master@{#787113}
diff --git a/chrome/browser/web_applications/web_app_proto_utils.h b/chrome/browser/web_applications/web_app_proto_utils.h
index 45b3d50..5eb9e7f 100644
--- a/chrome/browser/web_applications/web_app_proto_utils.h
+++ b/chrome/browser/web_applications/web_app_proto_utils.h
@@ -20,9 +20,15 @@
const char* container_name_for_logging,
RepeatedIconInfosProto icon_infos_proto);
+// Use the given |app| to populate a |WebAppSpecifics| sync proto.
+sync_pb::WebAppSpecifics WebAppToSyncProto(const WebApp& app);
+
base::Optional<WebApp::SyncFallbackData> ParseSyncFallbackDataStruct(
const sync_pb::WebAppSpecifics& sync_proto);
+::sync_pb::WebAppSpecifics::UserDisplayMode ToWebAppSpecificsUserDisplayMode(
+ DisplayMode user_display_mode);
+
} // namespace web_app
#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_PROTO_UTILS_H_