blob: 5eb9e7f0af1d695b4d013304c6efa974205eb485 [file] [log] [blame]
Alan Cuttereb525cd02020-06-20 03:12:421// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_PROTO_UTILS_H_
6#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_PROTO_UTILS_H_
7
8#include <vector>
9
10#include "base/optional.h"
11#include "chrome/browser/web_applications/web_app.h"
12#include "components/sync/protocol/web_app_specifics.pb.h"
13
14namespace web_app {
15
16using RepeatedIconInfosProto =
17 const ::google::protobuf::RepeatedPtrField<::sync_pb::WebAppIconInfo>;
18
19base::Optional<std::vector<WebApplicationIconInfo>> ParseWebAppIconInfos(
Alan Cutter1e6a3ac42020-06-24 05:04:1320 const char* container_name_for_logging,
Alan Cuttereb525cd02020-06-20 03:12:4221 RepeatedIconInfosProto icon_infos_proto);
22
Glen Robertson2c6387b2020-07-10 06:31:5923// Use the given |app| to populate a |WebAppSpecifics| sync proto.
24sync_pb::WebAppSpecifics WebAppToSyncProto(const WebApp& app);
25
Alan Cutter40c10a62020-06-24 07:07:4626base::Optional<WebApp::SyncFallbackData> ParseSyncFallbackDataStruct(
Alan Cuttereb525cd02020-06-20 03:12:4227 const sync_pb::WebAppSpecifics& sync_proto);
28
Glen Robertson2c6387b2020-07-10 06:31:5929::sync_pb::WebAppSpecifics::UserDisplayMode ToWebAppSpecificsUserDisplayMode(
30 DisplayMode user_display_mode);
31
Alan Cuttereb525cd02020-06-20 03:12:4232} // namespace web_app
33
34#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_PROTO_UTILS_H_